feat: Bokeh support as FigureBokeh #997
Draft
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:
TODO
Description of changes
This PR resolves #202, and adds a
solara.labcomponent to support BokehfigureandPlotobjects. It additionally adds dependencies forbokehandjupyter_bokeh.Part of the code is based on the implementation written in #202 by @maartenbreddels.
It behaves similarly to
FigurePlotly, except it shows a temporarySpinnerSolarauntil the plot is ready while the BokehJS backend loads.Additionally it takes arguments of
light_themeanddark_themeto 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
labKnown issues/pitfalls
x_axis_type, etc doesnt work.x_scaleand/ory_scaleof figure via ause_effectToolwill fail to link to attributes of anybokeh.modelif it is regenerated with each render.bokeh.model.toolsinstance with a callback likeCustomJS(args=dict(object=object)), such asobject.selected.indicesor similar from aColumnDataSourceupon a selection.use_memomodels with callbacks to exclude from regeneration, then useuse_effector similar for attribute updates.When embedded in aGridDraggableinstance, theming is not applied on first render after it is added.Bokeh.documentinstance attempts to cleanup widgets that no longer exist.