flekschas / jupyter-scatter

Interactive 2D scatter plot widget for Jupyter Lab and Notebook. Scales to millions of points!
https://jupyter-scatter.dev
Apache License 2.0
392 stars 17 forks source link

Expose setLassoLongPressTime to python #123

Closed danr closed 7 months ago

danr commented 7 months ago

Hi, any plans to xpose setLassoLongPressTime to python? I think the current timeout of 750 ms is way too long and would want it to be much shorter.

Also it seems like the animation has changed? Now it's a circle arc increasing in angle, before it was a circle increasing in size. Any reason why it was changed?

Thanks!

flekschas commented 7 months ago

You can adjust any regl-scatterplot options with the options property.

scatter = Scatter(data=df, x='x', y='y', options=dict(lassoLongPressTime=500))

Previously jscatter defaulted to the double click-based lasso initiator but I switched it to the long press lasso initiator as I find it more usable. You can change that behavior back if you like using the options property as well. I believe all you have to do is to set lassoOnLongPress to False but double check the the regl-scatterplot settings

flekschas commented 7 months ago

To turn the two click-based lasso initiator on do

scatter = Scatter(data=df, x='x', y='y', options=dict(lassoInitiator=True, lassoOnLongPress=False))

Please note that the two click lasso initiator only triggers when you initially click onto an empty area. The default long press lasso initiator works everywhere.

I'm closing the issue for now but please feel free to reopen it if you have more questions.

danr commented 7 months ago

Thanks! Everything worked as you described. I have now tried the double click lasso initiator a bit more and it is slightly exhausting since after the double click you have to click in the circle to start the lasso, effectively making it a triple-click.

flekschas commented 7 months ago

You should really only need two clicks: one click to trigger the lasso initiator and then a second mouse down to start lassoing.

danr commented 7 months ago

You're correct, the initial double-click was unnecessary. That makes the initiator quite useful! Thanks!