Platform
Resources
Pricing
Sign in
Get started
Xiaoji Chen
Designer. Geek. Beer addict. Data queen.
Workspace
Fork
Public
SIGSPATIAL 22
By
Xiaoji Chen
Edited
Nov 1, 2022
Fork of
Getting Started with deck.gl: Stacking
•
3 forks
5 stars
1
Insert cell
Insert cell
Insert cell
Insert cell
deckgl
=
new
deck
.
DeckGL
(
{
container
,
map
:
mapboxgl
,
mapStyle
:
'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json'
,
initialViewState
:
{
longitude
:
-
74
,
latitude
:
40.71
,
zoom
:
12
}
,
controller
:
true
}
)
;
Insert cell
Insert cell
Insert cell
pickupLocations
=
FileAttachment
(
"uber-pickup-locations.csv"
)
.
csv
(
)
Insert cell
Insert cell
scatterLayer
=
new
deck
.
ScatterplotLayer
(
{
id
:
'pickup-locations'
,
data
:
pickupLocations
,
getPosition
:
d
=>
[
Number
(
d
.
lng
)
,
Number
(
d
.
lat
)
]
,
getRadius
:
d
=>
Math
.
sqrt
(
d
.
count
)
,
radiusUnits
:
'pixels'
,
getFillColor
:
[
255
,
255
,
255
]
}
)
Insert cell
heatmapLayer
=
new
deck
.
HeatmapLayer
(
{
id
:
'heatmap'
,
data
:
pickupLocations
,
getPosition
:
d
=>
[
Number
(
d
.
lng
)
,
Number
(
d
.
lat
)
]
,
getWeight
:
d
=>
Number
(
d
.
count
)
,
radiusPixels
:
30
,
intensity
:
1
}
)
Insert cell
gridLayer
=
new
deck
.
GridLayer
(
{
id
:
'pickup-grid-bins'
,
data
:
pickupLocations
,
getPosition
:
d
=>
[
Number
(
d
.
lng
)
,
Number
(
d
.
lat
)
]
,
getElevationWeight
:
d
=>
Number
(
d
.
count
)
,
extruded
:
true
,
cellSize
:
200
,
elevationScale
:
5
}
)
Insert cell
deckgl
.
setProps
(
{
layers
:
[
gridLayer
]
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
container
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
deckgl
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
pickupLocations
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
scatterLayer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
heatmapLayer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
gridLayer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
deck
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mapboxgl
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML