Add Hover on quad glyph

Hi,

I’m trying to add a Hover on my quad glyph, but it’s dont work.

Example on a notebook:
import pandas as pd

from bokeh.plotting import Figure, output_notebook
from bokeh.models import ColumnDataSource, HoverTool

output_notebook()

df=pd.DataFrame({‘DETECT’:[‘DETECT’,‘DETECT’,‘NON_DETECT’,‘NON_DETECT’],
‘CATEG’:[‘CATEG1’,‘CATEG2’,‘CATEG1’,‘CATEG2’],
‘right’:[0.8,0.8,1.8,1.8],
‘left’:[1.2,1.2,2.2,2.2],
‘bottom’:[0, 20, 0, 20],
‘top’:[19,40,19,40]})

source=ColumnDataSource(df)
hover = HoverTool(tooltips=[(“CATEG”, “@CATEG”)])

plot = Figure(plot_height=600, plot_width=600, title=“Nb cnt”,x_range=list(df[‘DETECT’].unique()))
plot.add_tools(hover)

plot.quad(right=‘right’,left=‘left’,bottom=‘bottom’,top=‘top’,source=source,color=[“red”,“blue”,“red”,“blue”])

show(plot)

``

I don’t if i do wrong or it’s not working.

Cordially,
Emrall

I think this might be a bug with quad and hit-testing. Can you file an issue on GH with this information? As a workaround for now, hover/hit-testing certainly works with "rect".

Bryan

···

On Apr 6, 2016, at 7:06 AM, Emrall <[email protected]> wrote:

Hi,

I'm trying to add a Hover on my quad glyph, but it's dont work.

Example on a notebook:
import pandas as pd

from bokeh.plotting import Figure, output_notebook
from bokeh.models import ColumnDataSource, HoverTool

output_notebook()

df=pd.DataFrame({'DETECT':['DETECT','DETECT','NON_DETECT','NON_DETECT'],
                 'CATEG':['CATEG1','CATEG2','CATEG1','CATEG2'],
                  'right':[0.8,0.8,1.8,1.8],
                  'left':[1.2,1.2,2.2,2.2],
                  'bottom':[0, 20, 0, 20],
                  'top':[19,40,19,40]})

source=ColumnDataSource(df)
hover = HoverTool(tooltips=[("CATEG", "@CATEG")])

plot = Figure(plot_height=600, plot_width=600, title="Nb cnt",x_range=list(df['DETECT'].unique()))
plot.add_tools(hover)

plot.quad(right='right',left='left',bottom='bottom',top='top',source=source,color=["red","blue","red","blue"])

show(plot)

I don't if i do wrong or it's not working.

Cordially,
Emrall

--
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/7588892b-5fde-473f-bb7e-6d6297f71b7f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.