Public
Edited
Feb 21, 2023
5 forks
Importers
18 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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);

const i45 = d3.index(deathRateRcp45, d => d.Region_ID);
const i85 = d3.index(deathRateRcp85, d => d.Region_ID);
geo.features.forEach((feature, index) => {
const { properties } = feature;

properties.rcp45 = i45.get(properties.hierid);
properties.rcp85 = i85.get(properties.hierid);

return feature;
});
return rewind(geo, 1);
}
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()
.rotate([-10,0])
.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
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more