From the course: Interactive Dashboards with Plotly and Dash

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Callback functions

Callback functions

- [Instructor] So up to this point we've created an application that has an interactive element, but regardless of what color we select in that dropdown menu, red, green, or blue, nothing really changes in our application, nothing exciting happens. The only thing that changes is the text of the element users select. But users and probably you as students, are expecting a little bit more from a web application. And the magic behind these dash applications in most web apps is what's called a callback function. Callback functions are what process user inputs and update the app accordingly. They're triggered by a change to a property of an interactive HTML component. So if I change the value selected in my dropdown, that's going to be what triggers my callback function. We then process those inputs and change the property of another HCML component or our output. So ideally we have an app that takes, you know, a value from our dropdown menu and returns some sort of meaningful output. We're…

Contents