danielcaldas / react-d3-graph

Interactive and configurable graphs with react and d3 effortlessly
https://danielcaldas.github.io/react-d3-graph/sandbox/
MIT License
819 stars 233 forks source link

Changing state causes graph to separate if d3 is set in config #472

Open jadenmazzone opened 3 years ago

jadenmazzone commented 3 years ago

Describe the bug If d3 is set in the config, when changing the state of data (links and nodes), the graph separates. If in the config staticGraphWithDragAndDrop is set to true, then the problem doesn't occur.

To Reproduce Steps to reproduce the behavior:

  1. set d3 in the config (can just be empty) ie d3:{}
  2. staticGraphWithDragAndDrop: false

Expected behavior The nodes should not move when changing state.

Screenshots Before changing state. Screen Shot 2021-06-09 at 1 32 27 PM

After changing state. Screen Shot 2021-06-09 at 1 32 40 PM

Environment:

OS: macOS Browser: chrome Version: 90 Node version: 14.15.4 react-d3-graph version: 2.6.0 d3 version: 5.16.0 react version: 16.13.1

Additional context Add any other context about the problem here.

jadenmazzone commented 3 years ago

I believe this is the same issue as: https://github.com/danielcaldas/react-d3-graph/issues/281