[Dot] *.png and *.cmapx sometimes produce different outputs with dot
Ported Issue from Mantis Original ID: 1311 Reported By: Elliott
SEVERITY: MINOR Submitted: 2008-04-30 16:56:51
OS: X86-LINUX-UBUNTU 8.04
VERSION: 2.16
DESCRIPTION
Using pygraphviz and django, I'm dynamically creating maps of the fiber in our company's datacenter. Each node (representing a device) has a URL to a detail page for that device, so I have to generate an image and put cmapx on top of it.
Most of the time it works fine, but sometimes, i'll get cases where the URLs will be far removed from where its corresponding node is on the graph, to the point where you have clickable regions out in the middle of nowhere and links on top of the nodes are nowhere to be found.
I don't know what commands were used, but I can say i'm using pygraphviz 3.5 and used the following commands in python to generate the graphs:
graph.layout(prog="dot") graph.draw(format="png", path=image_path) output=graph.draw(format="cmapx", path=None) ..
STEPS TO REPRODUCE
digraph network_map { graph [nodesep=".6", overlap=false ]; "#1 (closed)" [URL="/network/view/device/29/", shape=box]; "322C" [URL="/network/view/device/2/", shape=box]; "#1 (closed)" -> "322C" [color=black, weight=1]; "322B" [URL="/network/view/device/3/", shape=box]; "#1 (closed)" -> "322B" [color=black, weight=1]; "#2" [URL="/network/view/device/33/", shape=box]; "324A" [URL="/network/view/device/4/", shape=box]; "#2" -> "324A" [color=navy, label="(3)", weight=3]; "001A" [URL="/network/view/device/19/", shape=box]; Out [URL="/map/graph/"]; "001A" -> Out [color=goldenrod, label="(15)", weight=15]; "001B" [URL="/network/view/device/23/", shape=box]; "001B" -> Out [color=darkgreen, label="(7)", weight=7]; "001B" -> "001A" [color=navy, label="(2)", weight=2]; "001C" [URL="/network/view/device/15/", shape=box]; "001C" -> "001B" [color=black, weight=1]; "001C" -> Out [color=goldenrod, label="(13)", weight=13]; "001C" -> "001A" [color=black, weight=1]; "001D" [URL="/network/view/device/6/", shape=box]; "001D" -> "001A" [color=goldenrod, label="(10)", weight=10]; "001D" -> "001B" [color=navy, label="(3)", weight=3]; "001D" -> "001C" [color=goldenrod, label="(13)", weight=13]; "102B" [URL="/network/view/device/13/", shape=box]; "103H" [URL="/network/view/device/12/", shape=box]; "102B" -> "103H" [color=darkgreen, label="(9)", weight=9]; "103B" [URL="/network/view/device/39/", shape=box]; "114A" [URL="/network/view/device/8/", shape=box]; "103B" -> "114A" [color=navy, label="(2)", weight=2]; "103C" [URL="/network/view/device/5/", shape=box]; "103C" -> "114A" [color=black, weight=1]; "103C" -> "102B" [color=darkgreen, label="(9)", weight=9]; "103H" -> "001C" [color=navy, label="(2)", weight=2]; "103H" -> "001B" [color=darkgreen, label="(5)", weight=5]; "103H" -> "001A" [color=navy, label="(2)", weight=2]; "114A" -> "001D" [color=darkgreen, label="(5)", weight=5]; "321A" [URL="/network/view/device/49/", shape=box]; "321A" -> "001D" [color=black, weight=1]; "322B" -> "001D" [color=goldenrod, label="(15)", weight=15]; "322C" -> "001D" [color=darkgreen, label="(5)", weight=5]; "324A" -> "103C" [color=goldenrod, label="(10)", weight=10]; "324B" [URL="/network/view/device/38/", shape=box]; "324B" -> "103B" [color=navy, label="(2)", weight=2]; "t2-221sw" [URL="/network/view/device/1/", shape=box]; "t2-221sw" -> "114A" [color=navy, label="(2)", weight=2]; "t2-221sw" -> "322B" [color=goldenrod, label="(14)", weight=14]; "t2-221sw" -> "324B" [color=navy, label="(2)", weight=2]; "t2-221sw" -> "#2" [color=navy, label="(3)", weight=3]; "t2-221sw" -> "324A" [color=darkgreen, label="(7)", weight=7]; "t2-221sw" -> "321A" [color=black, weight=1]; "t2-221sw" -> "322C" [color=navy, label="(4)", weight=4]; "t2-221sw" -> "#1 (closed)" [color=navy, label="(2)", weight=2]; }
ADDITIONAL INFORMATION
[ellson] I just checked graphviz-2.18 and it seems ok.
I did: dot -Tpng -Tcmapx b1344.dot -O cmap_tester.tcl b1344.dot >b1344.out.png
(cmap_tester.tcl is available in graphviz CVS. It generates an image on stdout with is an overlay of the map in turquoise onto the graph.)