I hereby claim:
- I am Pessimistress on github.
- I am pessimistress (https://keybase.io/pessimistress) on keybase.
- I have a public key whose fingerprint is 4C9D B35F E912 DCFC 66CD C0ED 5261 B7F8 578F FDD8
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <html> | |
| <head> | |
| <script src="https://unpkg.com/deck.gl@~5.2.0/deckgl.min.js"></script> | |
| <!-- only if base map is needed --> | |
| <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js"></script> | |
| <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css" rel="stylesheet" /> | |
| </head> | |
| <body> | |
| <div id="container" style="width: 100vw; height: 100vh;"></div> | |
| </body> |
| function updateLayers(data) { | |
| const scatterplot = new deck.ScatterplotLayer({ | |
| /* unique id of this layer */ | |
| id: 'checkins', | |
| /* data: an array of objects */ | |
| data, | |
| /* data accessors */ | |
| getPosition: d => d.coordinates, // returns longitude, latitude, [altitude] | |
| getRadius: d => Math.sqrt(d.count), // returns radius in meters | |
| getColor: d => [255, 0, 0] // returns R, G, B, [A] in 0-255 range |
| // Make a layer interactive: set `pickable` to `true` | |
| new deck.ScatterplotLayer({ | |
| // ... | |
| pickable: true | |
| }); | |
| // You can confirm that it works by turning on autoHighlight. | |
| // The circles should change color when hovered over: | |
| new deck.ScatterplotLayer({ | |
| // ... |
| const deckgl = new deck.DeckGL({ | |
| views: [ | |
| new deck.OrbitView() // Viewport type | |
| ], | |
| viewState: { | |
| distance: 10, | |
| rotationX: 45, | |
| rotationOrbit: 30, | |
| zoom: 1 | |
| }, // Initial camera state |
| <html> | |
| <head> | |
| <title>US County-to-County Migration</title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src="https://unpkg.com/deck.gl@^6.2.0/deckgl.min.js"></script> | |
| <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script> | |
| <link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css"> | |
| <script src="https://d3js.org/d3.v5.min.js"></script> |
| <html> | |
| <head> | |
| <title>Road Accidents in UK</title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src="https://unpkg.com/deck.gl@^6.2.0/deckgl.min.js"></script> | |
| <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script> | |
| <link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css"> | |
| <script src="https://d3js.org/d3.v5.min.js"></script> |
| <html> | |
| <head> | |
| <title>deck.gl + Mapbox Integration</title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src="https://unpkg.com/deck.gl@^6.2.0/deckgl.min.js"></script> | |
| <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script> | |
| <link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css"> | |
| </head> | |
| <body> | |
| <div id="map" style="width: 100vw; height: 100vh"></div> |
| import {ScatterplotLayer} from '@deck.gl/layers'; | |
| import {MapboxLayer} from '@deck.gl/mapbox'; | |
| import mapboxgl from 'mapbox-gl'; | |
| // Get a mapbox API access token | |
| mapboxgl.accessToken = '<your access token here>'; | |
| // Initialize mapbox map | |
| const map = new mapboxgl.Map({ | |
| container: 'map', |
| import React from 'react'; | |
| import DeckGL, {ScatterplotLayer} from 'deck.gl'; | |
| import {StaticMap} from 'react-map-gl'; | |
| import {MapboxLayer} from '@deck.gl/mapbox'; | |
| const INITIAL_VIEW_STATE = { | |
| longitude: -74.50, | |
| latitude: 40, | |
| zoom: 9 |