d3 combine zoom、lasso and drag calls with the same scatter plot?

34 views
Skip to first unread message

Fanyin zhang

unread,
Nov 21, 2021, 11:04:46 PM11/21/21
to d3-js
i want to desige a form of interaction, as shown in the following  gif.
pic1: zoom
zoom.gif
pic2: lasso
lasso.gif
pic3:When you use a lasso to select data, you can drag data to other label or chart.
dragToOtherLabel.gif

The above is a separate demo, i want combin this in a svg or canvas.
But, I've had some tough problems, zoom and lasso both have drag event, it's confused. How to distinguish them?
i want to control it with keyboard event.
For example,  when ctrl key is pressed to trigger the zoom event, when shift key is pressed to trigger lasso.
follow my code, how to fix it?





Reply all
Reply to author
Forward
0 new messages