Right now the screen zooms out, This is slightly better than where often the node you clicked moves off the screen as the nodes move down when really the nodes should move around the note that was clicked so there isn't a jarring movement.
This can be done by:
- Get the x/y coordinated of the node that was clicked.
- Have Dagre calculate the new positions of all the nodes
- get the new coordinates of the node that was clicked
- Calculate the difference between the old x and the new x.
- update all the x coordinates by the difference
- do the same for y coordinates.
Right now the screen zooms out, This is slightly better than where often the node you clicked moves off the screen as the nodes move down when really the nodes should move around the note that was clicked so there isn't a jarring movement.
This can be done by: