Hi Bryan,
The following minimal code will reproduce the issue I am encountered. Note that the tooltips for the upper left point (1, 3) displays correctly while the other two points do not show any tooltips when mouse hover over them. I am sure now it is caused by one of column data is np.nan
. For example, the middle point (2, 2) has np.nan
in F_LAM column, and the bottom point (3, 1) has np.nan
in F_HEX column.
import numpy as np
import bokeh.plotting as bplot
from bokeh.models import ColumnDataSource, HoverTool
bplot.output_file(‘test_hover_float_format’)
TOOLS = “crosshair,pan,box_zoom,reset,tap,previewsave”
colors = [‘#e41a1c’, ‘#377eb8’]
x = [1, 2, 3]
y = [3, 2, 1]
stable_phase = [‘HEX’, ‘HEX’, ‘LAM’]
F = {‘LAM’: [3.28457, np.nan, 2.889993], ‘HEX’: [2.99933, 3.90011, np.nan]}
fill_color = [colors[0], colors[0], colors[1]]
source = ColumnDataSource(dict(x=x, y=y, stable_phase=stable_phase,
F_LAM=F[‘LAM’], F_HEX=F[‘HEX’],
fill_color=fill_color))
raw = bplot.figure(tools=TOOLS, width=450, height=450)
raw.scatter(‘x’, ‘y’, source=source, size=12,
fill_color=fill_color, line_color=None, name=‘phase_point’)
tooltips1 = [(“phase”, “@stable_phase”),
(“(x, y)”, “(@x{0.00}, @y{0.00})”),
(“F_LAM”, “@F_LAM{0.0000}”),
(“F_HEX”, “@F_HEX{0.0000}”),
]
hover1 = HoverTool(tooltips=tooltips1, names=[‘phase_point’],
mode=‘mouse’, point_policy=‘snap_to_data’)
raw.add_tools(hover1)
bplot.show(raw)
···
On Thursday, November 12, 2015 at 3:57:58 PM UTC-8, Bryan Van de ven wrote:
Yuxin,
It’s possible you have exposed an unknown bug. I think you are going to have to provide a complete minimal runnable example that demonstrates the problem in order for us to be able to help much more. At a certain point there is not much more we can do without being able to reproduce the problem directly, since this will require debugging in the browser.
Thanks,
Bryan