Disabling highlighting on tap tool when using figures

Hi Everyone,

I’m using the figure api to draw some quads on a grid, and I want to add some custom click functionality, but I see that the taptool does some highlighting that I actually want turned off. I searched posts and found there was a way to do this with glyph API, but what about the higher level figureAPI is there anyway?

Hi,

it's actually the same across all the APIs. Ultimately, all Bokeh plots turn into the same pile of objects, and configuring the highlighting policy is a matter of setting some property values on one of these kinds of objects, a GlyphRenderer. You can see examples here:

  Appearance — Bokeh 3.3.2 Documentation

(Note: that is a link to "dev" docs) Now it's probably a little clunkier to get ahold of the glyph renderers of a Chart, because bokeh.charts works at a high level and put alot of these things together on you behalf. We can work to try and make this simpler to do but for you you can find all the renderers (including the GlyphRenderers that you want to modify) in the ".renderers" property or your chart:

  In [3]: p = Bar(df, 'yr', values='displ',
     ...: title="Total DISPL by YR", bar_width=0.4)

  In [4]: p.renderers
  Out[4]:
  [<bokeh.models.renderers.GlyphRenderer at 0x1084814e0>,
   <bokeh.models.renderers.GlyphRenderer at 0x1084817f0>,
   <bokeh.models.renderers.GlyphRenderer at 0x108481b00>,
   <bokeh.models.renderers.GlyphRenderer at 0x108481e10>,
   <bokeh.models.renderers.GlyphRenderer at 0x108481ef0>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496240>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496550>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496860>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496b70>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496ef0>,
   <bokeh.models.renderers.GlyphRenderer at 0x1084a22b0>,
   <bokeh.models.renderers.GlyphRenderer at 0x108496c18>,
   <bokeh.models.renderers.GlyphRenderer at 0x1084a2128>,
   <bokeh.models.axes.CategoricalAxis at 0x1084a24a8>,
   <bokeh.models.axes.LinearAxis at 0x1084a26a0>,
   <bokeh.models.grids.Grid at 0x1084a26d8>]

Can you make an issue on GitHub for a feature to make this simpler to change on bokeh.charts?

Bryan

···

On Dec 14, 2015, at 2:19 PM, [email protected] wrote:

Hi Everyone,

I'm using the figure api to draw some quads on a grid, and I want to add some custom click functionality, but I see that the taptool does some highlighting that I actually want turned off. I searched posts and found there was a way to do this with glyph API, but what about the higher level figureAPI is there anyway?

--
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/9cf19371-354c-4026-b817-9d12a30e3b77%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.