Public
Edited
Nov 14, 2023
Insert cell
Insert cell
Plot.plot({
insetBottom: 60,
insetLeft: 200,
insetTop: 0,
projection: {type: "mercator",
domain: {type: "MultiPoint", coordinates: [[54, 12],[21, -36],[-19, 14],[10, 39]]} },
width: 700,
marks: [
Plot.sphere({fill: "white"}),
Plot.geo(countries, {fill: (d)=> freedomindex_2020.get(d.properties.name), opacity: 1, stroke: "forestgreen",
title: (d)=> d.properties.name + "\n" + freedomindex_2020.get(d.properties.name)}),
Plot.text(['\nPolitical rights\nAfrica, 2020'],
{x:-45, y: 35, fontSize:35, fill: "#5C4033", opacity: 1, lineWidth: 26, textAnchor: "start", lineHeight: 1.4, clip: false, fontWeight: "bold", fontFamily: "italics", fontStyle: "italic" }),
Plot.text(['Freedom in the world'],
{x:-45, y: -4, fontSize: 30, fill: "#5C4033", opacity: 1, lineWidth: 26, textAnchor: "start", lineHeight: 1.4, clip: false, fontWeight: "bold" }),
Plot.text(['Freedom in the World, Freedom House\'s flagship publication, is the standard-setting comparative assessment of global political rights and civil liberties. Published annually since 1972, the survey ratings and narrative reports on 195 countries and 15 related and disputed territories are used by policymakers, the media, international corporations, civic activists, and human rights defenders.'],
{x:-45, y: -22, fontSize: 16, fill: "#5C4033", opacity: 1, lineWidth: 26, textAnchor: "start", lineHeight: 1.6, clip: false }),
Plot.text(['Data: Freedom House | Design: Deepsha Menghani | Threads: IandLoveandData | Mastodon: Deepsha'],{x:-45, y: -38, fontSize: 15, fill: "#5C4033", opacity: 1, textAnchor: "start", lineHeight: 1.2, clip: false, fontStyle: "italic"})
],
color: {type: "sequential", legend: true, scheme: "greens", style: {fontSize: 20}, width: 700, ticks: 7},
})
Insert cell
freedom_afr_2020.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
freedom_index = (await FileAttachment("freedom_afr_2020.csv").csv()).map(d => ({name: rename.get(d.country) || d.country, PR: +d.PR}))
Insert cell
freedomindex_2020 = new Map(freedom_index.map(({name, PR}) => [name, PR]))
Insert cell
import {countries} from "ff0a83b495637684"
Insert cell
import {rename} from "ff0a83b495637684"
Insert cell
import {land} from "ff0a83b495637684"
Insert cell
land
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