skanaar / nomnoml

The sassy UML diagram renderer
https://www.nomnoml.com
MIT License
2.66k stars 208 forks source link

In loops of objects, "back" arrow descriptions often hidden. #82

Closed BradWells closed 5 years ago

BradWells commented 5 years ago

When there are shapes that end up all pointing to each other in a circle, the last arrow (what I will call the "back" arrow), if it is labeled, is often hidden behind the shape.

Example nomnoml snippet:

`

bgColor: #FFF

[1object] a -> b [2object] [2object] c -> d [3object] [3object] eeee -> fffff [1object]

[4object] gggggggggg -> hhhhhhhhh [4object]

[5object] iiiiiiiiiiiiiiiii -> jjjjjjjjjjjjjjj [5object] [6object] k -> l [5object]

[7object] mmmmm -> nnnnnnn [7object] [7object] ooooo -> ppppp [7object]

[10object] a -> b [11object] [11object] c -> d [12object] [12object] e -> f [13object] [13object] ggggg -> hhhhh [10object]

[8object] qqqqqqq -> rrrrrrrrrr [8object] [8object] ssssss -> ttttttt [8object] [9object] u -> v [8object] `

skanaar commented 5 years ago

The layouting of the arrow labels is done ad-hoc after the (much better) Dagre library has done the layouting of the boxes and arrows.

This leads to the labels being very poorly laid out for the more exotic diagrams.

It cannot really be significantly improved without switching layout algorithm since Dagre has no concept of arrow labels.

I would like to try to use Cassowary for this, but that is no small task unfortunately :(

skanaar commented 5 years ago

Closing this as it can only be fixed by a larger task