简体   繁体   English

通过鼠标滚轮以编程方式执行缩放以获取D3平行坐标图

[英]performing zoom with mouse wheel programmatically for D3 parallel coordinates plot

I am using Parallel Coordinates in D3 in my application. 我在我的应用程序中在D3中使用平行坐标。 I want to add a zoom function programmatically. 我想以编程方式添加缩放功能。

Zoom function working well now but I am still have a little problem which is: I want to zoom to the mouse position. 缩放功能现在可以正常工作,但是我仍然有一个小问题:我想缩放到鼠标位置。

I have the X and Y of the mouse in an array but i do not know how to use them later to zoom in this position. 我在数组中具有鼠标的X和Y,但是我不知道以后如何使用它们来放大此位置。

What I get till now is SVG zoomed but the screen is always in the left and top of the page. 到目前为止,我得到的是SVG缩放,但屏幕始终在页面的左侧和顶部。

How can I use the mouse position coordinates in zooming to get the area around the mouse cursor on the screen? 如何在缩放中使用鼠标位置坐标来获取屏幕上鼠标光标周围的区域?

i could do what i want by using window.scrollTo(x,y), so that i can zoom and place the screen to mouse position. 我可以通过使用window.scrollTo(x,y)做我想做的事,这样我就可以缩放并将屏幕放置到鼠标位置。 maybe i was not clear in my question but that what i want. 也许我的问题不清楚,但是我想要的是什么。 Thanks, 谢谢,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM