🏥 🏭 Working on the COVID-19 response in Canada? Plotly & the Canadian government can help you and your organization. Learn more and get in touch.

Delaying display of dcc.Loading

I have some tasks that have varying execution time, from fraction of a second to like 20s depending on particular input data. Obviously I use dcc.Loading component on output components that have such a property.

However, such tasks often take a small fraction of a second, making dcc.Loading flash and disappear. That looks silly to many users.

So the question is can I have some period of inactivity on dcc.Loading? Like say if a component is being loaded up to 0.5s, it is not being displayed, but if wrapped component or html.Div or anything is still not loaded after 0.5s, the animated loading icon pops up?