lourenzo / canviz

Automatically exported from code.google.com/p/canviz
0 stars 0 forks source link

Use an image map to support clickable nodes and edges #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A new idea about how to handle clickability is to have Canviz request from the 
server not just the 
xdot representation but also the cmapx representation of the graph, both 
encapsulated into a 
JSON request. The image map is inserted into the document, and so is a 
transparent spacer gif 
which lies over the canvas. The image map is attached to the transparent spacer 
image. A test of 
this method can be checked out from the repository here:

http://code.google.com/p/canviz/source/browse/test/gvimagemap/

This work should probably be done in a branch as there will be several steps.

There will need to be code that re-computes the values in the image map when 
the scale of the 
graph is changed.

It may be desirable for the server to transform the raw cmapx (and possibly the 
xdot too) into a 
proper JSON representation rather than just putting the two raw formats into a 
JSON wrapper. 
This should reduce the amount of data that has to be sent over the wire.

Issue #11 was originally filed to support clicking, but the method focused on 
implementing hit 
detection code in the Path library in JavaScript. The problem is that in the 
xdot draw commands, 
Graphviz tells us how to draw the shape, but does not tell us its outline. For 
simple shapes like 
ovals these are the same, but for complex shapes they are not. Additionally, 
there is no 
information at all about clickable regions, of which there might be several if 
HTML-like labels are 
in use.

Original issue reported on code.google.com by ryandesi...@gmail.com on 26 Aug 2009 at 11:10