Insert cell
Insert cell
import {viewof scenario} from "@climatelab/hotcold-map"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
deathRateRcp45 = FileAttachment("unit_change_in_deathrate_geography_impact_regions_years_averaged_rcp45_SSP3_quantiles_mean@1.csv").csv({ typed: true })
Insert cell
deathRateRcp85 = FileAttachment("unit_change_in_deathrate_geography_impact_regions_years_averaged_rcp85_SSP3_quantiles_mean@1.csv").csv({ typed: true })
Insert cell
Insert cell
regionsTopo = FileAttachment("lo-res-regions-simplified.topo.json").json()
Insert cell
Insert cell
regionsGeo = {
const geo = topojson.feature(regionsTopo, regionsTopo.objects.name);
geo.features.forEach((feature, index) => {
const { properties } = feature;

properties.rcp45 = deathRateRcp45.find(d => d.Region_ID === properties.hierid);
properties.rcp85 = deathRateRcp85.find(d => d.Region_ID === properties.hierid);

return feature;
});
return rewind(geo, 1);
}
Insert cell
days_under_zero_21 = FileAttachment("days_under_zero_21.geojson")
Insert cell
Insert cell
oceanGeo = topojson.feature(oceanTopo, oceanTopo.objects.ne_110m_ocean)
Insert cell
oceanTopo = FileAttachment("ne_110m_ocean.json").json()
Insert cell
coastlineGeo = topojson.feature(coastlineTopo, coastlineTopo.objects.ne_110m_coastline)
Insert cell
coastlineTopo = FileAttachment("ne_110m_coastline@1.json").json()
Insert cell
Insert cell
Insert cell
color = d3.scaleThreshold(
[-400, -200, -150, -100, -50, -10, 0, 10, 50, 100, 150, 200, 400],
[
"#007a00", "#1c8d25", "#34a241", "#4db55c", "#69c978", "#88dc96", "#aaeeb4",
"#dcd0ff", "#c8b2ff", "#b294ff", "#9a76ff", "#7e58ff", "#5936ff", "#0000ff"
]
)
Insert cell
Insert cell
w = width
Insert cell
h = w * aspect
Insert cell
aspect = 0.49
Insert cell
Insert cell
projection = d3.geoEqualEarth()
.fitSize([ w, h ], { type: "Sphere" })
Insert cell
path = d3.geoPath(projection)
Insert cell
Insert cell
import { toc } from "@harrystevens/toc"
Insert cell
rewind = require('https://bundle.run/@mapbox/geojson-rewind@0.5.1')
Insert cell
geometric = require("geometric@2")
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