Public
Edited
May 26, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
colors = [ "#d3e7fa", "#5784c5", "#fc004b", "#ffec44" ]
Insert cell
interpolate = interpolatePalette(colors)
Insert cell
color = d3.scaleSequentialLog(countExtent, interpolate)
Insert cell
interval = 100 / (colors.length - 1)
Insert cell
gradient = gradientLinear()
.offsets(d3.range(0, 100 + interval, interval))
.colors(colors)
Insert cell
Insert cell
projection = d3.geoEqualEarth()
.rotate([-10, 0, 0])
.fitSize([w, h], { type: "Sphere" })
Insert cell
path = d3.geoPath(projection)
Insert cell
worldTopo = FileAttachment("ne_110m_land.json").json()
Insert cell
worldGeo = topojson.feature(worldTopo, worldTopo.objects.ne_110m_land)
Insert cell
Insert cell
w = width
Insert cell
h = w * aspect
Insert cell
aspect = 0.49
Insert cell
Insert cell
resolution = 0.5
Insert cell
// Downloaded from https://globalfishingwatch.org/data-download/datasets/public-welch-et-al-disabling-events:v20221102
ais_disabling_events = FileAttachment("ais_disabling_events.csv").csv()
Insert cell
points = [
...d3
.rollup(
ais_disabling_events.map(
(d) =>
`${resolution * ((d.gap_start_lon / resolution) | 0)} ${
resolution * ((d.gap_start_lat / resolution) | 0)
}`
),
(v) => {
const [x, y] = v[0].split(" ").map(Number);
return { x, y, count: v.length };
},
(d) => d
)
.values()
]
Insert cell
countExtent = d3.extent(points, d => d.count)
Insert cell
Insert cell
import { gradientLinear } from "@washpostgraphics/gradient-generators"
Insert cell
import { interpolatePalette } from "@harrystevens/roll-your-own-color-palette-interpolator"
Insert cell
import { toc } from "@harrystevens/toc@126"
Insert cell
import { franklinLight } from "@climatelab/fonts@44"
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