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

Bokeh.Plotting.figure.circle in bokehjs can't find x and y in a ColumnDataSource #13878

Closed
mosc9575 opened this issue May 7, 2024 · 1 comment · Fixed by #13891
Closed

Bokeh.Plotting.figure.circle in bokehjs can't find x and y in a ColumnDataSource #13878

mosc9575 opened this issue May 7, 2024 · 1 comment · Fixed by #13891

Comments

@mosc9575
Copy link
Contributor

mosc9575 commented May 7, 2024

The circle renderer of bokehjs doesn't fiend the fields x and y.

The example below

// create a data source to hold data
const source = new Bokeh.ColumnDataSource({
    data: { x: [1,2,3], y: [1,2,3] }
});

// make a plot with some tools
const plot = Bokeh.Plotting.figure({
    title: 'Example of random data',
    tools: "pan,wheel_zoom,box_zoom,reset,save",
    height: 300,
    width: 300
});

// add a line with data from the source
plot.circle({ field: "x" }, { field: "y" }, {
    source: source,
});

// show the plot, appending it to the end of the current section
Bokeh.Plotting.show(plot);

produces warnings in the browser console.

"[bokeh 3.4.1]" "attempted to retrieve property array for nonexistent field 'x'"
"[bokeh 3.4.1]" "attempted to retrieve property array for nonexistent field 'y'"

Replacing plot.circle with plot.scatter generates a valid figure.

@mattpap
Copy link
Contributor

mattpap commented May 7, 2024

This happens as a side effect of PR #13283. The API changed and now we have either Figure.circle(x, y, radius, options) or Figure.circle({x, y, radius, ...options}). The third argument was interpreted as radius and effectively no source was provided, which resulted in a cascade of errors.

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

Successfully merging a pull request may close this issue.

2 participants