MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.49k stars 306 forks source link

fix: keep data consistent w/ or w/o snapToGrid enabled #72

Closed sinan closed 4 years ago

sinan commented 4 years ago

This fixes the data integrity when snapToGrid option is not passed. If we do not explicitly store only x and y values, browser passes some extra information such as deltaX, deltaY and node. Where node inserts a full property list of an element that is being interacted with. This creates a huge performance problem whether it is kept in internal state or external.

In my case I pass chart to a redux state, and this creates circular references, and it crashes the redux devtools.

This is also mentioned in #58.