feat: Bokeh support as FigureBokeh #997
Draft
+323
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Description of changes
This PR resolves #202, and adds a
solara.lab
component to support Bokehfigure
andPlot
objects. It additionally adds dependencies forbokeh
andjupyter_bokeh
.Part of the code is based on the implementation written in #202 by @maartenbreddels.
It behaves similarly to
FigurePlotly
, except it shows a temporarySpinnerSolara
until the plot is ready while the BokehJS backend loads.Additionally it takes arguments of
light_theme
anddark_theme
to update the theme via a solara-sideeffect
(the document instance must exist for us to update theming via the high-level interface)This PR adds:
and modifies relevant files for importing components in
lab
Known issues/pitfalls
x_axis_type
, etc doesnt work.x_scale
and/ory_scale
of figure via ause_effect
Tool
will fail to link to attributes of anybokeh.model
if it is regenerated with each render.bokeh.model.tools
instance with a callback likeCustomJS(args=dict(object=object))
, such asobject.selected.indices
or similar from aColumnDataSource
upon a selection.use_memo
models with callbacks to exclude from regeneration, then useuse_effect
or similar for attribute updates.When embedded in aGridDraggable
instance, theming is not applied on first render after it is added.Bokeh.document
instance attempts to cleanup widgets that no longer exist.