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 breaks plot when plotting empty scatter glyph #8395

Closed
philippjfr opened this Issue Nov 3, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@philippjfr
Contributor

philippjfr commented Nov 3, 2018

When plotting an empty scatter glyph, which is often useful when streaming data, the legend breaks because it cannot determine the correct marker to render the legend items. A basic example to reproduce

from bokeh.plotting import figure

p = figure(x_range=(0, 5), y_range=(0, 3))
scatter = p.scatter([], [], legend='Some legend entry')
VM1330:130 Uncaught TypeError: _.marker_funcs[a[u]] is not a function
    at e._render (<anonymous>:130:341219)
    at e.draw_legend_for_index (<anonymous>:130:341597)
    at t.draw_legend (<anonymous>:130:394695)
    at e (<anonymous>:130:159349)
    at t._draw_legend_items (<anonymous>:130:159662)
    at t.render (<anonymous>:130:158255)
    at t._paint_levels (<anonymous>:130:371299)
    at t.paint (<anonymous>:130:370650)
    at t.repaint (<anonymous>:130:369420)
    at t.<anonymous> (<anonymous>:130:366711)

screen shot 2018-11-03 at 12 33 52 pm

This is reproducible using bokeh 1.0.0 and bokeh 1.0.1 and likely originates in this PR #8285 generalizing the scatter glyph.

@philippjfr

This comment has been minimized.

Contributor

philippjfr commented Nov 10, 2018

This bug is basically breaking a bunch of streaming examples we have since they all start with an empty data source. So it would be good to fix this soon. I'll try to work up a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment