Skip to content

Commit

Permalink
Merge pull request #4 from joeygrable94/view_optional
Browse files Browse the repository at this point in the history
Optionally Display Output SVG by Default
  • Loading branch information
Dicklesworthstone committed Nov 10, 2023
2 parents 43fa4bf + 4088534 commit 2ca91bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlalchemy_data_model_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import re
Base = declarative_base()

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

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


def add_web_font_and_interactivity(input_svg_file, output_svg_file):
Expand Down

0 comments on commit 2ca91bb

Please sign in to comment.