Two TapTool questions

I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what’s the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

I also noticed that only one TapTool can be active for a given x value. How can I have more than one TapTool that would distinguish between the multiple series plotted against a given x value? I understand at the moment one can only get an x coordinate (or index), not the name of the series that was tapped, is that correct?

···

On Tuesday, May 3, 2016 at 1:11:54 PM UTC+1, [email protected] wrote:

I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what’s the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

I would suggest that you want a CustomJS callback for your TapTool, that is configured with both data sources in the "args" dict for the callback.

Regarding the visual appearance of selections, those are set by policy, there is some information about that here:

  Appearance — Bokeh 3.3.2 Documentation

I think if you want nothing to look different, you could do:

  renderer.nonselection_glyph = renderer.glyph

or possibly (untested)

  renderer.nonselection_glyph = None
  
Thanks,

Bryan

···

On May 3, 2016, at 7:11 AM, [email protected] wrote:

I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what's the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

--
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/ff96fd61-83e7-4b1d-af69-0c26e1b6e9e1%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

I'm not sure that's true? I would not expect problems with multiple tap tools, each configured for a different set of renderers. Do you have any actual code you can share of what you've tried?

Thanks,

Bryan

···

On May 3, 2016, at 9:08 AM, [email protected] wrote:

I also noticed that only one TapTool can be active for a given x value. How can I have more than one TapTool that would distinguish between the multiple series plotted against a given x value? I understand at the moment one can only get an x coordinate (or index), not the name of the series that was tapped, is that correct?

On Tuesday, May 3, 2016 at 1:11:54 PM UTC+1, rootsum...@gmail.com wrote:
I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what's the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

--
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/c163dae1-e559-46fb-b79c-b7f1dcb51d0f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Fantastic, thank you. The CustomJS callback works like a charm.

Also true as far as the nonselection_glyph is concerned. I am back in control!

···

On 4 May 2016 7:46 p.m., “Bryan Van de Ven” [email protected] wrote:

I would suggest that you want a CustomJS callback for your TapTool, that is configured with both data sources in the “args” dict for the callback.

Regarding the visual appearance of selections, those are set by policy, there is some information about that here:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#selected-and-unselected-glyphs](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#selected-and-unselected-glyphs)

I think if you want nothing to look different, you could do:

    renderer.nonselection_glyph = renderer.glyph

or possibly (untested)

    renderer.nonselection_glyph = None

Thanks,

Bryan

On May 3, 2016, at 7:11 AM, [email protected] wrote:

I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what’s the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

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/ff96fd61-83e7-4b1d-af69-0c26e1b6e9e1%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/QzQjJs5P4f0/unsubscribe.

To unsubscribe from this group and all its topics, 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/038D1082-7C6B-430A-944E-CC005084F331%40continuum.io.

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

You are correct, my oversight. The TapTool takes a list of renderers, not just one renderer. It’s when you define several TapTools you get mutually exclusive TapTool icons in the toolbar…

···

On 4 May 2016 7:52 p.m., “Bryan Van de Ven” [email protected] wrote:

I’m not sure that’s true? I would not expect problems with multiple tap tools, each configured for a different set of renderers. Do you have any actual code you can share of what you’ve tried?

Thanks,

Bryan

On May 3, 2016, at 9:08 AM, [email protected] wrote:

I also noticed that only one TapTool can be active for a given x value. How can I have more than one TapTool that would distinguish between the multiple series plotted against a given x value? I understand at the moment one can only get an x coordinate (or index), not the name of the series that was tapped, is that correct?

On Tuesday, May 3, 2016 at 1:11:54 PM UTC+1, [email protected] wrote:

I have two plots that do not share the data source, but both understand the labels from the categorical x_range of plot one. When tapping an object in the first plot I want the second graph to show detail for that name.

Firstly, what’s the best way to organise communication between plot one and two? Secondly, tapping on an object greys out other objects in the plot. Is there a flag to tell TapTool not to grey out the other glyphs?

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/c163dae1-e559-46fb-b79c-b7f1dcb51d0f%40continuum.io.

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