I have an app where selecting points on the plot triggers a callback on the server side. I wrote the app when source.selected took a list of indices. However, I just updated to Bokeh 0.9 (loving the JS callbacks, by the way) and now get this when I select points:
Traceback (most recent call last):
File “//anaconda/lib/python2.7/site-packages/flask/app.py”, line 1817, in wsgi_app
response = self.full_dispatch_request()
File “//anaconda/lib/python2.7/site-packages/flask/app.py”, line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File “//anaconda/lib/python2.7/site-packages/flask/app.py”, line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File “//anaconda/lib/python2.7/site-packages/flask/app.py”, line 1475, in full_dispatch_request
rv = self.dispatch_request()
File “//anaconda/lib/python2.7/site-packages/flask/app.py”, line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File “//anaconda/lib/python2.7/site-packages/bokeh/server/views/backbone.py”, line 224, in _handle_specific_model_patch
return _handle_specific_model(docid, typename, id, request.method)
File “//anaconda/lib/python2.7/site-packages/bokeh/server/crossdomain.py”, line 34, in wrapped_function
resp = make_response(f(*args, **kwargs))
File “//anaconda/lib/python2.7/site-packages/bokeh/server/views/backbone.py”, line 171, in _handle_specific_model
return update(docid, typename, id)
File “//anaconda/lib/python2.7/site-packages/bokeh/server/views/bbauth.py”, line 21, in wrapper
return func(*args, **kwargs)
File “//anaconda/lib/python2.7/site-packages/bokeh/server/views/backbone.py”, line 279, in update
clientdoc.load(modeldata, events=‘existing’, dirty=True)
File “//anaconda/lib/python2.7/site-packages/bokeh/document.py”, line 179, in load
model.load_json(obj_attrs, instance=model)
File “//anaconda/lib/python2.7/site-packages/bokeh/plot_object.py”, line 177, in load_json
instance.update(**attrs)
File “//anaconda/lib/python2.7/site-packages/bokeh/plot_object.py”, line 290, in update
setattr(self, k, v)
File “//anaconda/lib/python2.7/site-packages/bokeh/properties.py”, line 318, in setattr
super(HasProps, self).setattr(name, value)
File “//anaconda/lib/python2.7/site-packages/bokeh/properties.py”, line 167, in set
raise e
ValueError: expected an element of Dict(String, Dict(String, Any)), got [134, 280]
``
I noticed that source.select now takes a dict with key ‘0d’, which accesses another dictionary with keys ‘indices’ and ‘flag’, and keys ‘1d’ and ‘2d’, which each access a dictionary with key 'indices. Questions:
-
Any suggestions for fixing the error I’m getting? (I tried to reproduce the error using the server versions of selection_histogram.py, linked_brushing.py, and color_scatter.py, but I couldn’t get any of them to run since upgrading. Selection works fine on file version of linked_brushing.py).
-
Is there any documentation for the new structure of the ‘selected’ property of ColumnDataSource?