Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002341graphvizDotpublic2013-08-25 22:092013-08-29 11:29
Assigned Toerg 
PlatformMac using fink version of dotOSMac OS XOS Version10.7.5
Summary0002341: Multi-line edge labels take up too much space
DescriptionIn complex diagrams, multi-line labels take up more space than necessary. Simple cases seem to work correctly. Probably the internal layout rules are overly strict in some cases.
Steps To ReproduceUnfortunately I only have a complex example. The problem concerns the top edge label (on the red edge).
Label "NCPE" should be "NoConnPendingExc.".
Even though there is plenty of horizontal space, the red edge becomes much longer when the text is changed. It should stay at its current size.
Additional InformationCurrently I work around the bug by using "NCPE" as a placeholder and replacing it later in the generated Postscript file. The output looks good but of course I would prefer if graphviz generated the correct output right away.
TagsNo tags attached.
Attached Filesdot file icon [^] (1,366 bytes) 2013-08-25 22:09

- Relationships

-  Notes
User avatar (0000444)
erg (administrator)
2013-08-26 08:51

The reason for this is that edge labels are treated as nodes during layout. This helps in placement and guarantees there is enough space for them. In your graph, the column containing the node "connected" also contains the label node for the edge open -> err. The width of the column is determined by the width of the widest node. So if you make the edge label wide, the layout will expand.

As a workaround, you can change the label to an xlabel. These labels are added after the graph is laid out, so they have no effect on the base layout.
User avatar (0000450)
Telcontar (reporter)
2013-08-26 22:43

Thank you for your quick feedback. In the version of graphviz I am using, xlabel results in the label being placed at the target node rather than at the edge. So it may be something that either requires a newer version or does not work well in this case.
In any case, I have a workaround so a fix for label placement is not urgent (and I assume it's not easy to improve it without causing problems in other cases).
User avatar (0000454)
erg (administrator)
2013-08-29 11:29

Yes, the xlabel feature did not appear until 2.30. I'm surprised you are seeing any result from xlabel at all.
Using xlabel, your graph looks like [^]

- Issue History
Date Modified Username Field Change
2013-08-25 22:09 Telcontar New Issue
2013-08-25 22:09 Telcontar File Added:
2013-08-26 08:51 erg Note Added: 0000444
2013-08-26 08:51 erg Assigned To => erg
2013-08-26 08:51 erg Priority normal => low
2013-08-26 08:51 erg Status new => assigned
2013-08-26 22:43 Telcontar Note Added: 0000450
2013-08-29 11:29 erg Note Added: 0000454

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker