Skip to content

multi_line does not work with categorical plots #7462

Closed
@sashabaranov

Description

@sashabaranov

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions