-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat: Bokeh support as FigureBokeh #997
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solara/website/pages/documentation/examples/visualization/bokeh.py
Outdated
Show resolved
Hide resolved
solara/website/pages/documentation/examples/visualization/bokeh.py
Outdated
Show resolved
Hide resolved
solara/lab/components/figurebokeh.py
Outdated
light_theme: str | Theme = "light_minimal", | ||
dark_theme: str | Theme = "dark_minimal", | ||
): | ||
# NOTE: no docstring because not a component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not a component? Because if we use this function conditionally, we'll have conditional hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same reason FigurePlotly
isn't a component. If you want to attach an effect callback to the figure widget, you won't be able to access it with sl.get_widget
outside of the function itself.
It occurs to me that FigurePlotly
is a component, hang on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to have it working now as a component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into issues relating to #927 on occassion, couldn't track down what caused it
Co-authored-by: Maarten Breddels <maartenbreddels@gmail.com>
Co-authored-by: Maarten Breddels <maartenbreddels@gmail.com>
- figurebokeh is now a component
- now a page in lab
for more information, see https://pre-commit.ci
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.