Data Science Jumpstart with 10 Projects Transcripts
Chapter: Project 10: Making a Snow Report Dashboard with Dash and Plotly
Lecture: Creating a Dashboard with Dash and Plotly Graphs
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
In this video I'm going to demonstrate making a dashboard using the Dash framework. This is a project that is started by the people who did Plotly.
0:09
You'll notice at the very top I say write file dash demo.
0:12
I'm not really doing this from Jupyter, I'm just writing the code in Jupyter, but I'm actually writing it to a file.
0:18
I've got all of my imports up here, I've got my tweak code, and then at the bottom I'm loading my data, I'm tweaking it.
0:25
And here's the key parts down here. I'm making this app.
0:28
So this is a Dash app, and then I'm making a figure, this is a Plotly figure, and then with my app I'm specifying the layout.
0:36
So I'm saying the layout is going to be an HTML div, and the children in that will be an H1 tag, and then some markdown,
0:45
and then a graph, and you'll notice that in the graph I refer to the figure that I specified up above.
0:51
Then down below I have this little snippet. If I execute this script I want to run the Dash server.
1:00
Let's run that. I'm going to execute that from the terminal. And this is what the output of this looks like. You can see here's an H1 tag at the top.
1:09
We can see that here's some markdown code, and down here is our Plotly plot.
1:13
Again, the nice thing about this Plotly plot, we do have interactivity. We can zoom into that.
1:17
We can reset it if we want to. We can export that as an image as well.
1:23
In this video I showed you how to make a basic Dash dashboard. It's relatively easy. You'll need to create a file, and then you make this Dash app.
1:33
You add your Plotly figures into it, and you can add markdown into it or HTML,
1:38
and then you just kick off the Dashboard server, and you can hit the endpoint and view the dashboard.