Skip to content
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

Shiny express, placing UI elements above the sidebar context manager causes error. #841

Closed
gshotwell opened this issue Dec 4, 2023 · 0 comments · Fixed by #893
Closed
Labels

Comments

@gshotwell
Copy link
Contributor

gshotwell commented Dec 4, 2023

It appears that when you place a UI element above the sidebar layout context manager it causes the app to error.

import matplotlib.pyplot as plt
import numpy as np
from shiny import ui, render
from shiny.express import input, layout

np.random.seed(0)
data = np.random.randn(10000)

ui.h1("test") # causes the app to fail

with layout.sidebar():
    ui.input_slider("num_bins", "Number of Bins", min=1, max=50, value=30)

@render.plot
def plot():
    plt.hist(data, bins=input.num_bins())
    raise ValueError(
ValueError: `layout_sidebar()` is not being supplied with a `sidebar()` object. Please supply a `sidebar()` object to `layout_sidebar(sidebar)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant