VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

g element not clearing

Open mcpat1993 opened this issue 7 years ago • 4 comments
trafficstars

Hi, I'm making a dynamic visualization of a network topology and I'm using VivaGraphJS. So far it's been great. Now I'm having the issue that there are residual link line strokes in the element within the element that is inside my container div. graph.clear() doesn't remove all of the lines created. I'm not sure what to do exactly to clear this element. screen shot 2018-03-20 at 15 57 17 screen shot 2018-03-20 at 15 57 04

mcpat1993 avatar Mar 20 '18 14:03 mcpat1993

graph.clear() removes every single node and link in the graph. Do you see any errors in the console when you run it?

anvaka avatar Mar 28 '18 04:03 anvaka

Nope, no errors when the function is run. All the clear function seems to do is stop isPinned from working, but the lines are still there.

mcpat1993 avatar Mar 28 '18 08:03 mcpat1993

I just encountered this. @mcpat1993 are you running this in React?

For my case, I realised that I was running graph.run() at every time data is loaded, resulting in duplicate elements although graph.clear() was run before loading. Solved this by placing graph.run() only at componentDidMount and clearing worked as expected.

ahmadsholehin avatar Apr 17 '18 09:04 ahmadsholehin

I am not running this in React.

I actually moved over to Cytoscape for my visualization stuff. I don't recall whether or not I was doing that, unfortunately.

mcpat1993 avatar Apr 17 '18 09:04 mcpat1993