schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

Feature request: allow for addition / override of dot attributes #181

Closed philCryoport closed 6 years ago

philCryoport commented 6 years ago

Environment

Other relevant libraries: 03/16/2017 09:36 AM 41,203 slf4j-api-1.7.25-jar.jar (came with SchemaCrawler release) 01/14/2018 11:09 AM 993,917 graphviz-java-0.2.3-jar.jar 01/14/2018 11:09 AM 661,033 graphviz-java-0.2.3-source.jar (downloaded the GraphViz native Java libraries using the SchemaCrawler download tool.)

Issue

Please explain the issue briefly

  • Provide the steps that you took to reproduce the issue
  • Provide any steps that you took to solve the issue
  • Zip and attach the SchemaCrawler debug logs, which can be obtained by running SchemaCrawler with an additional -loglevel=ALL on the command-line argument

I use SchemaCrawler to -server=mysql -portablenames -Gdpi=300 -outputformat=scdot. With the large number of tables and foreign key relationships in my database, this results in a diagram with many near-overlapping edges.

It would be great to be able to provide a configuration file that would allow me to alter the dot default values for:

And add a value for:

Right now it requires me to output a dot file and then manually edit that dot output file to do a change like this:

graph [
    nodesep="0.18"
    ranksep="0.46"
    rankdir="RL"
    fontname="Helvetica"
    fontsize="8"
  ];

to this:

graph [
    nodesep="1"
    ranksep="1"
    rankdir="RL"
    fontname="Helvetica"
    fontsize="8"
    splines="polyline"
  ];

It looks like the dot values are hard-coded in https://github.com/schemacrawler/SchemaCrawler/blob/master/schemacrawler-tools/src/main/resources/dot.header.txt

Would you please update the SchemaCrawler application accordingly?

Thanks!

sualeh commented 6 years ago

Good idea. I will look at a way to do this.

philCryoport commented 6 years ago

Hi there! I see you implemented code and code-tests for this feature. Thank you.

When you have a moment -- and if you haven't already -- would you please update the documentation so I can have example commands to model?

Thanks.

sualeh commented 6 years ago

Phil, I am trying to get you a release as soon as possible. :smile:

philCryoport commented 6 years ago

Sorry, don't mean to rush you 8) I saw the commit and wanted to help...

sualeh commented 6 years ago

Please use the latest release, v14.20.06. You can find documentation on the SchemaCrawler diagramming page.

sualeh commented 6 years ago

@philCryoport - did this work for you?

philCryoport commented 6 years ago

With schemacrawler-14.20.06-distribution on Windows 10, adding the following two lines to schemacrawler.config.properties:

schemacrawler.graph.graphviz.graph.ranksep=1.0
schemacrawler.graph.graphviz.graph.splines=polyline

Works great with:

PDF has no errors and at initial glance does seem complete.

Now, if I then add the following in addition to schemacrawler.config.properties:

schemacrawler.graph.graphviz.graph.nodesep=1.0

...I get the following error message when I open the PDF in Adobe Reader DC:

image

...and the top of the diagram cuts off:

A diff of the dot files generated with and without the nodesep line shows: image (and later on a comparison of generated on dates but that doesn't matter in this case)

sualeh commented 6 years ago

Thanks for testing. The problem you describe is a Graphviz or Adobe Acrobat issue, and outside of SchemaCrawler. I would suggest trying to open the PDF file in Foxit PDF Reader to see if you get better results.

philCryoport commented 6 years ago

Indeed it does open without complaint or any at-first-glance visual problems in Foxit Reader :)

Thank you for adding the feature!

sualeh commented 6 years ago

Glad it worked for you.