Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving bokeh unselected glyph styling #1139

Closed
denglert opened this issue Feb 15, 2017 · 2 comments
Closed

Improving bokeh unselected glyph styling #1139

denglert opened this issue Feb 15, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@denglert
Copy link

denglert commented Feb 15, 2017

According to
http://holoviews.org/Tutorials/Bokeh_Backend.html
-> Selection tools
one should be able to specify the unselected_color which determines the color of unselected colors when using e.g. tools=[lasso_select].

However, this

%opts Points [tools=['lasso_select']] (s=5 color='tomato' unselected_color='white' alpha=0.05)  Layout [shared_axes=True shared_datasource=True]
a  = all_ds.to(hv.Points, kdims=['mA', 'gt'], vdims=[], mdims=[])
b = a.map(lambda x: x.clone(kdims=['PS', 'rs'], vdims=[]), [hv.Points]) 
c = a.map(lambda x: x.clone(kdims=['xsec_zh_r1_only', 'xsec_zh_r2_only'], vdims=[]), [hv.Points])
d = a.map(lambda x: x.clone(kdims=['xsec_zh_all', 'xsec_zh_z_only'], vdims=[]), [hv.Points])

gives me the following error:
AttributeError [Call holoviews.ipython.show_traceback() for details] unexpected attribute 'alpha' to Circle, similar attributes are line_alpha or fill_alpha

hv.ipython.show_traceback()
Traceback (most recent call last):
File "/home/de3u14/lib/anaconda/envs/hv-dev/lib/python3.6/site-packages/holoviews/plotting/bokeh/element.py", line 638, in initialize_plot renderer, glyph = self._init_glyph(plot, mapping, properties)
File "/home/de3u14/lib/anaconda/envs/hv-dev/lib/python3.6/site-packages/holoviews/plotting/bokeh/chart.py", line 127, in _init_glyph unselected = Circle(**dict(properties, fill_color=unselect_color, **mapping))
File "/home/de3u14/lib/anaconda/envs/hv-dev/lib/python3.6/site-packages/bokeh/model.py", line 145, in __init__ super(Model, self).__init__(**kwargs) File "/home/de3u14/lib/anaconda/envs/hv-dev/lib/python3.6/site-packages/bokeh/core/has_props.py", line 222, in __init__ setattr(self, name, value)
File "/home/de3u14/lib/anaconda/envs/hv-dev/lib/python3.6/site-packages/bokeh/core/has_props.py", line 258, in __setattr__ (name, self.__class__.__name__, text, nice_join(matches))) AttributeError: unexpected attribute 'alpha' to Circle, similar attributes are line_alpha or fill_alpha

If using fill_alpha instead of alpha I get circles with black edges, and seem to loose the ability to select points (i.e. I don't see any visual feedback)

On a related note it would be nice to also specify unselected_alpha to improve the unselected glyph styling.

(edit)
Example notebook:
https://www.dropbox.com/s/x7mokfpqf5lpuen/mwtc_xsec_scan_holoviews-1.6.2-unselected.ipynb?dl=0

Cheers,
David

@philippjfr philippjfr modified the milestone: v1.7.0 Mar 15, 2017
@philippjfr philippjfr self-assigned this Mar 16, 2017
@philippjfr philippjfr mentioned this issue Mar 21, 2017
2 tasks
@philippjfr
Copy link
Member

I've now provided full control over the regular, unselection and unselection glyphs. They are now all available as style options. Note however that unselected_color is now unselection_color.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants