首页 > 解决方案 > 长时间运行时在浏览器上显示旋转的轮子/圆圈图像

问题描述

在布局表单button上单击 a时,选项卡(无论如何)显示“正在更新”。我想给出更明显的反馈,说明操作正在运行。dashbrowserChrome

在破折号回调中长时间运行计算期间显示旋转轮图像的规范方法是什么?

# This is a long running operation
@app.callback(
    dash.dependencies.Output('datatable-optionchain','children'),
    [dash.dependencies.Input('button', 'n_clicks')],
    #[dash.dependencies.State('input-box', 'value')],
    [dash.dependencies.State('dropdown1', 'value'),
    dash.dependencies.State('my-date-picker-single', 'date'),
    dash.dependencies.State('dropdown2', 'value')],
    )
def update_output(n_clicks, svalue, dtvalue, tvalue):
    #How do I put a spinning wheel here to advise user we are working on it?

标签: plotly-dash

解决方案


这有很大帮助。我无法让纺车工作,但我确实让.css版本工作。尽管有一些不一致的地方:

https://community.plot.ly/t/dash-loading-states/5687/36


推荐阅读