-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct typos, change default output extensions and replace invalid characters from node name #2
base: master
Are you sure you want to change the base?
Conversation
Typo in concentrate option, semi-colons are not accepted in brackets, default extension for grapvhiz files is .gv or .dot.
Grapvhiz does not like dashes in node names, therefore I replace them with underscores
@@ -196,7 +195,7 @@ def create_rel(self, left_table_name, right_table_name, left_on=None, right_on=N | |||
self.table_gen_code.append(rel) | |||
|
|||
|
|||
def write_to_file(self, filename='output.txt'): | |||
def write_to_file(self, filename='output.gv'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was using the output.txt
to paste into a graphviz renderer. is this change so that you can just render it locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I cannot recall why I made this change specifically. Probably because .gv
is a standard extension for Grapvhiz DOT files. Likely I was using another tool that would pick up .gv
files and render them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, .gv
is the correct Graphviz DOT files. Graphviz is imported, but not sure if it's on the build yet...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the output is saved as a .gv file, graphviz library can be used to display it on the screen if using a notebook and can also be used to save it, as a png in this example.
...
raw_entity_relationship_diagram.write_to_file('raw_entity_relationship_diagram.gv')
graph = graphviz.Source.from_file('raw_entity_relationship_diagram.gv')
graph.render('erd_raw', format='png') #Save file
display(graph)
@@ -39,6 +40,7 @@ def __construct__(self): | |||
table_end = '\t\t' + '</table>>];' | |||
self.table_def.append(self.front_matter) | |||
for col, col_type in self.meta_info: | |||
col = col.replace("-", "_") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAHAHA! Someone has been playing with AWS Athena, @ba-tno ? ;)
fontname="Helvetica"; | ||
nodesep=0.5, | ||
rankdir="LR", | ||
concentrate=true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
No description provided.