Figure Tools

bokeh 0.12.2

I currently have a scatter:

scatter = figure(tools=[TOOLS,hover], active_scroll='wheel_zoom', active_drag='box_select',
                 plot_width=self.width_scatter, plot_height=(self.height_scatter),
                 toolbar_location="right", title="title",
                 x_axis_label='x axis', y_axis_label='y axis',
                 y_range=(-5,100)
                 )

``

hover is a HoverTool

I also have an annular_wedge attached to that figure:

aw_empty = scatter.annular_wedge(x=int(max_distance / 2), y=50, source=donut_source,
                                 inner_radius='inner_r',
                                 outer_radius='outer_r',
                                 start_angle=0, end_angle='endempty',
                                 color='orange', alpha=.6)

``

and finally data points in that figure:

r = scatter.scatter(x='sum', y='empercent', source=main_source, size=8,
 color='color', alpha=0.6)

I currently have my tools attached to the overall scatter. Is it possible to have the hover tool only on the data points(“r”) and not on the annular_wedge(“aw_empty”)?

Thank you

I Figured it out.

In the hover tool add names = [‘scatter’]

hover = HoverTool(tooltips=[
 ('Apples', '@ Apples{int}'),
 ('Bananas', '@ Bananas'),
 ],
 names = ['scatter']
)

then in your scatter add name = ‘scatter’

scatter = figure(tools=[TOOLS,hover], active_scroll=‘wheel_zoom’, active_drag=‘box_select’,
plot_width=self.width_scatter, plot_height=(self.height_scatter),
toolbar_location=“right”, title=“title”,
x_axis_label=‘x axis’, y_axis_label=‘y axis’,
y_range=(-5,100), name = 'scatter’
)


``

the hover tool should only work for figures you set in names

<details class='elided'>
<summary title='Show trimmed content'>&#183;&#183;&#183;</summary>

On Tuesday, November 1, 2016 at 11:37:29 AM UTC-5, kanga...[email protected] wrote:
> bokeh 0.12.2

> 

> I currently have a scatter:
> 

> 
> ```
> scatter = figure(tools=[TOOLS,hover], active_scroll='wheel_zoom', active_drag='box_select',
>                  plot_width=self.width_scatter, plot_height=(self.height_scatter),
>                  toolbar_location="right", title="title",
>                  x_axis_label='x axis', y_axis_label='y axis',
>                  y_range=(-5,100)
>                  )
> ```

> ``

> hover is a HoverTool

> 

> 
> I also have an annular_wedge attached to that figure:

> 

> ```
> aw_empty = scatter.annular_wedge(x=int(max_distance / 2), y=50, source=donut_source,
>                                  inner_radius='inner_r',
>                                  outer_radius='outer_r',
>                                  start_angle=0, end_angle='endempty',
>                                  color='orange', alpha=.6)
> ```

> ``

> 

> and finally data points in that figure:

> 
> ```
> r = scatter.scatter(x='sum', y='empercent', source=main_source, size=8,
>  color='color', alpha=0.6)

> 
> ```
> 
> 
> ```
> ```
> I currently have my tools attached to the overall scatter. Is it possible to have the hover tool only on the data points("r") and not on the annular_wedge("aw_empty")?
> ```
> ```
> 
> 
> ```
> ```
> Thank you
> ```

</details>

You can also set the renderers property, as done in this example:

  http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#hover-inspections

Thanks,

Bryan

···

On Nov 2, 2016, at 12:52 PM, [email protected] wrote:

I Figured it out.

In the hover tool add names = ['scatter']
hover = HoverTool(tooltips=[
('Apples', '@ Apples{int}'),
('Bananas', '@ Bananas'),
],
names = ['scatter']
)

then in your scatter add name = 'scatter'
scatter = figure(tools=[TOOLS,hover], active_scroll='wheel_zoom', active_drag='box_select',
                 plot_width=self.width_scatter, plot_height=(self.height_scatter),
                 toolbar_location="right", title="title",
                 x_axis_label='x axis', y_axis_label='y axis',
                 y_range=(-5,100), name = 'scatter'
                 )

the hover tool should only work for figures you set in names

On Tuesday, November 1, 2016 at 11:37:29 AM UTC-5, [email protected] wrote:
bokeh 0.12.2

I currently have a scatter:

scatter = figure(tools=[TOOLS,hover], active_scroll='wheel_zoom', active_drag='box_select',
                 plot_width=self.width_scatter, plot_height=(self.height_scatter),
                 toolbar_location="right", title="title",
                 x_axis_label='x axis', y_axis_label='y axis',
                 y_range=(-5,100)
                 )
hover is a HoverTool

I also have an annular_wedge attached to that figure:

aw_empty = scatter.annular_wedge(x=int(max_distance / 2), y=50, source=donut_source,
                                 inner_radius='inner_r',
                                 outer_radius='outer_r',
                                 start_angle=0, end_angle='endempty',
                                 color='orange', alpha=.6)

and finally data points in that figure:

r = scatter.scatter(x='sum', y='empercent', source=main_source, size=8,
color='color', alpha=0.6)

I currently have my tools attached to the overall scatter. Is it possible to have the hover tool only on the data points("r") and not on the annular_wedge("aw_empty")?

Thank you

--
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/60c42bd4-4c96-43ec-a964-27dcb7e556d9%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.