Public
Edited
Feb 9, 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
raw = FileAttachment("dataset-9-vr-successful-closures-by-occupation-and-county-sfy-14-15-through-sfy-17-18.csv").csv({typed: true})
Insert cell
Insert cell
rehab = raw.filter(row => row.Occupation != "Not Reported")
Insert cell
Insert cell
rehabFlattened = d3.flatRollup(rehab, D => d3.sum(D, d => d["Successful Closures"]), d => d.Year, d => d.Occupation)
Insert cell
closuresByOccupationByYear = rehabFlattened.map(row => ({year: row[0], occupation: row[1], closure: row[2]}))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
years = [2014, 2015, 2016, 2017]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more