Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001443graphvizOutput Generationpublic2008-10-13 20:452011-04-28 04:03
ReporterRyan Schmidt9 
Assigned Toerg 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOS*-*-OS Version
Summary0001443: cmap/cmapx output has duplicate ids for hrefs in HTML-like table cells
Description



When rendering the given graph to -Tcmap or -Tcmapx, the ids in the imagemap are not unique:
<CD>
<area shape="rect" id="a" href="cell1" title="<TABLE>" alt="" coords="32,25,40,33">
<area shape="rect" id="a" href="cell2" title="<TABLE>" alt="" coords="43,25,51,33">
</CD>
Steps To Reproduce

digraph G {
a [label=<<table><tr><td href="cell1"></td><td href="cell2"></td></tr></table>>]
}

Additional Information

[ryan]
I have more information to add to bug 1480 which I filed last year:


The problem of duplicate area ids can also be seen if an edge has a label, headlabel, and/or taillabel. Then, the rectangle(s) for the label(s) and the polygon for the edge itself have the same id:
<CD>
$ echo 'digraph G {a->b [label=l headlabel=hl taillabel=tl href=h]}' | dot -Tcmapx
<map id="G" name="G">
<area shape="poly" id="edge2" href="h" title="l" alt="" coords="44,54 44,106 39,106 39,54"/>
<area shape="rect" id="edge2" href="h" title="l" alt="" coords="41,77,48,96"/>
<area shape="rect" id="edge2" href="h" title="hl" alt="" coords="40,98,54,117"/>
<area shape="rect" id="edge2" href="h" title="tl" alt="" coords="30,56,41,75"/>
</map>
$
</CD>

In HTML, an id must be unique. It is not permitted for more than one element to have a given id. If Graphviz is going to assign ids to areas, each one must be unique, for example:

<CD>
<map id="G" name="G">
<area shape="poly" id="edge2" href="h" title="l" alt="" coords="44,54 44,106 39,106 39,54"/>
<area shape="rect" id="edge2-label" href="h" title="l" alt="" coords="41,77,48,96"/>
<area shape="rect" id="edge2-headlabel" href="h" title="hl" alt="" coords="40,98,54,117"/>
<area shape="rect" id="edge2-taillabel" href="h" title="tl" alt="" coords="30,56,41,75"/>
</map>
</CD>

There is a further problem if you ever want to have more than one graph with image map on a single HTML page, as the ids would again collide. I suggest fixing this in Graphviz by always prepending the graph name to each area id, e.g.:

<CD>
<map id="G" name="G">
<area shape="poly" id="G-edge2" href="h" title="l" alt="" coords="44,54 44,106 39,106 39,54"/>
<area shape="rect" id="G-edge2-label" href="h" title="l" alt="" coords="41,77,48,96"/>
<area shape="rect" id="G-edge2-headlabel" href="h" title="hl" alt="" coords="40,98,54,117"/>
<area shape="rect" id="G-edge2-taillabel" href="h" title="tl" alt="" coords="30,56,41,75"/>
</map>
</CD>


TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID1480
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENTFixed (26 Jan 2011)
VERSION     2.21.20081012.0445
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => erg


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