BurntSushi / erd

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.
The Unlicense
1.8k stars 154 forks source link

Labels of ortho edges are misplaced #96

Closed kukimik closed 10 months ago

kukimik commented 3 years ago

When the edge type is set to ortho, the labels are misplaced. See the label "home" and "away" in the example below.

> erd -i examples/nfldb.er -o out.png -f png -e ortho

misplaced_labels

This is really a Graphviz issue:

agerr(AGWARN, "Orthogonal edges do not currently handle edge labels. Try using xlabels.\n");

Following their suggestion, I tried to use A.XLabel instead of A.Label in this line: https://github.com/BurntSushi/erd/blob/06c72643682a42a890a2ffadac82cfc1dafd5edd/app/Main.hs#L62

The labels are now placed correctly, though Graphviz chooses other routes for the edges:

xlabels

So I believe XLabel should be used instead of Label, at least for orthogonal edges. I'm not a Graphviz guru and don't know what are the implications of using xlabels, and whether this needs some extra tweaking. Any suggestions?