Dropdowns and buttons are helpful navigation tools. Find out how to add interactivity with Plotly.
- [Instructor] So far, interactive in this course … has meant that you can explore … and manipulate the output of a Plotly visual, … but it turns out there's even more … to how dynamic and interactive charts can be in Plotly. … In this lesson, … we'll look at how you can use buttons … and sliders alongside your visuals, … and even animate a visual. … After importing Plotly express as px, … we'll import the entire gapminder dataset. … Next, we'll construct a figure using scatter 3D. … This time, however, we'll set animation frame equal to year … and animation group equal to country. … By doing this, we will animate countries … in our visual across years in our dataset. … The result is a 3D scatterplot like we've seen before. … However now, there's a slider for year on the bottom. … Notice the movement as I scroll along. … But this isn't all. … Notice the play and stop buttons to the left of the slider. … By pressing play, we see an animation by country over time. … One added level of control you can create for your end users …
This course was created by Madecraft. We are pleased to host this training in our library.