✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Loop through callback outputs on a single button click


I have a simple callback that triggers on a button click and outputs a random string (drawn from a static list of strings) to the children property of a div. The string represents the name of a person who won a prize. I want to change this so that when the button is clicked, the div gets updated, say, 100 times - rapidly at first, then gradually slowing down until it stops and changes color on the winner. Sort of how spinning a prize wheel would look, except only displaying the current winner based on where the arrow is pointing.

I’m not sure how to achieve this since a callback function is exited after returning the first value. I looked into dcc.Interval but wasn’t sure how to 1) link it to a button click, and 2) increase the interval milliseconds on each update.

Thanks and sorry for my obvious noobery to the forum and to Dash.