【问题标题】:bokeh taptool selection colours散景 Taptool 选择颜色
【发布时间】:2019-09-19 19:07:40
【问题描述】:

我在散景中使用TapTool 来选择我在gmap 上绘制的一些圆圈。目前,选定的圆圈位于前景中,其余的则淡入地图背景。

有没有办法改变这种默认行为?例如,我想为选定的圆圈提供不同的颜色边界并保持其余部分相同。有没有办法改变选中和未选中对象的渲染?

【问题讨论】:

    标签: bokeh


    【解决方案1】:

    用户指南的Styling Visual Attributes 章节有专门针对Selected and Unselected Glyphs 的部分。最简单的方法是使用可以传递给字形方法的便利参数:

    plot.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=50,
    
                # set visual properties for selected glyphs
                selection_color="firebrick",
    
                # set visual properties for non-selected glyphs
                nonselection_fill_alpha=0.2,
                nonselection_fill_color="blue",
                nonselection_line_color="firebrick",
                nonselection_line_alpha=1.0)
    

    【讨论】:

    • 感谢投票。如果这回答了您的问题,“接受”也将不胜感激(并且有利于项目接受答案)
    • 是的,你太快了,我不得不等待才接受:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-13
    • 2018-03-04
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    相关资源
    最近更新 更多