Inherit from another plot

Hi everyone,

I have a scenario where I want to overlay a few glyphs onto different plots. The issue I’m running into is that these glyphs have their own HoverTool initialized in the following way:

p = figure()

annotations_source = ColumnDataSource(annotations_df.to_dict(‘list’))

annotated_tooltips = [(‘Date’, ‘@formatted_date’),
(‘App’, ‘@application’),
(‘Type’, ‘@type’),
(‘Description’, ‘@description’),
(‘Version’, ‘@version’)]

annotations_points_glyph = Circle(x=‘date’, y=‘max_y’, fill_color=‘grey’,
line_color=‘black’, size=10)

annotations_points_renderer = p.add_glyph(annotations_source, annotations_points_glyph)

annotated_hover_tool = HoverTool(renderers=[annotations_points_renderer], tooltips=annotated_tooltips)

I then import from this module into other plots and register the hover tool via p.add_tools. The issue is that the annotations glyphs are not rendering and I suspect it is because I’m using a separate figure object for them. Hope that makes sense!

Hi Chris,

I’m not understanding can you post a more complete code example - maybe as a gist?

Sincerely,

Sarah Bird

···

On Thu, Aug 27, 2015 at 5:04 PM, [email protected] wrote:

Hi everyone,

I have a scenario where I want to overlay a few glyphs onto different plots. The issue I’m running into is that these glyphs have their own HoverTool initialized in the following way:

p = figure()

annotations_source = ColumnDataSource(annotations_df.to_dict(‘list’))

annotated_tooltips = [(‘Date’, ‘@formatted_date’),
(‘App’, ‘@application’),
(‘Type’, ‘@type’),
(‘Description’, ‘@description’),
(‘Version’, ‘@version’)]

annotations_points_glyph = Circle(x=‘date’, y=‘max_y’, fill_color=‘grey’,
line_color=‘black’, size=10)

annotations_points_renderer = p.add_glyph(annotations_source, annotations_points_glyph)

annotated_hover_tool = HoverTool(renderers=[annotations_points_renderer], tooltips=annotated_tooltips)

I then import from this module into other plots and register the hover tool via p.add_tools. The issue is that the annotations glyphs are not rendering and I suspect it is because I’m using a separate figure object for them. Hope that makes sense!

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/6b5a050c-de38-4122-b729-2aa0bb9e9723%40continuum.io.

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