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

different ways of distributing the models on the diagram #107

Open
jmriego opened this issue Jul 2, 2021 · 4 comments
Open

different ways of distributing the models on the diagram #107

jmriego opened this issue Jul 2, 2021 · 4 comments

Comments

@jmriego
Copy link

jmriego commented Jul 2, 2021

Hi!
I was wondering if it's possible to organise the models in some way. When I don't add any relationships the models are stacked vertically but I'd prefer to change that if possible.
If not, at least some hints to set the models left or right of the diagram would be useful

Thanks!

@mmzx
Copy link
Collaborator

mmzx commented Jul 2, 2021

Hi,
The entities are placed in a way as GraphViz finds it appropriate to render. A specifically desired placement is probably difficult to achieve, influencing the placement may be possible: there could be parameters on the API of GraphViz but those are not supported directly by erd.
Maybe you could apply post processing on the dot format which can be obtained by using erd with the -d switch? For instance:
erd -i ./simple.er -d -f plain would produce:

graph 1 4.125 1.9306
node Person 0.80556 0.96528 1.6111 1.9306 "Person|name|height|weight|birth\ date|birth_place_id" solid record black lightgrey
node "Birth Place" 3.375 0.96528 1.5 1.6111 "Birth\ Place|id|birth\ city|birth\ state|birth\ country" solid record black lightgrey
edge Person "Birth Place" 4 1.6115 0.96528 1.9353 0.96528 2.3064 0.96528 2.6244 0.96528 dashed gray50
stop

@jmriego
Copy link
Author

jmriego commented Jul 3, 2021

thanks @mmzx ! that looks indeed like an option

I am trying to understand how this works. I was looking at a similar program https://github.com/ehne/ERDot and it seems like they accept the rankAdjustments parameter to adjust this. Not sure if they can influence GraphViz directly or they do something else like modifying the positions directly

@kukimik
Copy link
Contributor

kukimik commented Oct 11, 2021

It'd be really nice if ERD allowed to manually define the layout (at least in part). This feature is available e.g. in t2erd. With large diagrams the current output of ERD is, in practice, often unusable. This is basically the same problem as in #105.

@jrouly
Copy link

jrouly commented Apr 16, 2024

Just providing a complete example of using dot to do postprocessing as @mmzx described --

layout_engine=osage
docker run --rm -i ghcr.io/burntsushi/erd:latest -d -f dot < "foo.er" | dot -K$layout_engine -Tpng > foo.png

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

4 participants