Published
Edited
Jul 22, 2022
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tippy = require("tippy.js@6")
Insert cell
Insert cell
Insert cell
Insert cell
data= FileAttachment("countries@1.csv").csv()
Insert cell
Insert cell
Insert cell
population = data.map(function(country) { return +country.population; })
Insert cell
airports = data.map(function(country) { return +country.airports; })
Insert cell
median_age = data.map(function(country) { return +country.medianage; })
Insert cell
gdpgrowthrate = data.map(function(country) { return +country.gdpgrowthrate; })
Insert cell
inflationrate = data.map(function(country) { return +country.inflationrate; })
Insert cell
unemploymentrate = data.map(function(country) { return +country.unemploymentrate; })
Insert cell
popnbelowpoverty = data.map(function(country) { return +country.popnbelowpoverty; })
Insert cell
meanpopulation = d3.mean(population)
Insert cell
meanairports = d3.mean(airports)
Insert cell
meanmedianage = d3.mean(median_age)
Insert cell
meangdpgrowthrate = d3.mean(gdpgrowthrate)
Insert cell
meaninflationrate = d3.mean(inflationrate)
Insert cell
meanunemploymentrate = d3.mean(unemploymentrate)
Insert cell
meanpopnbelowpoverty = d3.mean(popnbelowpoverty)
Insert cell
airportsExtent = d3.extent(airports)
Insert cell
populationExtent = d3.extent(population)
Insert cell
medianageExtent = d3.extent(median_age)
Insert cell
gdpgrowthrateExtent = d3.extent(gdpgrowthrate)
Insert cell
inflationrateExtent = d3.extent(inflationrate)
Insert cell
unemploymentrateExtent = d3.extent(unemploymentrate)
Insert cell
popnbelowpovertyExtent = d3.extent(popnbelowpoverty)
Insert cell
country_data = d3.csvParse(await fetch("https://raw.githubusercontent.com/SandeshDhungel/datadoc/main/countries.csv").then(d => d.text()))
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