react-d3-graph
react-d3-graph copied to clipboard
Issues with the focusedNodeId capability
Describe the bug This is a follow up to https://github.com/danielcaldas/react-d3-graph/pull/374 and https://github.com/danielcaldas/react-d3-graph/pull/341. Although some of the bugs concerning the animated zoom capabilities were addressed, there are still a few gaps that need to be addressed, although with lower priority.
To Reproduce
- onZoomChange prop isn't properly called when zooming in on focused node
I tried to add this in .on('end', _zoomEnd) in _zoomConfig but that zoom function isn't called at all when focusing on a node id
- Putting it in UNSAFE_componentWillReceiveProps caused an infinite loop and a crash
- Trying to zoom (with the mouse wheel) while a node is focused causes a weird "jump" in the zoom level (the focused node zoom seems to take precedence but only after an update)
- Trying to pan while there's a focusedNodeId can have unpredictable results; sometimes it will "jump" around and sometimes it won't
Thanks, @TranquilMarmot for the details.
Expected behavior The above-described bugs should go away.
Environment:
- OS: All
- Browser: All
- react-d3-graph version: >=2.5.0
- d3 version: not relevant
- react version: not relevant
Additional context For additional context check the first PR https://github.com/danielcaldas/react-d3-graph/pull/341