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

Hovertool display pops under shaded portion of slider #7991

Closed
magee256 opened this Issue Jun 12, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@magee256
Copy link

magee256 commented Jun 12, 2018

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh 0.12.16
python 3.6
MacOS 10.12.6
Chrome Version 66.0.3359.181 (Official Build) (64-bit)

Description of expected behavior and the observed behavior

I'd expect the hovertool info box to appear above all other widgets. Instead it pops under the slider, but only the shaded portion of the slider as demonstrated below.

Screenshots or screencasts of the bug in action

screen shot 2018-06-12 at 4 06 52 pm

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Jun 14, 2018

@magee256 please provide a compete minimal script to reproduce the issue

@magee256

This comment has been minimized.

Copy link
Author

magee256 commented Jun 16, 2018

Here's a minimal example. I extended the example here

import math

from bokeh.io import show, output_file
from bokeh.plotting import figure
from bokeh.models import GraphRenderer, StaticLayoutProvider, Oval, Circle
from bokeh.palettes import Spectral8

N = 8
node_indices = list(range(N))

plot = figure(title='Graph Layout Demonstration', x_range=(-1.1,1.1), y_range=(-1.1,1.1),
              tools='', toolbar_location='right')

graph = GraphRenderer()

graph.node_renderer.data_source.add(node_indices, 'index')
graph.node_renderer.data_source.add(Spectral8, 'color')
graph.node_renderer.glyph = Circle(size=15, fill_color='color')

graph.edge_renderer.data_source.data = dict(
    start=[0]*N,
    end=node_indices)

### start of layout code
circ = [i*2*math.pi/8 for i in node_indices]
x = [math.cos(i) for i in circ]
y = [math.sin(i) for i in circ]

graph_layout = dict(zip(node_indices, zip(x, y)))
graph.layout_provider = StaticLayoutProvider(graph_layout=graph_layout)

plot.renderers.append(graph)


# Adding widgets and plot to a doc
from bokeh.io import curdoc
from bokeh.models import HoverTool, ColumnDataSource, TableColumn
from bokeh.models.widgets import RangeSlider, TextInput, Button, Select, Toggle
from bokeh.models.widgets import Select, DataTable, TableColumn, CheckboxButtonGroup
from bokeh.models.widgets import Dropdown, MultiSelect, Div, AutocompleteInput
from bokeh.layouts import column, row

# Expanded node info shown here
hover_tool = HoverTool(tooltips=[
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
    ("Very Long Item:", "This label is very long which causes it to go over the widgets sometimes"),
])
plot.add_tools(hover_tool)

slider = RangeSlider(title='Shaded portion covers',
                     value=(0, 1), start=0, end=1, step=.01)
button = Button(label='Does not cover')
select =  Select(title="Does not cover", value="Does not cover",
                 options=['Does not cover'])
table = DataTable(source=ColumnDataSource({'This does not cover': ['But this does cover the hover box', 'and so does this']}), 
                  columns=[TableColumn(field='This does not cover', title='Does not cover')])


doc = curdoc()
widget_col = column(slider, select, button, table)
layout = row(widget_col, plot)
doc.add_root(layout)

In making the example, I found the hover tool does not work with Oval glyphs. Is that a known bug?

@magee256 magee256 closed this Jun 16, 2018

@magee256 magee256 reopened this Jun 16, 2018

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Jul 5, 2018

@magee256 ~~~It is not a bug, that functionality has simply not been implemented yet. There is an open PR now that will be merged soon that adds oval/ellipse hit testing support.~~~ Hit testing for ovals was only recently added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.