Fireship · @fireship
Realtime Graphs and Charts with Plotly and Firebase
Uploaded August 11, 2017 · Length 5:56
Summary
Combine Plotly and Firebase to create real-time charts and graphs, including 2D line charts, 3D topographical charts, and interactive Turner charts.
- plotly and firebase
- realtime charts
- data visualization
- angular and firebase
- javascript library
- charting library
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
in the age of big data and deep learning
- 0:02
data visualization is an extremely
- 0:04
important tool for many applications in
- 0:06
this episode we're going to combine the
- 0:08
plotly JS Library along with angular and
- 0:11
Firebase to create three different types
- 0:13
of charts that are capable of handling
- 0:15
real-time data we'll start by building a
- 0:17
basic 2D line chart and then we'll build
- 0:20
up to a 3D topographical chart then
- 0:22
we'll finish up with a tary chart that's
- 0:25
capable of staying in sync with the
- 0:26
real-time back end on Firebase the first
- 0:29
step is to to install the plotly JS
- 0:31
Library which we can do with npm install
- 0:33
plotly.js flag saave then add it to the
- 0:37
script section in the
- 0:39
angular-cli Json file it's worth noting
- 0:42
that plot Le is a pretty big Library so
- 0:44
if you want to slim it down a little bit
- 0:46
go to your node modules and find just
- 0:48
the script that you need for your app in
- 0:50
this case we're using the entire Library
- 0:52
which is probably overkill for most
- 0:54
situations then in your typing. D file
- 0:57
add the plotly class so it's recognized
- 0:59
by typescript
- 1:00
now we can start building our first line
- 1:02
chart this chart will just be completely
- 1:04
static just to show you the general
- 1:06
concepts behind plotly in the HTML
- 1:09
create an empty div and then give it a
- 1:10
template reference variable named chart
- 1:13
then in the component typescript we'll
- 1:14
use viewchild as well as element ref
- 1:17
then we're going to build this chart
- 1:18
service in The Next Step once we start
- 1:20
using live data from Firebase so you can
- 1:22
ignore that for now and we'll also use
- 1:25
the low Dash Library so to get a hold of
- 1:28
the div in the HTML we use viewchild and
- 1:30
then reference that chart variable that
- 1:32
we Nam there then we'll name it l in the
- 1:35
typescript which is more or less an
- 1:36
angular convention then to actually
- 1:39
build a plotly chart there are three
- 1:41
basic variables that you need to be
- 1:42
aware of first we have element which is
- 1:45
the HTML element that will be replaced
- 1:48
by the chart and then we have data
- 1:50
that's the actual data that's going to
- 1:51
be displayed in the chart here we have a
- 1:53
few numbers on the X and Y axis that
- 1:55
will create a basic line chart with a
- 1:57
curve the third variable is style which
- 1:59
defines the style options that vary from


