J-M
J-M
SSolara
Created by J-M on 5/8/2024 in #questions-issues
Reusing ipywidget composite UI in solara
I am trying to reuse some ipywidget UI components with minimal rewrite in a new solara dashboard. I noticed that using a display function, and I am not sure where it is from since there is no explicit import. A prior question uses this in https://discord.com/channels/1106593685241614489/1232310547794628649. I used it to reuse displaying an ipyleaflet Map, with success, working by inference from another example https://huggingface.co/spaces/FranciscoGS/solara-geospatialDashboard/blob/main/pages/Servicios_apoyo.py#L106 . I am now trying to apply the same recipe to display a list of ipywidget Datetime pickers and FloatSliders:
def build_param_ui(station_id):
import ipywidgets as ipw
# some code
ui = InteractiveSimulationUi(sim)
_simui = ui
ctrls = ipw.VBox(ui.all_ctrls)
display(ctrls)
def build_param_ui(station_id):
import ipywidgets as ipw
# some code
ui = InteractiveSimulationUi(sim)
_simui = ui
ctrls = ipw.VBox(ui.all_ctrls)
display(ctrls)
and the function is wrapped in a solara component
@solara.component
def ParamSelector():
station_id = selected_station_id.value
build_param_ui(station_id)
@solara.component
def ParamSelector():
station_id = selected_station_id.value
build_param_ui(station_id)
However this fails with the following stacktrace
6 replies