crubier / react-graph-vis

A react component to render nice graphs using vis.js
http://crubier.github.io/react-graph-vis/
MIT License
958 stars 171 forks source link

Hierarchical layout redraws every time on changed props #18

Closed Radivarig closed 7 years ago

Radivarig commented 7 years ago

When I use hierarchical layout and make a selection with select event callback that affects my store which sends new props with changed references to {nodes, edges} (lists have same items), everything redraws.

Radivarig commented 7 years ago

It doesn't reset if I set options.physics.enabled = false

Radivarig commented 7 years ago

If the node positions are changed regardless of disabled physics, it still resets positions whenever network.setOptions is called.

Radivarig commented 7 years ago

Closing as it's a visjs issue.

Radivarig commented 7 years ago

The conclusion is that whenever network.setOptions is called with options containing layout property, the graph is reset. I've opened an issue on vis repo.