davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
305 stars 113 forks source link

feat: add government analysis function pals to `openColours()` #362

Closed jack-davison closed 1 year ago

jack-davison commented 1 year ago

Adds UK govt. analysis function palettes to openair; see https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours-in-charts/.

Examples

Categorical:

timeProp(mydata, "nox", "o3", avg.time = "month", cols = "gaf.cat")

image

Focus:

calendarPlot(mydata, year = 2003, breaks = c(0, 50, Inf), cols = "gaf.focus", pollutant = "pm10")

image

Sequential:

trendLevel(mydata, cols = "gaf.seq")

image

jack-davison commented 1 year ago

@davidcarslaw - big question - what do we call them? Currently c("gaf.cat", "gaf.seq", "gaf.focus") but is there a better name?

jack-davison commented 1 year ago

Also took the opportunity to refine the openColours() documentation, which now has a dedicated "palettes" section:

image

davidcarslaw commented 1 year ago

A nice addition - thanks