pikaa
pikaa
SSolara
Created by pikaa on 10/26/2024 in #questions-issues
Context doesn't update when fetching from a namespace
I'm having some trouble getting a context to be provided then read in a child component properly. At the top-most component, the context is defined, but perhaps because of the import order, it doesn't seem to re-update the context later? When the reading function si called, it only reads it as 'foobar' and doesn't change. Here is the schematic:
pages
├── __init__.py -> [CONTEXT PROVIDED HERE WITH USER UUID]
├── components
│ ├── __init__.py
│ ├── auth
│ │ └── __init__.py
│ ├── dialog.py
│ ├── sidebar
│ │ ├── __init__.py
│ │ ├── autocomplete.py
│ │ ├── glossary.py
│ │ ├── subset_filters.py -> [FUNCTION IS CALLED THROUGHOUT COMPONENTS]
│ │ └── vc_ui.py
│ ├── textfield.py
│ └── views
│ ├── __init__.py
│ ├── dataframe.py
│ ├── grid.py
│ ├── plot_settings.py
│ └── plots.py
├── dataclass
│ ├── __init__.py
│ ├── alert.py
│ ├── filterstore.py -> [CONTEXT READ HERE IN FUNCTION]
│ ├── gridstate.py
│ ├── state.py
│ ├── subsets.py
│ └── vcdata.py
└── util
├── __init__.py
├── regex.py
└── util.py -> [CONTEXT OBJECT DEFINED HERE with 'foobar']
pages
├── __init__.py -> [CONTEXT PROVIDED HERE WITH USER UUID]
├── components
│ ├── __init__.py
│ ├── auth
│ │ └── __init__.py
│ ├── dialog.py
│ ├── sidebar
│ │ ├── __init__.py
│ │ ├── autocomplete.py
│ │ ├── glossary.py
│ │ ├── subset_filters.py -> [FUNCTION IS CALLED THROUGHOUT COMPONENTS]
│ │ └── vc_ui.py
│ ├── textfield.py
│ └── views
│ ├── __init__.py
│ ├── dataframe.py
│ ├── grid.py
│ ├── plot_settings.py
│ └── plots.py
├── dataclass
│ ├── __init__.py
│ ├── alert.py
│ ├── filterstore.py -> [CONTEXT READ HERE IN FUNCTION]
│ ├── gridstate.py
│ ├── state.py
│ ├── subsets.py
│ └── vcdata.py
└── util
├── __init__.py
├── regex.py
└── util.py -> [CONTEXT OBJECT DEFINED HERE with 'foobar']
2 replies
SSolara
Created by pikaa on 10/3/2024 in #questions-issues
Right-click context menu onto another widget
I'd like to try and add a Solara right-click context menu onto a Plotly FigureWidget (FigurePlotly instance), but I have no idea how to disable the generic context menu and override with my own. Do you have any suggestions on how to get started with this?
3 replies
SSolara
Created by pikaa on 10/3/2024 in #questions-issues
FastAPI/nginx deployment issues, virtual kernels not served correctly?
currently, my app is deployed in a FastAPI context with a load balancer (nginx). however, it appears to be mismanaging the virtual kernels (i.e. somehow users get into other user's state), or it seems to restore them somehow from a previous virtual kernel as an example, a user cannot open two tabs of the app or refresh the page -- it seems to just break it entirely, and sometimes plots/etc will just appear out of nowhere. could you give me some further insight into deploying the app so i can avoid these issues?
3 replies
SSolara
Created by pikaa on 7/26/2024 in #questions-issues
any upcoming plans/existing ways to create guided tour functionality (solara)?
i'm interested in creating a guided tour for my app. are there any sort of upcoming plans to try and implement something like this, or would there be a way i could leverage something like this as a vue component to implement it? not sure exactly how to include/import the vue library within solara's context and get started with it, so any help/guidance would be appreciated
4 replies
SSolara
Created by pikaa on 3/10/2024 in #questions-issues
Plotly FigureWidget axes do not reset ranges within solara's render context
Upon applying an effect to set autorange=True to a figure with autorange='reversed', the Figure does not return to the original axes orientation. I'm wondering what happens behind the scenes here for the render when the use_effect is triggered. I can upload a ipynb with its expected behaviour within a jupyter context vs its behaviour in solara. The partial code (can give complete if needed). plotstate contains 2 reactives for flipx and flipy.
def imshowfig()
def create_fig():
z, cmin, cmax = perform_binning()
fig = px.imshow(z.T,
zmin=cmin,
zmax=cmax,
origin="lower",
color_continuous_scale="inferno")
return fig

# only instantiate the figure once
figure = sl.use_memo(create_fig, dependencies=[])

def add_effects(fig_element: sl.Element):

def set_xflip():
print("setting xflip", plotstate.flipx.value)
fig_widget: FigureWidget = sl.get_widget(fig_element)
if plotstate.flipx.value:
fig_widget.update_xaxes(autorange="reversed")
else:
fig_widget.update_xaxes(autorange=True)
print(fig_widget.layout.xaxis)

def set_yflip():
print("setting yflip", plotstate.flipy.value)
fig_widget: FigureWidget = sl.get_widget(fig_element)
if plotstate.flipy.value:
fig_widget.update_yaxes(autorange="reversed")
else:
fig_widget.update_yaxes(autorange=True)
print(fig_widget.layout.yaxis)

sl.use_effect(set_xflip, dependencies=[plotstate.flipx.value])
sl.use_effect(set_yflip, dependencies=[plotstate.flipy.value])

fig_el = sl.FigurePlotly(figure)
add_effects(fig_el)
def imshowfig()
def create_fig():
z, cmin, cmax = perform_binning()
fig = px.imshow(z.T,
zmin=cmin,
zmax=cmax,
origin="lower",
color_continuous_scale="inferno")
return fig

# only instantiate the figure once
figure = sl.use_memo(create_fig, dependencies=[])

def add_effects(fig_element: sl.Element):

def set_xflip():
print("setting xflip", plotstate.flipx.value)
fig_widget: FigureWidget = sl.get_widget(fig_element)
if plotstate.flipx.value:
fig_widget.update_xaxes(autorange="reversed")
else:
fig_widget.update_xaxes(autorange=True)
print(fig_widget.layout.xaxis)

def set_yflip():
print("setting yflip", plotstate.flipy.value)
fig_widget: FigureWidget = sl.get_widget(fig_element)
if plotstate.flipy.value:
fig_widget.update_yaxes(autorange="reversed")
else:
fig_widget.update_yaxes(autorange=True)
print(fig_widget.layout.yaxis)

sl.use_effect(set_xflip, dependencies=[plotstate.flipx.value])
sl.use_effect(set_yflip, dependencies=[plotstate.flipy.value])

fig_el = sl.FigurePlotly(figure)
add_effects(fig_el)
6 replies