question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] HoverTool in 'vline' mode doesn't work with vertical segments

See original GitHub issue

Bokeh version: 1.4 Python version: 3.7.5 Browser: Firefox / Chromium OS: Linux

When adding a HoverTool with mode='vline' to a plot with vertical segments, the tooltip is not displayed.

Example code:

from bokeh.io import output_file, save
from bokeh.models import HoverTool
from bokeh.plotting import figure

x = [1, 2, 3, 4]
y0 = [1] * 4
y1 = [2] * 4
fig = figure(tools=[HoverTool(mode='vline')])
fig.segment(x, y0, x, y1)
output_file('vline.html')
save(fig)

Screenshot: image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Mar 18, 2020

OK well let’s make a PR and go from there (the other reason to make a PR earlier is that it is much easier for other people to try out a PR)

1reaction
bryevdvcommented, Feb 23, 2020

@kumaran-14 the span coordinate geometry comes in as pixel coordinates. You can see that scale invert function is use to convert to back to “data space” (so that the spatial index an be used to get a first batch of potential hits). Scales also have a compute method, which goes in the opposite direction, converting from data space to pixel space. You can use that to convert segment data coordinates to pixel coordinates in a similar way, for the final comparison.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HoverTool hit detection fails on vertical and near-vertical segment ...
Maybe I'm doing something wrong, but the HoverTool does not appear to work for segment glyphs that have vertical orientation. from bokeh.plotting import ......
Read more >
Bokeh: Display only a single tooltip - python - Stack Overflow
from bokeh.models import (HoverTool, ColumnDataSource, Title, ... hover = HoverTool() hover.mode = 'vline' # activate hover by vertical line ...
Read more >
Bokeh 2.4.2 - FreshFOSS
Tasks: - #9458 component: bokehjs hovertool in 'vline' mode doesn't work with vertical segments. - #9581 Update dockertools.
Read more >
bokeh Changelog - pyup.io
12578 [component: bokehjs] [BUG] gridplot reset button does not reset all figures ... [bug] hovertool in 'vline' mode doesn't work with vertical segments...
Read more >
Source code for netpyne.analysis.interactive
... from bokeh.palettes import Viridis256 from bokeh.models import HoverTool ... and plot vertical lines for each spike to evidence synchrony if ``True``.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found