Suggest drawing nodes after edges in class CanvizGraph

#76 · open · 0 comments

View on GitHub ↗

GoogleCodeExporter

``` 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); }); ``` Original issue reported on code.google.com by `[email protected]` on 26 May 2014 at 5:42 Attachments: - [graph-xdot.gv](https://storage.googleapis.com/google-code-attachments/canviz/issue-76/comment-0/graph-xdot.gv) - [canviz.js](https://storage.googleapis.com/google-code-attachments/canviz/issue-76/comment-0/canviz.js)

Comments