plot - 无法使用散景 BoxSelectTool 访问选择
问题描述
我可以将 BoxSelectTool 添加到我的绘图中。
plot.add_tools(BoxSelectTool(dimensions="both"))
该工具出现,我做了一个矩形选择。但是记录的方法对所选点没有显示任何内容。
source.selected.indices
[] 返回。怎么了。如何获取选定的索引?
在关注帖子之后,我可以让嵌入式服务器正常工作,并且 source.selected.indices 确实返回了积分,但 call_back 仍然不起作用
def callback(attr, old, new):
print('select changed')
# The index of the selected glyph is : new['1d']['indices'][0]
patch_name = source.data['name'][new['1d']['indices'][0]]
print("TapTool callback executed on Patch {}".format(patch_name))
source.on_change('selected',callback)
请问有什么想法吗?
解决方案
推荐阅读
- sql - SQL隐式连接返回全连接还是笛卡尔连接?
- excel - 仅在列表中保留最新版本的文档
- google-apps-script - 通过使用队列管理传入的表单数据来管理并发问题?
- imagemagick - 在 WHM 专用服务器上将 WebP 添加到 ImageMagick 支持的 PHP 7.3 格式
- javascript - React Hooks - 无法获取更新的状态值
- python - 使用自定义函数将熊猫数据框中的多列解析/拆分为多列
- amazon-product-api - 如何通过API获取亚马逊产品信息
- sql - 如何在存储过程中创建循环以读取 TIBCO 表中的所有 id?
- java - iText 7中的PdfConcatenate(智能)
- c# - 如何将 application/x-www-form-urlencoded 转换为 JSON?