Hi everyone,
I am in the process of upgrading an application from Bokeh 0.12 (!) to 2.2.3.
I have defined a custom widget, which compiles correctly. On the backend, I generate a Bokeh document and export it in two parts: as JSON (using
bokeh_embed.json_item) and JavaScript (for our custom models, using
bundle_models). On the frontend, I then do the following:
import * as Bokeh from "@bokeh/bokehjs"; const { bokehJSON, modelJS } = plotData; window.Bokeh = Bokeh; const root = { Bokeh: window.Bokeh }; eval(modelJS.replace("this", "root")); Bokeh.embed.embed_item(bokehJSON, `bokeh-${bokehJSON.root_id}`);
(The
bokeh-xyz div is created elsewhere in the code.)
A similar scheme worked under 0.12, but now I see the following error:
Bokeh.register_plugin is not a function
I am curious whether:
- I am trying to do something I am not supposed to (export JSON + JS and render on frontend);
- importing Bokeh the way I am is supported; and
- if so, whether exposing
register_pluginwould be an option?
Thank you for your advice!