Rotate 2D Graph? #523
-
Hi, first off: thanks for such a fantastic library! I have a feature question: is there a way to rotate the 2D graph? (Eventually, I'd love to to be able to rotate the graph canvas by dragging the mouse. But the mouse handling I can easily build myself - as long as there's a way to programmatically control the world rotation angle.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@rsimon thanks for reaching out. There isn't a built-in way to rotate the canvas itself, but you could achieve this by simply changing the x,y coordinates of the nodes themselves, based on your mouse handling events. For each of the nodes you can access and modify their current coordinates by manipulating the |
Beta Was this translation helpful? Give feedback.
@rsimon thanks for reaching out.
There isn't a built-in way to rotate the canvas itself, but you could achieve this by simply changing the x,y coordinates of the nodes themselves, based on your mouse handling events. For each of the nodes you can access and modify their current coordinates by manipulating the
x
andy
attributes of each node object.