housing-data
housing-data copied to clipboard
Feature request: zoom (date range select)
2 requests:
- The ability to zoom in on a portion of the map would be helpful.
- The state comparisons should have an option to view per capita.
I'm happy to take a stab at either or both of these if it would be helpful.
For zooming in, what kind of interface did you have in mind? Like, using the scroll bar or a slider or something? And would the zoom only be for the x axis, or both axes?
I could see zooming both x and y axis as being useful, but the tricky thing is that if you have both axes turned on for zooming, then you can't also zoom one or the other by itself with the scroll wheel/two finger trackpad scroll (see https://vega.github.io/vega-lite/docs/zoom.html for an example).
I definitely want to add per capita numbers for states! To get the per capita numbers for each year, I think we would want to divide the housing units in year X by the population in that year—does that makes sense? This means we would need an intercensal estimate of each state's population for each year between 1980 and 2020.
Looks like 1980-1990 estimates are here: https://www.census.gov/data/tables/time-series/demo/popest/pre-1980-state.html 1990-2000 are here: https://www.census.gov/data/tables/time-series/demo/popest/intercensal-1990-2000-state-and-county-totals.html 2000-2010 are here: https://www.census.gov/data/tables/time-series/demo/popest/intercensal-2000-2010-state.html 2010-2019 are here: https://www.census.gov/data/tables/time-series/demo/popest/2010s-state-total.html
If you're interested in taking a stab, a good first step would be writing a python script to parse each of these data series into a pandas DataFrame containing the columns: year, state name, and population.
Yeah that makes sense. I'll give this a shot and let you know how it goes. Thanks
Awesome, thanks! BTW I already got some of the work for the population data started in #14 (that PR also has some unrelated stuff which I'll remove, but the relevant stuff is in population.py).