Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HoverTool can't adress source with ö #13697

Closed
mosc9575 opened this issue Feb 16, 2024 · 1 comment · Fixed by #13723
Closed

[BUG] HoverTool can't adress source with ö #13697

mosc9575 opened this issue Feb 16, 2024 · 1 comment · Fixed by #13723

Comments

@mosc9575
Copy link
Contributor

mosc9575 commented Feb 16, 2024

Expected behavior

I expect that the HoverTool is able to display information from the data of a ColumnDataSource, even if the key has special letters like ö in it.

Observed behavior

If the key contains a special letter like ö, the HoverTool displays ??? and adds the key without the first letter.

Example code

from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show, output_notebook
output_notebook()

source = ColumnDataSource(data=dict(
    x=[1, 2, 3, 4, 5],
    y=[2, 5, 8, 2, 7],
    desc=['A', 'b', 'C', 'd', 'E'],
    wörter=['A', 'b', 'C', 'd', 'E'],
))
TOOLTIPS = [("desc", "@desc"), ("Wörter", "@wörter")]
p = figure(width=400, height=400, tooltips=TOOLTIPS, title="Mouse over the dots")
p.circle('x', 'y', size=20, source=source)
show(p)

BrokenHoverTool

Technical Information ### Software versions

Python version : 3.10.13 | packaged by conda-forge | (main, Oct 26 2023, 18:07:37) [GCC 12.3.0]
IPython version : 8.14.0
Tornado version : 6.3.3
Bokeh version : 3.3.4
BokehJS static path : /opt/conda/envs/aiva-env/lib/python3.10/site-packages/bokeh/server/static
node.js version : v18.15.0
npm version : 9.5.0
Operating system : Linux-4.19.0-21-amd64-x86_64-with-glibc2.35

Browser name and version

Google Chrome Version 121.0.6167.184 (Offizieller Build) (64-Bit)

@mattpap
Copy link
Contributor

mattpap commented Feb 16, 2024

This works:

TOOLTIPS = [("desc", "@desc"), ("Wörter", "@{wörter}")]

i.e. full reference syntax. The short/simplified syntax only works with names that are simple identifiers. Perhaps we could extend that a little bit, if there's a cheap and reliable way of doing this in JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants