interaction between tooltips and gridplots
See original GitHub issueI tried to build a grid plot involving tooltips. The result was that, if the tooltips display was not contained in the figure associated to it, it was truncated by the figure to the right and below as in the following example. However, it does not get truncated by figures above or to the left:
Screenshot
This one is truncated
This one is not:
Code
import numpy
from bokeh.plotting import figure, show, output_file
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.sampledata.iris import flowers
from bokeh.io import gridplot
from bokeh.models import HoverTool
df = flowers.copy()
df['cat_col'] = numpy.round(flowers.petal_width * 2)
colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
colors = [colormap[x] for x in df['species']]
result = []
for species in df['species'].unique():
sub_res = []
for cat in df['cat_col'].unique():
sub_df = df[(df['species'] == species) & (df['cat_col'] == cat)]
colors = [colormap[x] for x in sub_df['species']]
hoverdata = ['species:{} - cat:{}'.format(species, cat) for x in sub_df['species']]
source = ColumnDataSource(data=dict(hovercol=hoverdata))
hover = HoverTool(tooltips=[("Hover col", "@hovercol"),])
p = figure(tools=[hover])
p.circle(sub_df["petal_length"], sub_df["petal_width"],
color=colors, fill_alpha=0.2, size=10, source=source)
sub_res.append(p)
result.append(sub_res)
output_file("iris.html", title="iris.py example")
show(gridplot(result, plot_width=200, plot_height=200))
Bokeh version
Python version : 3.4.3 |Continuum Analytics, Inc.| (default, Dec 1 2015, 11:59:33) [MSC v.1600 32 bit (Intel)] IPython version : 4.0.0 Bokeh version : 0.12.1
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:20 (14 by maintainers)
Top Results From Across the Web
Hover tool renderer level - Bokeh Discourse
Hi, For certain bokeh layouts, I observe that the hover tool of one ... on GitHub: interaction between tooltips and gridplots · Issue...
Read more >Adding Hover Actions - Real Python
Interactive Data Visualization in Python With Bokeh ... this you'll employ Bokeh's HoverTool() to show a tooltip when the cursor crosses paths with...
Read more >Bokeh Tutorial — Adding Interactions - | notebook.community
from bokeh.plotting import figure from bokeh.io import gridplot x ... It is possible to link various interactions between different Bokeh plots.
Read more >Interactive Data Visualization with Bokeh - Trenton McKinney
Basic plotting with bokeh.plotting; Layouts, interactions, ... HoverTool() function to create a HoverTool called hover with tooltips=None and mode='vline' .
Read more >Formatting the HoverTool | Python - DataCamp
Format the field_goal_perc element of TOOLTIPS to display to the nearest two decimal places. Create the figure, labeling the x-axis as "Minutes" and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another option which doesn’t fix it, but may help, would be to implement hover in a fixed position, like on this leaflet demo: http://leafletjs.com/examples/choropleth.html
Yes versions definitely JS/Python need to match, in general. Not just between major releases, either. Are you intending to hard code a fixed BokehJS version but accept JSON output from arbitrary Python Bokeh versions? I would not regard that as reliable.
I had not planned on it. Until now, we only publish full releases to NPM. This is certainly something we can consider changing in the future, especially if there is increased interest in the NPM package. Given the compressed schedule to 2.0 this week I am not sure it’s worth it for me to scramble to do something different in the middle of release week. But we can have a very quick 2.0.1 if there are any follow-on issues.
Each release has its own (if any) migration notes:
https://docs.bokeh.org/en/dev/docs/releases.html
That said, while we do our best, we only put in what we think to put in based on the use cases we know about, so there may be things that are missed for some people.