Gostaria de usar um dos spinners integrados, dcc.Loading
mas adicionar algum texto abaixo do spinner/carregador enquanto ele estiver ativo.
import time
import plotly.express as px
import dash_mantine_components as dmc
import dash
from dash import dcc, callback, Output, Input
dash.register_page(module=__name__)
layout = dmc.MantineProvider(
children=[
dmc.Select(
id="dropdown",
data=["bar", "scatter", "none"],
value="bar",
),
dcc.Loading(
type="graph",
children=dmc.Box(id="my_figure")
)
]
)
@callback(
Output("my_figure", "children"),
Input("dropdown", "value")
)
def show_fig(value):
if value == "bar":
time.sleep(5)
return dcc.Graph(figure=px.bar())
elif value == "scatter":
time.sleep(5)
return dcc.Graph(figure=px.scatter())
else:
return []
Este código mostrará apenas o spinner "gráfico" sem nenhum texto. Posso adicionar texto ao spinner integrado sem usar o custom_spinner
argumento? Ou preciso recriar o spinner integrado, adicionar texto a ele e depois passá-lo para custom_spinner
?