Open horatiubota opened 4 years ago
Thanks for reporting this! I've reproduced the problem with the latest release of HoloViews and Bokeh.
It is pretty bizarre that the float columns 'boiling point' and 'melting point' are fine with the space but the behavior of 'standard state' (string values presumably) does. Definitely looks like a bug to me.
to check the columns created by holoviews:
from bokeh.sampledata.periodic_table import elements
from bokeh.models import HoverTool
elements = elements.dropna(how='any').copy()
tooltips = [
('boiling point', '@{boiling point}{0,0.00}'),
('melting point', '@{melting point}{0,0.00}'),
('standard state', '@{standard state}'),
]
hover = HoverTool(tooltips=tooltips)
points = hv.Points(
elements, ['boiling point', 'melting point'],
['year discovered', 'standard state']
)
p = points.opts(
width=600, height=300,
tools=[hover],
line_color='black'
)
render = hv.renderer('bokeh')
pp = render.get_plot(p)
from bokeh.models import ColumnDataSource
source = plot.root.select_one(ColumnDataSource)
source.data.keys()
the output is
dict_keys(['boiling point', 'melting point', 'boiling_point', 'melting_point', 'year_discovered', 'standard_state'])
and the columns with underscore is created by the line:
dim = util.dimension_sanitizer(d.name)
in
ALL software version info
pandas 1.0.5 bokeh 2.1.1 holoviews 1.13.2 hvplot 0.5.2 (imported with
import hvplot.pandas
) jupyterlab 2.1.5 (lab extensions are up to date)Chrome 83, macOS Catalina
Description of expected behavior and the observed behavior
Text field in tooltip not showing up (i.e., shown as
???
) when there is a space in the column name. This does not happen when plotting with bokeh directly, and does not happen when there is no space in the column name. Also, this does not happen if the column contains numerical values (not text).Complete, minimal, self-contained example code that reproduces the issue
Renaming the text column from
standard state
tostandard_state
fixes the problem: