Public
Edited
Oct 17, 2023
2 forks
2 stars
Female to male labor ratio
Insert cell
Insert cell
femaletomalelabor.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
labor = (await FileAttachment("femaletomalelabor.csv").csv()).map(d => ({name: rename.get(d.country) || d.country, Year2022: +d.Year2022}))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: "Equal-Earth",
marks: [Plot.sphere({fill: "white"}),
Plot.geo(countries, {fill: "gray", opacity: .3, stroke: "white"}),
Plot.geo(countries, {fill: (d)=> labor_2020.get(d.properties.name), opacity: 1, stroke: "white",
title: (d)=> d.properties.name + "\n" + Math.round(labor_2020.get(d.properties.name))+"%"
})
],
width: 1200,
color: {type: "sequential", legend: true, scheme: "blues", style: {fontSize: 20}}
})
Insert cell
Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"
Insert cell
Insert cell
Insert cell
addTooltips(
Plot.plot({
projection: "Equal-Earth",
marks: [Plot.sphere({fill: "white"}),
Plot.geo(countries, {fill: "gray", opacity: .3, stroke: "white"}),
Plot.geo(countries, {fill: (d)=> labor_2020.get(d.properties.name), opacity: 1, stroke: "white",
title: (d)=> d.properties.name + "\n" + Math.round(labor_2020.get(d.properties.name))+"%"
})
],
width: 1200,
color: {type: "sequential", legend: true, scheme: "blues", style: {fontSize: 20}}
}),
// Set styles for the hovered element
{ fill: "red", opacity: 0.5, "stroke-width": "3px", stroke: "yellow" }
)
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