Replies: 2 comments 1 reply
-
|
You can lock view b's x zoom like so: onViewStateChange={({viewId, viewState}) => {
if (viewId == "a") {
//Left view changed
setViewStates({
a: viewState,
b: {
...viewState,
zoom: [viewStates.b.zoom[0], viewState.zoom[1]]
}
});
}
...
}} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks for the help. I haven't yet been able to achieve perfect alignment between both sides, so I'm using a different strategy for now. Thanks! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been struggling to get a specific zoom effect working on a simple example as shown here. I'm using the newly added feature as of 8.6 to allow independent zooming of X and Y axes in
OrthographicView.I would like to be able to scroll in the left half of the screen to zoom the left scatterplot vertically along the y-axis, and the right-hand scatterplot should remain aligned vertically during this. This is working as intended. I also would like scrolling on the right side of the screen to expand/contract the right-hand scatterplot horizontally without affecting the left-hand zoom. This is also working. However, once the right-hand plot has been zoomed, it should remain at its horizontal zoom level if the left-hand plot is subsequently zoomed in/out. Currently, zooming on the left side will reset the right-hand side’s zoom level. I imagine the answer lies somewhere in the
onViewStateChangefunction, maintaining the target/zoom arrays of each view, but I haven’t been able to find a solution yet. I would greatly appreciate any advice!Beta Was this translation helpful? Give feedback.
All reactions