danp / covidwastehfx

The @CovidWasteHfx Bluesky bot
0 stars 0 forks source link

make charts' Y axes the same #4

Open danp opened 1 year ago

danp commented 1 year ago

The most recent image looks like this:

image

The Y axes are all different. For easier comparison across locations it'd be nice to make them all the same.

Guessing this should be doable with some pre-screenshot javascript that does some d3 manipulations.

danp commented 1 year ago

Hmm this may not be doable as I thought. If I understand correctly, the d3-ness of the svg elements is lost once everything is rendered. To do this the way I was thinking might require some kind of breakpoint support in shot-scraper / playwright.

danp commented 1 year ago

I was able to pretty quickly put together a Go program using https://pkg.go.dev/gonum.org/v1/plot which produces a chart per region with all charts having the same Y axis:

charts

I did try putting them all in one chart for #6 but it was busy. Will see if I can highlight new data for #5.