4 ms·
Would be interesting to see it expressed as a % of population as well to see HN density, as well as quantity.
by awb 5y ago
Would be interesting to see it expressed as a % of population as well to see HN density, as well as quantity.
- lolinder 5y agoI didn't get the data to do this globally, but here it is for the US (data from https://api.census.gov/data/2021/pep/population?get=POP_2021,NAME,STATE&for=state:\ https://api.census.gov/data/2021/pep/population?get=POP_2021...*): const totalPop = {"Oklahoma":3986639,"Nebraska":1963692,"Hawaii":1441553,"South Dakota":895376,"Tennessee":6975218,"Nevada":3143991,"New Mexico":2115877,"Iowa":3193079,"Kansas":2934582,"District of Columbia":670050,"Texas":29527941,"Missouri":6168187,"Arkansas":3025891,"Michigan":10050811,"New Hampshire":1388992,"North Carolina":10551162,"Ohio":11780017,"South Carolina":5190705,"Wyoming":578803,"California":39237836,"North Dakota":774948,"Louisiana":4624047,"Maryland":6165129,"Delaware":1003384,"Pennsylvania":12964056,"Georgia":10799566,"Oregon":4246155,"Minnesota":5707390,"Colorado":5812069,"New Jersey":9267130,"Kentucky":4509394,"Washington":7738692,"Maine":1372247,"Vermont":645570,"Idaho":1900923,"Indiana":6805985,"Montana":1104271,"New York":19835913,"Puerto Rico":3263584,"Connecticut":3605597,"Florida":21781128,"Virginia":8642274,"Massachusetts":6984723,"Illinois":12671469,"Mississippi":2949965,"Arizona":7276316,"Utah":3337975,"Wisconsin":5895908,"Alabama":5039877,"West Virginia":1782959,"Rhode Island":1095610,"Alaska":732673}; console.table( [...document.querySelectorAll('.fatitem table .athing')] .map(el => ({place: el.textContent.trim(), score: parseInt(el.nextSibling.textContent)})) .filter(el => el.place.includes("US:")) .map(el => ({...el, place: el.place.replace("US: ", "")})) .map(el => ({...el, totalPop: totalPop[el.place]})) .filter(el => el.totalPop != undefined) .map(el => ({...el, density: el.score / el.totalPop})) .sort((a, b) => b.density - a.density) )