Spacetree implementation for Petri net

56 views
Skip to first unread message

Pirquessa

unread,
Dec 6, 2009, 7:59:29 AM12/6/09
to JavaScript Information Visualization Toolkit
Hi,

First of all, thanks a lot for this awesome JS Class !

I'm currently trying to represent a Petri net' marking accessible but
i'm facing a problem. You see Spacetree is very powerfull for graphs
like :

(id: '0' children: [(id: '00' children: []),
(id: '01' children: [(id: '010' children: []),
(id: '011' children:
[])
])
])

But i need to draw some additional line between root and last child
like the '010'. To do this I'm trying to use onAfterPlotNode like that
(with the node to link stored in the data property) :

onAfterPlotNode: function(node) {
if(node.data.length>0)
{
if(!node.adjacentTo(node.data))
{
st.graph.addAdjacence(st.graph.getNode(node.data), node);
}
}
}

This way works if I clic on a node to refresh the graph. The method
st.graph.refresh() don't works :( How can I refresh the graph or add
my additional lines by other way ?

I hope that my trouble is clear and that you will be able to help me.

Best regards,
Pierre Cauhopé

Pirquessa

unread,
Dec 6, 2009, 8:12:19 AM12/6/09
to JavaScript Information Visualization Toolkit
Reply all
Reply to author
Forward
0 new messages