We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Here's a minimal example:
import time import matplotlib.pyplot as plt import numpy as np import seaborn as sns from shiny import App, Inputs, Outputs, Session, reactive, render, ui app_ui = ui.page_fluid( ui.input_slider( "n", "input_slider()", min=10, max=100, value=50, step=5, animate=True ), ui.input_task_button("do_plot", "Do plot"), ui.output_plot("p"), ) def server(input: Inputs, output: Outputs, session: Session): def do_plot(): time.sleep(0.5) # Without ax, seaborn works through side effects, so supply the ax to avoid # one figure from affecting another. fig, ax = plt.subplots(1, 1) sns.lineplot(x=np.arange(100), y=np.random.randn(100), ax=ax) return fig @ui.bind_task_button(button_id="do_plot") @reactive.extended_task async def plot_task(): return do_plot() @reactive.effect @reactive.event(do_plot) def _(): plot_task() @render.plot def p(): return plot_task.result() app = App(app_ui, server)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's a minimal example:
zoom-on-resize.mp4
The text was updated successfully, but these errors were encountered: