reaviz/reagraph

Initial Zoom offcenter

Closed this issue · 0 comments

Describe the bug

The animation on the enter of the chart is not centered. Currently it starts offset and slides over. It should start from the center. I think the issue is the zoom factor is not accounted for and thus causing it to be offset when it transitions in.

The CameraControls is probably where the problem lies - https://github.com/reaviz/reagraph/blob/master/src/CameraControls/useCenterGraph.ts#L46

Steps to Reproduce the Bug or Issue

Open a graph and notice it slide and zoom rather than zoom from center.

2024-01-29_10-43-31.mp4

Expected behavior

It zooms from the center