Issue 76 in canviz: Suggest drawing nodes after edges in class CanvizGraph

6 views
Skip to first unread message

can...@googlecode.com

unread,
May 26, 2014, 1:42:11 PM5/26/14
to canviz...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 76 by johnno1...@googlemail.com: Suggest drawing nodes after
edges in class CanvizGraph
http://code.google.com/p/canviz/issues/detail?id=76

I've encountered a problem rendering the attached dot file. I was hoping
to be able to click on all nodes to raise a prompt() which is intercepted
in my application. You will see for many nodes (e.g. the UIWebView) this is
not possible. This seems to be due to the event being stolen by an
overlapping bounding div of a bezier line/arrow/egde path connecting some
other two nodes. Put another way the bounding boxes of the connecting
arrows are stealing the events from the <a> element in the node label as
they are rendered after.

If you render the attached file it should be evident what I mean. The
solution is to draw the "nodes" after the "edges" so they get priority on
events in function CanvizGraph.draw :

--- canviz.js 2014-05-26 18:07:19.000000000 +0100
***************
*** 399,405 ****
},
draw: function($super, ctx, ctxScale, redrawCanvasOnly) {
$super(ctx, ctxScale, redrawCanvasOnly);
! [this.subgraphs, this.nodes, this.edges].each(function(type) {
type.each(function(entity) {
entity.draw(ctx, ctxScale, redrawCanvasOnly);
});
--- 399,405 ----
},
draw: function($super, ctx, ctxScale, redrawCanvasOnly) {
$super(ctx, ctxScale, redrawCanvasOnly);
! [this.subgraphs, this.edges, this.nodes].each(function(type) {
type.each(function(entity) {
entity.draw(ctx, ctxScale, redrawCanvasOnly);
});



Attachments:
graph-xdot.gv 91.2 KB
canviz.js 24.8 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages