Identify when dashboard is fully loaded and rendered

Hi,

Is there a way to tell when a dashboard has been fully loaded/initialised/rendered including the processing of the initial callbacks?

Thanks

You can use the is_loading property of your overall div:

app.layout = html.Div(id='overall-div',children=[
    # your actual layout
])

@app.callback(
  Output(...),
  [Input(...)],
  [State('overall','is_loading')])
def done_loading(..., done):
    if done:
        # do stuff
    else:
        return no_update

EDIT - Actually, the above doesn’t work - instead you need to use the loading_state property and get loading_state['is_loading']. Theoretically.

2 Likes

I tried this out on my app, and it doesn’t seem like the loading_state['is_loading'] bubbles up. I’d like to be able to check the top div and know if any of the elements down the tree are loading. Is there any way to do this?

Loading States | Dash for Python Documentation | Plotly This article hasn’t made it clearer for me. In the app.callback definition, can you define:

@app.callback(Output(...)
[Input(...)],
[State('overall','loading_state')])
def done_loading(..., done):
    if done:
        #do stuff
    else:
        return no_update