Create a Vanilla JavaScript Application with Mapbox and Deck.gl

Thanks to browser friendly bundles made available by both projects, you can create a fully functional map that displays data in less than 50 lines of code.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>High Performance Web Graphics - Sandbox</title>
  <style>
    body {
      width: 100vw;
      height: 100vh;
      margin: 0;
    }
  </style>
  <script src='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js'></script>
  <link href='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css' rel='stylesheet' />
  <script src="https://unpkg.com/deck.gl@latest/dist.min.js"></script>
</head>
<body>
  <script>
    const {DeckGL, ScatterplotLayer} = deck;

    const MALE_COLOR = [0, 128, 255];
    const FEMALE_COLOR = [255, 0, 128];

    new DeckGL({
      mapStyle: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',
      initialViewState: {
        longitude: -74,
        latitude: 40.76,
        zoom: 12,
        maxZoom: 16
      },
      controller: true,
      layers: [
        new ScatterplotLayer({
          id: 'scatter-plot',
          data: 'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/scatterplot/manhattan.json',
          radiusScale: 10,
          radiusMinPixels: 0.5,
          getPosition: d => [d[0], d[1], 0],
          getFillColor: d => (d[2] === 1 ? MALE_COLOR : FEMALE_COLOR)
        })
      ]
    });
  </script>
</body>
</html>