react-d3-graph icon indicating copy to clipboard operation
react-d3-graph copied to clipboard

Issues with the focusedNodeId capability

Open danielcaldas opened this issue 4 years ago • 0 comments

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

danielcaldas avatar Dec 18 '20 03:12 danielcaldas