Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Displaying a warning message during an expensive operation

$
0
0

@bebuck wrote:

I have an expensive operation in my script and would like to warn the user that it is time to wait while my callback processes. What’s the best way to do this? I’ve tried:

@app.callback(
dash.dependencies.Output(‘grossreality’, ‘children’),
[dash.dependencies.Input(‘idwafer’, ‘value’)],
[dash.dependencies.State(‘memory’, ‘data’)]
)
def checkrealitystate(value, storedata):
if storedata is None:
storedata = {‘loading’: False}
if storedata[‘loading’]:
return ‘Please wait, loading…’
else:
return ‘Now showing:’ + str(value)

… other callback with the operation …
storedata[‘loading’] = True
checkrealitystate(wfrval, storedata)
-expensive operation-
storedata[‘loading’] = False
checkrealitystate(wfrval, storedata)

but right now at least, that isn’t working. Is there something else I have to do, maybe push the new values to the store or something? Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles