☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Span - how to update location based on CDS

Community Support
grzegorz.malinowski
grzegorz.malinowski

Ok, so what’s wrong here? Both plots (Arrow, segment) take same CDS. Segment is updated correctly, Arrow, not. For simplicity I don’t show CDS, but as I mentioned, it’s being updated correctly.

def plot_circle():
    name = 'p_circle'
    p = figure(frame_width=300, frame_height=300, match_aspect=True,
               x_range = Range1d(start=-1.1, end=1.1, bounds = (-1.1, 1.1)), y_range = Range1d(start=-1.1, end=1.1, bounds = (-1.1, 1.1)),
               name=name)

    p.segment(x0=0, y0=0, x1='plot_x', y1='plot_y', source=CDS_variables, line_width=3, alpha=0.5)
    p.add_layout(Arrow(end=VeeHead(size=10, line_color=None), line_width=1.5,
                      x_start=0, y_start=0, x_end='plot_x', y_end='plot_y', source=CDS_variables))

    return p
plot_3 = plot_circle()


def xaxis_callback(attrname, old, new):
    x_new = select_xaxis.value
    CDS_variables.data.update({'plot_x': CDS_variables.data[x_new] })

def yaxis_callback(attrname, old, new):
    y_new = select_yaxis.value
    CDS_variables.data.update({'plot_y': CDS_variables.data[y_new] })

select_xaxis.on_change('value', xaxis_callback)
select_yaxis.on_change('value', yaxis_callback)

curdoc().add_root(plot_3)

⌁   Link to post
p-himik
p-himik

Two things:

  1. Your latest code block differs from the very first one in a critical way. The first one hardcodes the data. The latest one does not hardcode any data that’s derived from the data source - it just points to the columns. Meaning, if the data in the columns is updated, everything that’s linked with those columns should be updated automatically.
  2. You’re hitting a known bug: [BUG] Arrow glyph does not update · Issue #9436 · bokeh/bokeh · GitHub
⌁   Link to post

End of archived discussion · Replies are disabled