danielcaldas / react-d3-graph

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

Node dragging animations #436

Open onlyreddy opened 3 years ago

onlyreddy commented 3 years ago

Hi,

I started using your package in my product and I felt something is missing with the animations.

If you consider the d3-force-directed graph it's providing nice animation for nodes drag, if I drag one node then automatically all the nodes are moving with respect to the node.

Demo link for d3-force-directed

I tried with automaticRearrangeAfterDropNode: true also by disabling nodeHighlightBehavior but still, I can't get that effect.

Did I missed anything, can you please help me out on this.

Thanks, Mahesh Reddy

antoninklopp commented 3 years ago

Hi @onlyreddy ,

I think that you could use update callbacks like onNodePositionChange to change the position of connected nodes according to one node position change. I don't really think that this is something that react-d3-graph should provide out of the box since it seems really specific.

What do you think?

danielcaldas commented 3 years ago

It would be a nice experience enhancement tough to provide this force animations out of the box when clients set nodeHighlightBehavior to true.