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

multi_line does not work with categorical plots #7462

Closed
sashabaranov opened this Issue Jan 25, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sashabaranov

sashabaranov commented Jan 25, 2018

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Testing with Python 2.7.14 and bokeh==0.12.13.

Description of expected behavior and the observed behavior

multi_line stopped working with categorical plots.

Complete, minimal, self-contained example code that reproduces the issue

    x_range = ['a', 'b', 'c', 'd']
    y_values = [1., 2., 3., 4.]
    y_errors = [.1, .2, .3, .4]


    plot = figure(x_range=x_range)
    plot.square(x_range, y_values, size=7, line_alpha=0)

    err_xs = []
    err_ys = []

    for x, y, yerr in zip(x_range, y_values, y_errors):
        err_xs.append((x, x))
        err_ys.append((y - yerr, y + yerr))

    # Option A: Does not work
    # plot.multi_line(err_xs, err_ys)

    # Option B: works!
    for i in xrange(len(err_xs)):
        plot.line(err_xs[i], err_ys[i])

Full example in the example repo: https://github.com/sashabaranov/bokeh-leak-example/tree/0.12.13-categorical-multiline

Stack traceback and/or browser JavaScript console output

[Error] TypeError: undefined is not an object (evaluating 'this._mapping[t[0]].mapping[t[1]]')
	_lookup (bokeh-0.12.13.min.js:1:364819)
	synthetic (bokeh-0.12.13.min.js:1:363563)
	(anonymous function) (bokeh-0.12.13.min.js:1:363701)
	v_synthetic (bokeh-0.12.13.min.js:1:363720)
	set_data (bokeh-0.12.13.min.js:1:235081)
	set_data (bokeh-0.12.13.min.js:1:370298)
	initialize (bokeh-0.12.13.min.js:1:368764)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:379500)
	e (bokeh-0.12.13.min.js:1:367663)
	build_views (bokeh-0.12.13.min.js:1:14204)
	build_levels (bokeh-0.12.13.min.js:1:345564)
	initialize (bokeh-0.12.13.min.js:1:338801)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:337113)
	build_views (bokeh-0.12.13.min.js:1:14204)
	build_child_views (bokeh-0.12.13.min.js:1:300626)
	initialize (bokeh-0.12.13.min.js:1:297635)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:297426)
	e (bokeh-0.12.13.min.js:1:329848)
	i (bokeh-0.12.13.min.js:1:110551)
	add_model_standalone (bokeh-0.12.13.min.js:1:111137)
	r (bokeh-0.12.13.min.js:1:114436)
	(anonymous function) (bokeh-0.12.13.min.js:1:113719)

@bryevdv bryevdv added this to the 0.12.x milestone Jan 29, 2018

@bryevdv bryevdv modified the milestones: 0.12.x, 0.12.15, 0.12.16 Mar 17, 2018

@bryevdv

This comment has been minimized.

Member

bryevdv commented Mar 29, 2018

From the other issue:

The issues seems to be that set_data in the patches view is calling v_synthetic on the entire array of arrays, but I'm pretty sure it needs to loop over the outer array and call v_synthetic on the subarrays instead.

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