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

Plotly plots "jump" on update #161

Open
ramnathv opened this issue Sep 24, 2024 · 1 comment
Open

Plotly plots "jump" on update #161

ramnathv opened this issue Sep 24, 2024 · 1 comment

Comments

@ramnathv
Copy link

ramnathv commented Sep 24, 2024

Description

I created a minimal app using shiny and plotly using shinywidgets. When I use the select input to change the x variable, the plotly plot rerenders, but there is a visible "jump" that is jarring. Is there a way to avoid this? Note that I tried the same app with streamlit and dash and in both cases, there is NO "jump"

What I Did

import plotly.express as px
from shiny.express import input, ui
from shinywidgets import render_plotly

ui.input_selectize('xvar', 'Select X', ['tip', 'total_bill'])

@render_plotly
def plot2():
    return px.histogram(px.data.tips(), x=input.xvar())

Shinylive URL

@ramnathv
Copy link
Author

ramnathv commented Oct 7, 2024

If I set the height parameter explicitly, the "jump" disappears. I presume it happens because of the responsive CSS that is updating the plot dimensions after the initial render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant