TapTool Multiple Selection without Holding Shift

I understand that one needs to hold the shift key, say, when selecting multiple circles. I just want the opposite tap behavior to be the default.

Is there a way to select multiple circles using the TapTool without holding shift?

The shift-key behavior is currently hardcoded. I think you'd have to write a custom extension to do that, though you could probably crib the current implementation and just change a line or two:

  https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts

Thanks,

Bryan

···

On Dec 31, 2017, at 08:44, [email protected] wrote:

I understand that one needs to hold the shift key, say, when selecting multiple circles. I just want the opposite tap behavior to be the default.

Is there a way to select multiple circles using the TapTool without holding shift?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c125a82c-9a40-486b-849b-e9162c88d66d%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks, Bryan. I’ll take a look at that. Is there a straightforward way to detect in the callback that the user has clicked on empty space and, therefore, deselected everything?

···

On Sunday, December 31, 2017 at 3:39:05 PM UTC-5, Bryan Van de ven wrote:

The shift-key behavior is currently hardcoded. I think you’d have to write a custom extension to do that, though you could probably crib the current implementation and just change a line or two:

    [https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts](https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts)

Thanks,

Bryan

On Dec 31, 2017, at 08:44, [email protected] wrote:

I understand that one needs to hold the shift key, say, when selecting multiple circles. I just want the opposite tap behavior to be the default.

Is there a way to select multiple circles using the TapTool without holding shift?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c125a82c-9a40-486b-849b-e9162c88d66d%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Looks like I can just attach a callback to the column data source itself and check for a zero length:

cds.callback = CustomJS(code=“”"

if (cb_obj.selected[‘1d’].indices.length == 0){

console.log(“Everything has been deselected”)

}

“”")

···

On Monday, January 1, 2018 at 11:19:10 PM UTC-5, Sean Law wrote:

Thanks, Bryan. I’ll take a look at that. Is there a straightforward way to detect in the callback that the user has clicked on empty space and, therefore, deselected everything?

On Sunday, December 31, 2017 at 3:39:05 PM UTC-5, Bryan Van de ven wrote:

The shift-key behavior is currently hardcoded. I think you’d have to write a custom extension to do that, though you could probably crib the current implementation and just change a line or two:

    [https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts](https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts)

Thanks,

Bryan

On Dec 31, 2017, at 08:44, [email protected] wrote:

I understand that one needs to hold the shift key, say, when selecting multiple circles. I just want the opposite tap behavior to be the default.

Is there a way to select multiple circles using the TapTool without holding shift?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c125a82c-9a40-486b-849b-e9162c88d66d%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Sean,

That seems fairly reasonable. There may be corner cases that I'm not aware of offhand but if it's working for your use case then I wouldn't try to dissuade you. :slight_smile: I was going to mention that another possibility might be to make a CustomJS callback for a TapTool that does hit-testing and selection in the callback, but this seems even simpler.

Thanks,

Bryan

···

On Jan 2, 2018, at 00:41, [email protected] wrote:

Looks like I can just attach a callback to the column data source itself and check for a zero length:

cds.callback = CustomJS(code="""
    if (cb_obj.selected['1d'].indices.length == 0){
        console.log("Everything has been deselected")
    }
    """)

On Monday, January 1, 2018 at 11:19:10 PM UTC-5, Sean Law wrote:
Thanks, Bryan. I'll take a look at that. Is there a straightforward way to detect in the callback that the user has clicked on empty space and, therefore, deselected everything?

On Sunday, December 31, 2017 at 3:39:05 PM UTC-5, Bryan Van de ven wrote:
The shift-key behavior is currently hardcoded. I think you'd have to write a custom extension to do that, though you could probably crib the current implementation and just change a line or two:

        https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/tap_tool.ts

Thanks,

Bryan

> On Dec 31, 2017, at 08:44, sean...@gmail.com wrote:
>
> I understand that one needs to hold the shift key, say, when selecting multiple circles. I just want the opposite tap behavior to be the default.
>
> Is there a way to select multiple circles using the TapTool without holding shift?
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c125a82c-9a40-486b-849b-e9162c88d66d%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/098b4815-5189-4c2c-b584-ae0a88f118e4%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.