[Python] Spinner of Shiny Python does not show up for output_table

Discussão em 'Python' iniciado por Stack, Fevereiro 28, 2025.

  1. Stack

    Stack Membro Participativo

    I’m trying to create a busy indicator while generating a table using ui.busy_indicators. However, the spinner does not appear when using ui.output_table. If I replace ui.output_table with ui.output_plot or ui.output_data_frame, the spinner works as expected. This makes me wonder if ui.busy_indicators is incompatible with ui.output_table.

    import time
    import numpy as np
    import seaborn as sns
    from shiny import App, render, ui
    import pandas as pd

    app_ui = ui.page_fluid(
    ui.output_plot("plot"),
    #ui.output_table("table"),
    ui.busy_indicators.use(),
    )

    def server(input):

    @render.plot
    def plot():
    time.sleep(3)
    sns.lineplot(x=np.arange(100), y=np.random.randn(100))

    @render.table
    def table():
    time.sleep(3)
    df = pd.DataFrame(np.random.randn(10, 10), columns=[f'col_{i}' for i in range(10)])
    return df

    app = App(app_ui, server)

    Continue reading...

Compartilhe esta Página