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

bqplot tooltip not showing #11

Open
davidbrochart opened this issue Jul 30, 2019 · 5 comments
Open

bqplot tooltip not showing #11

davidbrochart opened this issue Jul 30, 2019 · 5 comments

Comments

@davidbrochart
Copy link
Member

davidbrochart commented Jul 30, 2019

In the example notebook, if you change the Line chart section with the following:

fig2 = plt.figure( title='Line Chart')
np.random.seed(0)
p = plt.scatter(x, y)

fig2.layout.width = 'auto'
fig2.layout.height = 'auto'
fig2.layout.min_height = '300px' # so it shows nicely in the notebook
fig2

p.interactions = {'click': 'select'}
p.selected_style = {'opacity': 1.0, 'fill': 'DarkOrange', 'stroke': 'Red'}
p.unselected_style = {'opacity': 0.5}
p.tooltip = bqplot.Tooltip(fields=['x', 'y'], formats=['', '.2f'])

# brushintsel = bqplot.interacts.BrushIntervalSelector(scale=p.scales['x'])

# def update_range(*args):
#     if brushintsel.selected is not None and brushintsel.selected.shape == (2,):
#         mask = (x > brushintsel.selected[0]) & (x < brushintsel.selected[1])
#         hist.sample = y[mask]
    
# brushintsel.observe(update_range, 'selected')
# fig2.interaction = brushintsel

There should be a tooltip on hover and a select on click. Both work in the notebook, but the tooltip on hover doesn't show in voila (the select on click works fine).

@mariobuikhuizen
Copy link
Member

Thanks for reporting this issue.

If I run your example in a notebook, I don't see a tooltip on hover or select on click. Could you check your example?

@davidbrochart
Copy link
Member Author

You should see something like this:

download

@mariobuikhuizen
Copy link
Member

It looks different on my system:
Schermafbeelding 2019-07-30 om 12 42 50

$ conda list |grep -E 'bqplot|ipywidgets|notebook'
bqplot 0.11.6 py_0 conda-forge
ipywidgets 7.5.1 py_0 conda-forge
notebook 6.0.0 py37_0 conda-forge

@davidbrochart
Copy link
Member Author

It's plt.scatter, not plt.plot.

@mariobuikhuizen
Copy link
Member

D'oh! I can reproduce the issue now. Thanks.

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

No branches or pull requests

2 participants