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.
