Public
Edited
Mar 31, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
min_max = {
function min_max_f(data) {
let min = 100;
let max = 0;
data.forEach((country, idx) => {
for (const year in country) {
if (country[year] !== 0 && Number(year) > 1960) {
if (min > country[year]) min = country[year];
if (max < country[year]) max = country[year];
}
}
});
return [min, max];
}

const life = min_max_f(life_expectancy);
const pop = min_max_f(population);
const fert = min_max_f(fertility_rate);

return { life, pop, fert };
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { Plot } from "@mkfreeman/plot-tooltip"
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