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

Skip to first unread message

Fanyin zhang

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
pic2: lasso
pic3:When you use a lasso to select data, you can drag data to other label or chart.

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
0 new messages