Hi, all,
I have a problem in hover.
As following simple example, I figured an object and then changed a property.
After session.store_objects() or session.store_document(), hover does not work.
Could you comment what I’m doing wrong? Or Is it a kind of bug?
Thanks in advance.
Connor.
from collections import OrderedDict
from bokeh.plotting import *
from bokeh.models import HoverTool
from bokeh.document import Document
from bokeh.session import Session
doc = Document()
ses = Session()
ses.use_doc(‘test’)
ses.load_document(doc)
x = [1]
y = [2]
radii = [0.5]
colors = [‘red’]
source = ColumnDataSource(
data=dict(
x=x,
y=y,
radius=radii,
colors=colors,
)
)
p = figure(title=“Test 1”, tools=“hover”)
p.circle(x, y, radius=radii, source=source,
fill_color=colors, fill_alpha=0.6, line_color=None)
hover =p.select(dict(type=HoverTool))
hover.tooltips = OrderedDict([
("(x,y)", “($x, $y)”),
(“radius”, “@radius”),
])
doc.add(p)
ses.store_document(doc)
import time
time.sleep(10)
p.title=“Test 2”
#ses.store_document(doc)
ses.store_objects(p, dirty_only=False)
``