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

[BUG] Arrow glyph does not update #9436

Closed
m3bert opened this issue Nov 20, 2019 · 2 comments · Fixed by #10217
Closed

[BUG] Arrow glyph does not update #9436

m3bert opened this issue Nov 20, 2019 · 2 comments · Fixed by #10217

Comments

@m3bert
Copy link
Contributor

m3bert commented Nov 20, 2019

software version info

  • Bokeh 1.4.0
  • Python 3.7.5
  • Tornado 6.0.3
  • node.js 12.12.0

Description of expected behavior and the observed behavior

Arrow should change its length when updating its data via cds_arrow.data = dict(xS=[0], yS=[1], xE=[new], yE=[1]).
This worked in Bokeh version 1.0.2 (and Python 2.7).

Using cds_arrow.stream(dict(xS=[0], yS=[1], xE=[new], yE=[1]),rollover=1) the update works in both versions.

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Slider, Arrow, OpenHead
from bokeh.layouts import column
from bokeh.io import curdoc

cds_arrow = ColumnDataSource(dict(xS=[0], yS=[1], xE=[1], yE=[1]))
cds_line  = ColumnDataSource(dict(x=[0,1], y=[3,3]))

def slider_callback_data(attr,old,new):
    cds_arrow.data = dict(xS=[0], yS=[1], xE=[new], yE=[1])
    cds_line.data  = dict(x=[0,new], y=[3,3])
    #print(cds_arrow.data) # data is updated but not plotted

def slider_callback_stream(attr,old,new):
    cds_arrow.stream(dict(xS=[0], yS=[1], xE=[new], yE=[1]),rollover=1)
    cds_line.stream(dict(x=[0,new], y=[3,3]),rollover=2)


slider_data = Slider(title="cds.data", value=1.0, start=0.0, end=5.0, step=0.1, width=400)
slider_data.on_change('value',slider_callback_data)

slider_stream = Slider(title="cds.stream", value=1.0, start=0.0, end=5.0, step=0.1, width=400)
slider_stream.on_change('value',slider_callback_stream)

figure_test = figure(title="Example Figure", x_range=(-1,6), y_range=(-0.5,4.5), height=300, width=400, tools="")
figure_test.line(x='x', y='y', source=cds_line)
arrow_glyph = Arrow(end=OpenHead(), x_start='xS', y_start='yS', x_end='xE', y_end='yE',source=cds_arrow)
figure_test.add_layout(arrow_glyph)


curdoc().add_root(column(figure_test, slider_data, slider_stream))

Screenshots or screencasts of the bug in action

arrow_no_update
When moving the upper slider, only the line updates.
Moving the lower slider, both update correctly.

@bryevdv
Copy link
Member

bryevdv commented Nov 20, 2019

Thanks for the clear report @m3bert

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants