I was working on a problem, where I need to display additional text with loading indicator if the computation heavy. Have tried several methods but none of them worked. Please help me accomplish this.
Sample code:
import panel as pn
pn.extension(loading_spinner="dots")
def trig(_):
"""
Function to get triggered upon button click to update the data
"""
pn.panel(trig, loading_indicator = True)
Sample text:
pn.widgets.StaticText(value="Expensive computation in progress")
How do I tightly couple the text to this loading indicator?
Thank you so much for the reply and the feature request @Marc.
My query was slightly different.
The loading indicator should come with a text. The text should appear together with the loading indicator(during load), on the click of button, and should disappear when the loading indicator disappears.
Something like below:
I’ll tinker with the code given in your answer and see if anything works!
Thanks a lot