Skip to content

Commit 2ca91bb

Browse files
Merge pull request #4 from joeygrable94/view_optional
Optionally Display Output SVG by Default
2 parents 43fa4bf + 4088534 commit 2ca91bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlalchemy_data_model_visualizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import re
1313
Base = declarative_base()
1414

15-
def generate_data_model_diagram(models, output_file='my_data_model_diagram', add_labels=True):
15+
def generate_data_model_diagram(models, output_file='my_data_model_diagram', add_labels=True, view_diagram=True):
1616
# Initialize graph with more advanced visual settings
1717
dot = graphviz.Digraph(comment='Interactive Data Models', format='svg',
1818
graph_attr={'bgcolor': '#EEEEEE', 'rankdir': 'TB', 'splines': 'spline'},
@@ -59,7 +59,7 @@ def generate_data_model_diagram(models, output_file='my_data_model_diagram', add
5959
dot.edge(name, target_name, label=rel.key if add_labels else None, tooltip=tooltip, color="#1E88E5", style="dashed")
6060

6161
# Render the graph to a file and open it
62-
dot.render(output_file, view=True)
62+
dot.render(output_file, view=view_diagram)
6363

6464

6565
def add_web_font_and_interactivity(input_svg_file, output_svg_file):

0 commit comments

Comments
 (0)