Zooming to a certain point instead of mouse position #3643
Unanswered
blairmcalpine
asked this question in
Q&A
Replies: 1 comment
-
Ref. d3/d3-zoom#212 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using d3@7.3.0, and I would like to make a zoomable/pannable timeline with d3 zoom and a d3 timescale. My issue is that I want the timeline to zoom in and out of the center of the timeline as opposed to where my mouse position is. Here is my current behaviour:
And an example behaviour that I would like it to follow (note the zooming being on the center point of the timeline):
I've noticed that older versions of d3 had the zoom.center() function that seemed to cater to this behaviour, (an example that used it in a similar way to what I want) but it doesn't exist anymore. What would be the best way to implement this? Here is a general layout of my current code for reference as well (very simple of course):
Beta Was this translation helpful? Give feedback.
All reactions