Published
Edited
Jun 28, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`<link href="https://libs.cartocdn.com/mapbox-gl/v0.45.0-carto1/mapbox-gl.css" rel="stylesheet" />`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
source = {
const source = new carto.source.Dataset('ne_10m_populated_places_simple')
return source
}
Insert cell
Insert cell
viz = {
const viz = new carto.Viz(`
@pop1: $pop_max,
@pop2: $pop_min,
@pop: @pop1/@pop2,
color: ramp(globalQuantiles($pop_max, 5), Prism)
width: (@pop1/@pop2)/10,
filter: torque($labelrank,10,fade(1,1))
`)
return viz
}
Insert cell
Insert cell
layer = {
const layer = new carto.Layer('layer', source, viz);
return layer
}
Insert cell
Insert cell
layer.addTo(map, 'watername_ocean')
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.
Learn more