Dynamically adding nodes to VisualGraph

34 views
Skip to first unread message

junaidabidi

unread,
Nov 2, 2009, 11:58:39 AM11/2/09
to BirdEye
Hi,

I am kind of new to the project and still playing around with it.

Here is what i am trying to achieve

1- Initiating the graph with static XML file ( i have done that and it
works fine)

2- Allowing the user to add and delete nodes / edges on the graph
( still working on it, struggling with retrieving the XML data from
the graph with updated node positions )

3- Save the updated XML with new node positions and colors into a
database ( again trying to find out how to access updated XML data
fromt the graph ?)

Any one got pointer on how to achieve this ?

Regards,
Junaid

junaidabidi

unread,
Nov 3, 2009, 10:48:04 AM11/3/09
to BirdEye
Well, i got it working except one last glitch .

Whenever I add a new node to the graph, if the graph resets all node
positions to initial x,y coordinates specified in XML file ( I am
using DirectPlacementLayouter)

This is how I am adding a new node --->(vgraph).addVNodeAsChild
(childData.@id, childData, startRoot.node);

Is there a way to suppress full refresh of graph at this point ?

junaidabidi

unread,
Nov 3, 2009, 12:26:00 PM11/3/09
to BirdEye
Further Update : Although it is an ugly solutions, but for the heck of
it , it sorts out issue with re-initiliazing all nodes to their start
position

for each (var temNode:Node in vgraph.graph.nodes)
{
temNode.vnode.x=temNode.vnode.viewX;
temNode.vnode.y=temNode.vnode.viewY;
(temNode.vnode.data as XML).@x=temNode.vnode.viewX;
(temNode.vnode.data as XML).@y=temNode.vnode.viewY;
> > Junaid- Hide quoted text -
>
> - Show quoted text -

ebowler

unread,
Nov 12, 2009, 3:02:33 PM11/12/09
to BirdEye
Where is the addVNodeAsChild() method? in
org.un.cava.birdeye.ravis.graphLayout.data.Graph ???
Looking for solution to add nodes dynamically also
Reply all
Reply to author
Forward
0 new messages