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

Fix imports of @bokeh/bokehjs #23

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Fix imports of @bokeh/bokehjs #23

merged 1 commit into from
Feb 6, 2025

Conversation

ianthomas23
Copy link
Member

Fix the imports of @bokeh/bokehjs so we don't need any path workarounds in tsconfig.json or webpack.config.ts. The form used here is:

import * as Bokeh from "@bokeh/bokehjs";

const source = new Bokeh.ColumnDataSource(...);
const plot = Bokeh.Plotting.figure(...);
const button = new Bokeh.Widgets.Button(...);
Bokeh.Plotting.show(...);

An alternative more explicit approach is:

import { ColumnDataSource, Plotting, Widgets } from "@bokeh/bokehjs";`

const source = newColumnDataSource(...);
const plot = Plotting.figure(...);
const button = new Widgets.Button(...);
Plotting.show(...);

I prefer the latter but the former is consistent with the approach used in the existing Bokeh docs at https://docs.bokeh.org/en/latest/docs/user_guide/advanced/bokehjs.html, so we will use that.

@ianthomas23 ianthomas23 added the enhancement New feature or request label Feb 6, 2025
@ianthomas23 ianthomas23 merged commit 0de0a82 into main Feb 6, 2025
2 checks passed
@ianthomas23 ianthomas23 deleted the bokehjs-imports branch February 6, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant