flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
192 stars 24 forks source link

Merge keyMap mode doesn't work #48

Closed plankter closed 3 years ago

plankter commented 3 years ago

It looks like there is a bug with keyMap set to "merge". Whatever I do, I cannot merge selected points.

flekschas commented 3 years ago

Details please. What have you set keyMap to?

plankter commented 3 years ago

Hi,

I have the following settings:

this.scatterplot = createScatterplot({
      syncEvents: true,
      canvas: canvas,
      width: width,
      height: height,
      opacity: 1,
      pointSize: 2,
      pointSizeSelected: 1,
      pointOutlineWidth: 1,
      pointColor: [255, 140, 0],
      lassoMinDelay: 15,
      lassoClearEvent: "lassoEnd",
      showReticle: false,
      deselectOnDblClick: true,
      deselectOnEscape: true,
      mouseMode: "panZoom",
      keyMap: { shift: "lasso", ctrl: "merge" },
    });

I tried to set mouseMode to lasso, but it didn't help.

Best regards, Anton

flekschas commented 3 years ago

I cannot reproduce this. Works fine for me with cmd, alt, shift, and meta. I don't have a windows machine so I can't directly test ctrl.

Without knowing what exactly you have tried, it's going to be hard to debug.

FYI, mouseMode is unrelated to merging selections.

plankter commented 3 years ago

You are right, I tried regl-scatterplot examples and setting keyMap: { ctrl: "merge" } there did work properly. I think there is an error on my side.

flekschas commented 3 years ago

A very simple test you could do is listen to a click event in your app and check if ctrlKey is true when you hold down CTRL