☰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

RangeTool with Widget Update

Community Support
bscully27
bscully27

I would like to add a DataTable to the RangeTool example:

When a user moves the plot range, the subset of data should update a datatable.

Something like:

def update_stats():

start = range_rool._property_values[‘x_range’].start

end = range_rool._property_values[‘x_range’].end

slice = pd.Series().ix[start:end] # this would reference the initial data

src.data = { ‘mean’: new.mean()}

I dont see any examples on this and trying the following has not worked:

range_rool.on_change(‘x_range’, lambda attr, old, new: update_stats)

range_rool.on_event(ButtonClick, update_stats ) ## need to add input param to update fcn.

Any help would be great.

⌁   Link to post
ivan.rodriguez5
ivan.rodriguez5

Don’t know if you had an answer. But this helped me

···

Am Montag, 25. Juni 2018 12:24:49 UTC-5 schrieb Ben Scully:

I would like to add a DataTable to the RangeTool example:

https://bokeh.pydata.org/en/latest/docs/gallery/range_tool.html

When a user moves the plot range, the subset of data should update a datatable.

Something like:

def update_stats():

start = range_rool._property_values[‘x_range’].start

end = range_rool._property_values[‘x_range’].end

slice = pd.Series().ix[start:end] # this would reference the initial data

src.data = { ‘mean’: new.mean()}

I dont see any examples on this and trying the following has not worked:

range_rool.on_change(‘x_range’, lambda attr, old, new: update_stats)

range_rool.on_event(ButtonClick, update_stats ) ## need to add input param to update fcn.

Any help would be great.

⌁   Link to post

End of archived discussion · Replies are disabled