Published
Edited
May 26, 2021
1 fork
Insert cell
Insert cell
Insert cell
md `First go to https://cors-anywhere.herokuapp.com/ and click the button then reload the page`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` ${/*minPopularityFiltering.join(', ')*/}`
Insert cell
Insert cell
minMalePopularityFiltering
Insert cell
Insert cell
Insert cell
Insert cell
viewof as = autoSelect({
options: Object.keys(nationalData),
placeholder: "Search for a Name"
})
Insert cell
Insert cell
Insert cell
lengthFiltering = Object.keys(nationalData).filter(n=>n.length>=nameRange[0]&&n.length<=nameRange[1])
Insert cell
minimumYearFiltering = lengthFiltering.filter(name=>Object.values(nationalData[name].M).filter(y=>y!=0).length+Object.values(nationalData[name].F).filter(y=>y!=0).length >= minimumYears)
Insert cell
maxPopularityFiltering = minimumYearFiltering.filter(name=>!years.some(year=>100*(nationalData[name].M[year]+nationalData[name].F[year])/inputData.yearlyTotals[year]>=popularityRange[1]))
Insert cell
minPopularityFiltering = maxPopularityFiltering.filter(name=>years.some(year=>100*(nationalData[name].M[year]+nationalData[name].F[year])/inputData.yearlyTotals[year]>=popularityRange[0]))
Insert cell
minMalePopularityFiltering = maxPopularityFiltering.filter(name=>years.some(year=>100*(nationalData[name].M[year])/inputData.yearlyTotals[year]>=popularityRange[0]))
Insert cell
//clusters = kmeans.run(Object.values(nationalData.map(d=>d.F),2)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
densityClustering = require("https://bundle.run/density-clustering")
Insert cell
syllable = require("https://unpkg.com/browse/syllable@4.1.0/index.js")
Insert cell
kmeans = new densityClustering.KMEANS()
Insert cell
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