Closed rharron closed 4 years ago
It looks like each ZTCA corresponds to a tag in the svg file that begins with "<path aria-label=". What follows that is some human-readable text about that ZTCA and then a whole bunch of number that I'm pretty sure are encoding the actual geometry of that ZCTA and near the end of the path tag is something like 'fill="rgb(238, 88, 158)"', which looks like it's encoding what colour to make that ZTCA. So that seems to explain it. I'll play around with this to see if I'm right.
Also, I've uploaded the June 12th version of the case rate map to this repo. I called it NYCmap06-12.svg.
For posterity's sake, I'll note that the human-readable test about the ZCTA contains a field called "ZIP Code" and sometimes that field contains two zip codes. In this case, you can find the data for that ZCTA listed under the first zip code (the second zip code is absent from the data files).
The recent commits have allowed our code to batch create svgs (of the covid count rate). I took the svg and used Imagemagick to create a gif. Here it is!
There's definitely a widespread spike on April 26. Is it a mistake?
I still need to figure out how to make the colour legend match the colour map I use. That'll be for another day!
Very nice!
That spike seems related to the data quality issue in #4
Commit befc05126d307989f018b6ac801a6c5270224600 adds the ability to choose the colormap to use (by name) and updates the legend accordingly (still need to update the min and max values on the legend). Here's a gif for the colormap 'Spectral_r':
The file svg you can get from https://www1.nyc.gov/site/doh/covid/covid-19-data.page is all written in one line, so it's a mess to parse by looking at it. But once we figure it out, it shouldn't be so bad to edit it.