VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

change appearence of a node dynamically

Open jagandeep opened this issue 11 years ago • 2 comments
trafficstars

Is it possible to change the appearance of a node dynamically?? After graph has been rendered.

jagandeep avatar Feb 06 '14 17:02 jagandeep

Yes it is possible.

You can use the following function, and if you give it the id of an existing node, it will update that node.

graph.addNode( id_of_existing_node, some_node_related_data);

aecepoglu avatar Feb 20 '14 13:02 aecepoglu

graph.addNode works very well outside of an event call. But i don't know why, when a node is changed dynamically during a event, it has strange behave. I think it's related to the comment of dynamicNodeChange.html demo file : // This will trigger UI update. However this is not perfect // If update happens in the middle of user interaction with node // most likely it will cause input manager to choke

but i cannot find any workaround yet .. :(

quentinflahaut avatar Mar 08 '14 16:03 quentinflahaut