I used nest to sort my data by city and then used g grouping elements to construct charts in the SVG design.
Possible improvements:
- Responsive design - This currently uses an SVG container, though I think a div container might better for responsive design.
- Selecting svg elements - I was not successful in adding a rect to use as a background (e.g., white) in each small chart, because my bars code uses selectAll, which grabbed the background rect. I think selecting (via selectors?) could allow for the bar code to ignore the background rect.
- Conditional display of Y axis in g grouping elements- In the limited presentation of 3 charts, I'd like to eliminate the Y-axis labels for the 2nd and 3rd charts, which might be possible using conditional formatting referencing index i.