bumbeishvili / org-chart

Highly customizable org chart. Integrations available for Angular, React, Vue
https://stackblitz.com/edit/web-platform-o5t1ha
MIT License
928 stars 330 forks source link

why does the original node moves from it's place when the expand button is clicked? #303

Closed akshay-developer-2021 closed 1 year ago

akshay-developer-2021 commented 1 year ago

how to stop it? it makes it hard to focus on the original node, and the animation is too fast, and not sure how we can customize the animation speed or stop the node from moving altogether.

bumbeishvili commented 1 year ago
  1. It moves because by default active is centered, set it to chart.setActiveNodeCentered(false) to disable movement

https://github.com/bumbeishvili/org-chart/blob/279153efe64de34f011db458f7f2655884a2fef0/src/d3-org-chart.js#L68

  1. You can override duration to slow down animation

https://github.com/bumbeishvili/org-chart/blob/279153efe64de34f011db458f7f2655884a2fef0/src/d3-org-chart.js#L66