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.
Demo: Dropdowns
From the course: Interactive Dashboards with Plotly and Dash
Demo: Dropdowns
- Okay, so let's go ahead and build a simple Dash app, shall we? We can use our Jupyter Dash function just to keep things in our notebook. We're going to open up an HTML div and then within that div, we're going to have a dropdown menu with the ID filter, just two options here. And the default value is going to be California. And note that we can even wrap single values in a list and it will be valid. So we'll just keep it like this because I'm going to change things later. We also have a graph, and so the values selected in our dropdown gets passed into our callback function. And so state is going to be California to start. And so what we're going to do is use the query method to filter our education data frame. If the row in our data frame has a value that is in the list, so right now this is just California, then we'll keep that row in our data frame, otherwise it'll be excluded. We're also filtering down to this range of years before grouping by year, summing, and then just making…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Intro to interactive elements3m 34s
-
(Locked)
Interactive element overview4m 1s
-
(Locked)
Dropdown menus5m 17s
-
(Locked)
Demo: Dropdowns6m 35s
-
(Locked)
Checklists3m 36s
-
(Locked)
Assignment: Checklists2m 27s
-
(Locked)
Solution: Checklists2m 43s
-
(Locked)
Radio buttons4m
-
(Locked)
Sliders6m 8s
-
(Locked)
Range sliders4m 28s
-
(Locked)
Assignment: Sliders1m 56s
-
(Locked)
Solution: Sliders4m 54s
-
(Locked)
Date pickers5m 2s
-
(Locked)
Demo: Date pickers8m 11s
-
(Locked)
Multiple input callbacks6m 32s
-
(Locked)
Multiple output callbacks6m 15s
-
(Locked)
Assignment: Multiple interactive elements2m 30s
-
(Locked)
Solution: Multiple interactive elements4m 9s
-
(Locked)
Key takeaways1m 52s
-
(Locked)
-
-
-
-