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
Legend entry for text renderer causes error #7337
Comments
@AlbertDude I will have a PR to fix the proximate problem, however, I still (and have never) considered text legends especially useful. With the PR it will look like this: Basically it prints "text" with the matching color, plus the label you specify. I'm not actually sure what a text legend should do though, so if you have ideas please put them in a new feature request issue. |
Thanks Bryan, A better sample use case for the text legend is below. Basically, I want a single legend entry to be attached to line, marker, and text elements so that all these elements can be muted/unmuted together. Hopefully your fix is compatible with this usage. Albert.
|
@AlbertDude It does work, clicking the legend entry hides all the glyphs including the text. However I would say the limited functionality of the I'd propose to merge this small PR as is, then make a follow on issue to support "linking" additional glyphs to be muted/hidden, that doesn't actually get draw in the legend. I think this would be most useful for things like As an aside, you might want to consider |
I suppose another quick option is to simply change |
Not drawing anything in the legend box for text elements would get my vote. Thanks for the suggestion about LabelSet. I played around with it a bit -- it wasn't obvious to me as to how to add it to a legend entry so that it could be muted/unmuted. How would this be done? |
It probably can't be currently, but I was thinking ahead to when there is some mechanism to link secondary glyphs to legend items. |
See: https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/ZGhewELZos0
bokeh 0.12.13
I get the error:
"Uncaught TypeError: Cannot read property 'set_value' of undefined at e.n.TextView.e.draw_legend_for_index (bokeh-0.12.13.min.js:1)"
when I try to add a legend entry for text glyphs:
Uncaught TypeError: Cannot read property 'set_value' of undefined
at e.n.TextView.e.draw_legend_for_index (bokeh-0.12.13.min.js:sourcemap:1)
at e.n.GlyphRendererView.e.draw_legend (bokeh-0.12.13.min.js:sourcemap:1)
at e._draw_legend_items (bokeh-0.12.13.min.js:sourcemap:1)
at e.render (bokeh-0.12.13.min.js:sourcemap:1)
at e._paint_levels (bokeh-0.12.13.min.js:sourcemap:1)
at e.paint (bokeh-0.12.13.min.js:sourcemap:1)
at e._layout (bokeh-0.12.13.min.js:sourcemap:1)
at e.n.LayoutDOMView.e._layout (bokeh-0.12.13.min.js:sourcemap:1)
at e.n.LayoutDOMView.e._do_layout (bokeh-0.12.13.min.js:sourcemap:1)
at e.n.LayoutDOMView.e.layout (bokeh-0.12.13.min.js:sourcemap:1)
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: