how to identify each part in stackedvbar

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot

Hi,

Th stacked vbar and hbar functions return a list of renderers, one for each "layer" in the stack. The tap tool callback does not receive any information about which glyph renderer is involved (only which entry in a CDS the hit corresponds to). So I think the only current way to discriminate by renderer is to add a different tap tool for each renderer that vbar_stack returns separately:

  [r1, r2, ... ] p.vbar_stack(...)
  TapTool(renderers=[r1], callback=cb1, ...)
  TapTool(renderers=[r2], callback=cb2, ...)

It would probably make sense to report the renderer in the "cb_data" payload that the callback receives. Please fee free to open a GH issue to discuss adding this feature.

Thanks

Bryan

···

On Jun 8, 2018, at 08:21, peng wang <[email protected]> wrote:

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot

--
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/4f4f5ac2-d61b-402e-b01a-f2cf6bd0fa02%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks a lot, could I also overlay vbar to generate a stackedvbar and use figure.select(“tap”) to handle click or select event?

···

On Friday, June 8, 2018 at 9:21:12 AM UTC-6, peng wang wrote:

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot

and also, could I dynamically display another plot based on “mouse click” event? thanks a lot, buddy

···

On Friday, June 8, 2018 at 11:02:08 AM UTC-6, Bryan Van de ven wrote:

Hi,

Th stacked vbar and hbar functions return a list of renderers, one for each “layer” in the stack. The tap tool callback does not receive any information about which glyph renderer is involved (only which entry in a CDS the hit corresponds to). So I think the only current way to discriminate by renderer is to add a different tap tool for each renderer that vbar_stack returns separately:

    [r1, r2, ... ] p.vbar_stack(...)

    TapTool(renderers=[r1], callback=cb1, ...)

    TapTool(renderers=[r2], callback=cb2, ...)

It would probably make sense to report the renderer in the “cb_data” payload that the callback receives. Please fee free to open a GH issue to discuss adding this feature.

Thanks

Bryan

On Jun 8, 2018, at 08:21, peng wang [email protected] wrote:

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot


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/4f4f5ac2-d61b-402e-b01a-f2cf6bd0fa02%40continuum.io.

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

Hi,

The tap event is probably not very useful unless you don't mind doing all your own hit-testing. All it does is say "a tap happened at this x/y location". If you use vbar (instead of vbar_stack) and each vbar has its own unique data source, then that could work. If they all share the same data source, then you are back to not being able to tell which glyph was hit. You could definitely display another plot if you wanted.

Thanks,

Bryan

···

On Jun 8, 2018, at 10:42, peng wang <[email protected]> wrote:

and also, could I dynamically display another plot based on "mouse click" event? thanks a lot, buddy

On Friday, June 8, 2018 at 11:02:08 AM UTC-6, Bryan Van de ven wrote:
Hi,

Th stacked vbar and hbar functions return a list of renderers, one for each "layer" in the stack. The tap tool callback does not receive any information about which glyph renderer is involved (only which entry in a CDS the hit corresponds to). So I think the only current way to discriminate by renderer is to add a different tap tool for each renderer that vbar_stack returns separately:

        [r1, r2, ... ] p.vbar_stack(...)
        TapTool(renderers=[r1], callback=cb1, ...)
        TapTool(renderers=[r2], callback=cb2, ...)

It would probably make sense to report the renderer in the "cb_data" payload that the callback receives. Please fee free to open a GH issue to discuss adding this feature.

Thanks

Bryan

> On Jun 8, 2018, at 08:21, peng wang <[email protected]> wrote:
>
>
>
> Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot
>
>
>
> --
> 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/4f4f5ac2-d61b-402e-b01a-f2cf6bd0fa02%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/d4331d6e-299f-47bb-af49-17cb501eb726%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

clear enough, thanks a lot

···

On Friday, June 8, 2018 at 3:37:29 PM UTC-6, Bryan Van de ven wrote:

Hi,

The tap event is probably not very useful unless you don’t mind doing all your own hit-testing. All it does is say “a tap happened at this x/y location”. If you use vbar (instead of vbar_stack) and each vbar has its own unique data source, then that could work. If they all share the same data source, then you are back to not being able to tell which glyph was hit. You could definitely display another plot if you wanted.

Thanks,

Bryan

On Jun 8, 2018, at 10:42, peng wang [email protected] wrote:

and also, could I dynamically display another plot based on “mouse click” event? thanks a lot, buddy

On Friday, June 8, 2018 at 11:02:08 AM UTC-6, Bryan Van de ven wrote:

Hi,

Th stacked vbar and hbar functions return a list of renderers, one for each “layer” in the stack. The tap tool callback does not receive any information about which glyph renderer is involved (only which entry in a CDS the hit corresponds to). So I think the only current way to discriminate by renderer is to add a different tap tool for each renderer that vbar_stack returns separately:

    [r1, r2, ... ] p.vbar_stack(...)
    TapTool(renderers=[r1], callback=cb1, ...)
    TapTool(renderers=[r2], callback=cb2, ...)

It would probably make sense to report the renderer in the “cb_data” payload that the callback receives. Please fee free to open a GH issue to discuss adding this feature.

Thanks

Bryan

On Jun 8, 2018, at 08:21, peng wang [email protected] wrote:

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot


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/4f4f5ac2-d61b-402e-b01a-f2cf6bd0fa02%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/d4331d6e-299f-47bb-af49-17cb501eb726%40continuum.io.

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

Considering that drill-down bar-charts are an increasingly desirable use-case, this would really benefit a lot of users. I am, similarly, trying to generate a drill-down vbar_stack based on the select of a segment of the first-level vbar_stack. As I understand, it would right now not be possible, unless the renderer is packed into the callback cb_data? Or in case it IS indeed possible, it would really help a long way to see a small example. Thanks, @Bryan, for all your support!

···

On Friday, June 8, 2018 at 8:51:12 PM UTC+5:30, peng wang wrote:

Hi guys, I have a specific question: a stackedVbar figure is generated ,let us say, if I use mouse to click on a specific part on one stackedvbar and like to display a subplot. what should I do? How can I identify each part of the stackedbar? thanks a lot