react-d3-graph icon indicating copy to clipboard operation
react-d3-graph copied to clipboard

Set initial translation for the background canvas

Open henri-edinb opened this issue 4 years ago • 1 comments

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.

henri-edinb avatar Jan 14 '21 21:01 henri-edinb

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

henri-edinb avatar Jan 16 '21 21:01 henri-edinb