Skip to content
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

Option to resize generated ERD, change aspect ratio #105

Open
Baerbeisser opened this issue Jun 3, 2021 · 3 comments
Open

Option to resize generated ERD, change aspect ratio #105

Baerbeisser opened this issue Jun 3, 2021 · 3 comments

Comments

@Baerbeisser
Copy link

Baerbeisser commented Jun 3, 2021

Problem: the font of an ERD with 2nd level relations ([main]--[2]--[3]) is barely readable in a presentation, but fills only the upper half of the display. Too wide, too less height.

I tried to set the font to a bigger size, hoping Erd would reorder the tables but:

  • Changing it on some tables only, the changed tables look the same, all other smaller.
  • Changing it on all tables, everything loooks the same as before (bigger font but scaled down, still same layout).

Is there some way to tell Erd to generate images with different size/aspcet ratio, reordering the tables accordingly?

@kukimik
Copy link
Contributor

kukimik commented Jun 19, 2021

I'd try to generate dot files using erd, then tweak them manually and run through Graphviz.

Some of the options that tell Graphviz how to layout the diagram are hardcoded in erd, and many of them are inacessible through erd's interface. If you don't mind that, you can tweak the code and recompile. You may for example try to remove A.RankDir A.FromLeft here:

graphAttrs [ A.RankDir A.FromLeft
It worked for me with some more complex diagrams.


@mmzx @BurntSushi Maybe the user should be given the possibility to provide arbitrary graphviz attributes? I think this can be achieved without much cost using the UnknownAttribute constructor. The syntax could be e.g.

{ custom_graphviz-property-name: graphviz-property-value }

We don't validate this and just assume that the users know what they are doing.

I believe this could radically improve the usability without much implementation and maintenance cost.

@mmzx
Copy link
Collaborator

mmzx commented Jul 2, 2021

@kukimik I like the idea of custom properties, as long it would not introduce additional complexity regarding the configuration and consistency with existing switches. I am wondering...

@kukimik
Copy link
Contributor

kukimik commented Aug 30, 2021

I was wrong. Using UnknownAttribute is not a good idea. Although this could work, the grapviz library docs forbid using the UnknownAttribute constructor for this. See the docs and sources of validUnknown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants