react-d3-graph
react-d3-graph copied to clipboard
Set initial translation for the background canvas
Describe your use case When the graph renders, the background canvas g is translated to (0,0) with scale 1. I was wondering whether it is possible to set a specific set of initial translation values. The point is to store the current translation in a database so that a user could resume their work at the exact same point where it was left.
Additional Context Such a feature would be similar to the focusNodeId but ideally specifying the x,y translation, and scale intended.
I think I figured out how to retrieve the translation (from attribute transform of element g, first child of svg) but I'm still not sure how to set it from react