Fireship · @fireship
Visualize 140k Gun Violence Incidents with Deck.gl & Google Maps
Uploaded November 5, 2019 · Length 11:15
Summary
Visualizing 140k gun violence incidents with Deck.gl and Google Maps, including heat maps, scatter plots, and 3D visuals.
- deck.gl
- google maps
- gun violence
- data visualization
- heat maps
- scatter plots
- 3d visuals
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:02
today will take over 140,000 data points
- 0:05
of people being killed or injured by
- 0:07
guns and visualize them with deck GL and
- 0:09
Google Maps we can go from a heat map of
- 0:11
the entire country down to the actual
- 0:13
street view of a neighborhood where the
- 0:15
[ __ ] went down we'll start by adding a
- 0:17
scatter plot layer for every single
- 0:18
point in the data set then we'll add a
- 0:20
tool tip to see how many people were
- 0:22
injured or killed at a given incident
- 0:23
and we'll cluster points together into a
- 0:25
heat map based on the map zoom level
- 0:28
lastly we'll cluster points into a
- 0:30
hexagon with a one-mile radius and
- 0:32
extrude them into a 3d shape where the
- 0:34
elevation represents the amount of
- 0:35
violence in that space we can do all of
- 0:37
this data visualization efficiently
- 0:39
thanks to a library called deck GL it
- 0:41
was created by uber to visualize their
- 0:43
own data and is able to run computations
- 0:45
efficiently by offloading them to the
- 0:47
GPU with WebGL take a look at their
- 0:56
showcase for some awesome examples of
- 0:58
companies using this technology in
- 0:59
production I think my favorite is escape
- 1:01
it uses the deck GL arc layer to
- 1:03
visualize the cheapest flights based on
- 1:05
your location around the world now I
- 1:07
realize that guns are a hot political
- 1:08
issue in the United States
- 1:10
so I've tried to make this visual as
- 1:12
neutral as possible the data comes from
- 1:14
the gun violence archive from the years
- 1:15
2013 to 2018 on the live demo you can
- 1:19
filter by defensive u suicide and so on
- 1:21
to get a better picture of how the data
- 1:23
is distributed before we get started
- 1:25
let's talk you a little bit more about
- 1:26
how Dec GL works you can think of it as
- 1:28
a layer or multiple layers that sit on
- 1:30
top of your google map when the user
- 1:32
pans around or zooms in and out the
- 1:34
overlay will stick to the map and an
- 1:36
awesome thing about this is that the
- 1:38
layers can be composited in other words
- 1:40
you can set layers on top of each other
- 1:41
add some transparency and Dec GL will
- 1:44
calculate the composite colors that are
- 1:45
actually rendered on the screen and that
- 1:47
can give you some amazing 3d visuals on
- 1:49
top of a two-dimensional map the actual
- 1:51
JavaScript library itself follows the
- 1:53
reactive programming paradigm so it's
- 1:55
very simple and familiar to most
- 1:57
front-end developers all you really need
- 1:59
is a good data set a Google Maps API key


