Fireship · @fireship

Visualize 140k Gun Violence Incidents with Deck.gl & Google Maps

Uploaded November 5, 2019 · Length 11:15

Visualize 140k Gun Violence Incidents with Deck.gl & Google Maps

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.

  1. 0:02

    today will take over 140,000 data points

  2. 0:05

    of people being killed or injured by

  3. 0:07

    guns and visualize them with deck GL and

  4. 0:09

    Google Maps we can go from a heat map of

  5. 0:11

    the entire country down to the actual

  6. 0:13

    street view of a neighborhood where the

  7. 0:15

    [ __ ] went down we'll start by adding a

  8. 0:17

    scatter plot layer for every single

  9. 0:18

    point in the data set then we'll add a

  10. 0:20

    tool tip to see how many people were

  11. 0:22

    injured or killed at a given incident

  12. 0:23

    and we'll cluster points together into a

  13. 0:25

    heat map based on the map zoom level

  14. 0:28

    lastly we'll cluster points into a

  15. 0:30

    hexagon with a one-mile radius and

  16. 0:32

    extrude them into a 3d shape where the

  17. 0:34

    elevation represents the amount of

  18. 0:35

    violence in that space we can do all of

  19. 0:37

    this data visualization efficiently

  20. 0:39

    thanks to a library called deck GL it

  21. 0:41

    was created by uber to visualize their

  22. 0:43

    own data and is able to run computations

  23. 0:45

    efficiently by offloading them to the

  24. 0:47

    GPU with WebGL take a look at their

  25. 0:56

    showcase for some awesome examples of

  26. 0:58

    companies using this technology in

  27. 0:59

    production I think my favorite is escape

  28. 1:01

    it uses the deck GL arc layer to

  29. 1:03

    visualize the cheapest flights based on

  30. 1:05

    your location around the world now I

  31. 1:07

    realize that guns are a hot political

  32. 1:08

    issue in the United States

  33. 1:10

    so I've tried to make this visual as

  34. 1:12

    neutral as possible the data comes from

  35. 1:14

    the gun violence archive from the years

  36. 1:15

    2013 to 2018 on the live demo you can

  37. 1:19

    filter by defensive u suicide and so on

  38. 1:21

    to get a better picture of how the data

  39. 1:23

    is distributed before we get started

  40. 1:25

    let's talk you a little bit more about

  41. 1:26

    how Dec GL works you can think of it as

  42. 1:28

    a layer or multiple layers that sit on

  43. 1:30

    top of your google map when the user

  44. 1:32

    pans around or zooms in and out the

  45. 1:34

    overlay will stick to the map and an

  46. 1:36

    awesome thing about this is that the

  47. 1:38

    layers can be composited in other words

  48. 1:40

    you can set layers on top of each other

  49. 1:41

    add some transparency and Dec GL will

  50. 1:44

    calculate the composite colors that are

  51. 1:45

    actually rendered on the screen and that

  52. 1:47

    can give you some amazing 3d visuals on

  53. 1:49

    top of a two-dimensional map the actual

  54. 1:51

    JavaScript library itself follows the

  55. 1:53

    reactive programming paradigm so it's

  56. 1:55

    very simple and familiar to most

  57. 1:57

    front-end developers all you really need

  58. 1:59

    is a good data set a Google Maps API key