posit-dev / py-shinywidgets

Render ipywidgets inside a PyShiny app
MIT License
47 stars 5 forks source link

Widgets have a flash of incorrect sizing #135

Closed cpsievert closed 9 months ago

cpsievert commented 9 months ago
from shiny.express import input, ui

from shinywidgets import render_plotly

ui.input_selectize(
    "var", "Select variable",
    choices=["bill_length_mm", "body_mass_g"]
)

@render_plotly
def hist():
    import plotly.express as px
    from palmerpenguins import load_penguins
    df = load_penguins()
    return px.histogram(df, x=input.var())

https://github.com/posit-dev/py-shinywidgets/assets/1365941/334a3655-18b5-47e6-a360-7028939fd755