Skip to content

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