How to reference selected bokeh data points

萝らか妹 提交于 2019-12-01 04:44:25

问题


I have created a bokeh figure which uses circle glyphs and which has a lasso_select tool. This is run from within a ipython notebook.

When I view the figure (which is representing a scatter chart), I select the circles which appear as outliers.

If there a way to reference the selected data from the notebook ? I suspect that source.selected (where source is the ColumnDataSource used to build the chart) would contain the data I want, however this always is set to:

{'0d': {'flag': False, 'indices': []},
 '1d': {'indices': []},
 '2d': {'indices': []}}

Perhaps this is not possible ? Or perhaps I need to use a bokeh-server ? Or perhaps I should just try to concentrate on a way to dump out the selected data from the javascript ?

The reason I want to do this is that I want to get the index for those outliers and use this index to investigate other sources of data.

Any suggestions or pointers to documentation welcome !


回答1:


Look at Callbacks This shows an example using the lasso tool.



来源:https://stackoverflow.com/questions/32909068/how-to-reference-selected-bokeh-data-points

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!