widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

Solara doesn't render in Databricks notebook #129

Open Ljupch0 opened 1 year ago

Ljupch0 commented 1 year ago

Discussed in https://github.com/widgetti/solara/discussions/128

Originally posted by **Ljupch0** May 30, 2023 Hi Maarten, Thank you for your work! In my use case I envisioned Solara as a extra nice UI option in shared Databricks Notebooks running on clusters. A way to give less technical users an interface without deploying separate apps, by using the Notebook environment for both authentication and compute. However it seems that it cannot render: ![image](https://github.com/widgetti/solara/assets/46574875/a87988d3-d2e0-49f3-bddf-438fbbed94e8) Is there anything in the limitations section of this page that applies to Solara? https://learn.microsoft.com/en-us/azure/databricks/notebooks/ipywidgets Unfortunately I cannot provide a reproducible example :(
maartenbreddels commented 1 year ago

To summarize #128, the workaround for now is to do Page.widget()

Ljupch0 commented 1 year ago

Thank you for all the help. I will keep the thread in this issue.

With Page.widget() it loads, but sidebars and headers are not displayed, only the main area content. I tried several examples with the same result. This one is from https://github.com/widgetti/solara/blob/master/solara/website/pages/apps/layout-demo.py image

maartenbreddels commented 1 year ago

Ah yes, you are losing some jupyter/solara magic because of this workaround. Try this:


@solara.component
def Workaround():
    with solara.components.applayout._AppLayoutEmbed():
        Page()
Workaround.widget()
Ljupch0 commented 1 year ago

Workaround works!! image