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

Different sizes not used for selection & nonselection glyphs #2367

Closed
birdsarah opened this issue Jun 5, 2015 · 5 comments · Fixed by #13554
Closed

Different sizes not used for selection & nonselection glyphs #2367

birdsarah opened this issue Jun 5, 2015 · 5 comments · Fixed by #13554
Labels
grant: SDG 2023 Funded from NumFOCUS Small Development Grant 2023 reso: completed type: feature
Milestone

Comments

@birdsarah
Copy link
Member

See the example here:

http://nbviewer.ipython.org/github/birdsarah/bokeh-miscellany/blob/master/notebooks/Different%20size%20for%20selected%20%26%20not%20selected%20demo.ipynb

Simplified for clarity:

    nonselection = Circle(x='x', y='y', fill_color='gray', size=5)
    selection = Circle(x='x', y='y', fill_color='red', size=25)
    plot.add_glyph(source, nonselection, selection_glyph=selection, nonselection_glyph=nonselection)

The size that is used is whatever is passed as the second argument to add_glyph.

@damianavila damianavila added this to the short-term milestone Jun 9, 2015
@birdsarah birdsarah self-assigned this Aug 5, 2015
@birdsarah birdsarah removed their assignment Nov 12, 2015
@bryevdv
Copy link
Member

bryevdv commented Apr 2, 2016

Current behavior is as designed and documented, i.e. only "visual" (line and fill) props are considered for selection/nonselection/hover policies. Changing to feature to reflect that it would be new feature development.

@bryevdv
Copy link
Member

bryevdv commented Apr 2, 2016

An alternative short-term help would be to issue a validation warning

@mattpap
Copy link
Contributor

mattpap commented May 13, 2016

This is a recurring problem when creating more complex visualizations. Recently I was bit by this in PR #4312, where I wanted to make pie chart's selected slice to stand out, but I can't change selection annular wedge's x, y coordinates, because those are bound to the main glyph.

My proposal is to change definition of GlyphRenderer class to:

class GlyphRenderer(DataRenderer):
    glyph = Instance(Glyph)
    selection_glyph = Instance(Either(Glyph, Visuals))
    nonselection_glyph = Instance(Either(Glyph, Visuals))
    hover_glyph = Instance(Either(Glyph, Visuals))

where Visuals is a base class that would be implemented by <GlyphName>Visuals. Using Visuals instead of a Glyph would retain the current, data sharing, behavior. However, using a Glyph would mean GlyphRenderer would perform all data mapping independently of glyph. I think glyphs could implement Visuals to reduce code duplication.

@bryevdv
Copy link
Member

bryevdv commented Sep 13, 2018

As noted in #6980 the general ask is to be able to have another marker or glyph type.

@bryevdv
Copy link
Member

bryevdv commented Aug 25, 2020

noting that this would fall out of #10403 as I envision it at least

@mattpap mattpap modified the milestones: short-term, 2.4 Jan 18, 2021
@bryevdv bryevdv modified the milestones: 2.4, next Aug 11, 2021
Northo added a commit to Northo/bokeh that referenced this issue Dec 16, 2022
Ref. bokeh#2367.

That the glyphs for `nonselection_glyph` and `hover_glyph` is not affected by size, etc. bit me in the back, and apparently has confused many others as well, judging from the issue tracker. I think this behaviour is very unexpected, and deserves a warning level note.

Also, I think it would be great to be more explicit about what *visual* properties are, or link to where to find that. For me, it is for example not obvious that size is not a visual property. I would love to to it myself, but I am not familiar enough with Bokeh to do that.
bryevdv pushed a commit that referenced this issue Jan 1, 2023
Ref. #2367.

That the glyphs for `nonselection_glyph` and `hover_glyph` is not affected by size, etc. bit me in the back, and apparently has confused many others as well, judging from the issue tracker. I think this behaviour is very unexpected, and deserves a warning level note.

Also, I think it would be great to be more explicit about what *visual* properties are, or link to where to find that. For me, it is for example not obvious that size is not a visual property. I would love to to it myself, but I am not familiar enough with Bokeh to do that.
bryevdv pushed a commit that referenced this issue Feb 22, 2023
Ref. #2367.

That the glyphs for `nonselection_glyph` and `hover_glyph` is not affected by size, etc. bit me in the back, and apparently has confused many others as well, judging from the issue tracker. I think this behaviour is very unexpected, and deserves a warning level note.

Also, I think it would be great to be more explicit about what *visual* properties are, or link to where to find that. For me, it is for example not obvious that size is not a visual property. I would love to to it myself, but I am not familiar enough with Bokeh to do that.
@mattpap mattpap modified the milestones: next, 3.x Oct 12, 2023
@mattpap mattpap modified the milestones: 3.x, 3.4 Nov 28, 2023
@mattpap mattpap added the grant: SDG 2023 Funded from NumFOCUS Small Development Grant 2023 label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grant: SDG 2023 Funded from NumFOCUS Small Development Grant 2023 reso: completed type: feature
Projects
None yet
4 participants