Biel Cardona
unread,Jan 3, 2012, 6:59:20 AM1/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaScript InfoVis Toolkit
Hello,
I have been trying to build programmatically a ForceDirected graph
visualization and while doing so I have found what I think is a bug in
the code.
In short, the problem is that both the plot() and refresh() methods
depend heavily on the existence of the root node.
For instance, if you have a ForceDirected layout stored in var fd, and
you do:
fd.graph.removeNode(fd.root)
fd.plot()
all nodes vanish from the visualization.
Maybe a workaround could be to redefine the removeNode method so that
if the node is the root for the layout, then assign the root to
another (random?) node.
Also, and related to my original idea of building a graph
visualization without using loadJSON, I have been unable to do so...
For instance, if I do:
var fd = new $jit.ForceDirected({....});
var node = fd.graph.addNode({id:'_1',name:'first'});
node.getPos().setc(100,100);
fd.plot()
I get in the console the error "prefixConfig is undefined".
Do you have any advice on which is the best way to construct
programmatically (without loading JSON data) a ForceDirected layout?
Thank you in advance and best regards,
Biel