owid-grapher
owid-grapher copied to clipboard
Support for more time intervals than yearly and daily
Core problem
We have some datasets that have monthly, quarterly, decadal, or once-per-century observations. Right now we can present them already using daily or yearly, but there are some drawbacks:
-
For monthly data, we have to pick some (somewhat arbitrary) point in the month, and it's not immediately that the point ranges over the whole month.
Example
-
For decadal data, for example, going on the map tab will append e.g. "1910" to the title, rather than the more clear "1910s" or "1910-1919".
Example
-
For line charts, the x axis will show axis ticks for "irrelevant" increments.
Example
Proposed solution
Introduce new time intervals. These would be specified in the variable metadata file, and interpreted by Grapher on load. The following time intervals seem useful:
- monthly
- quarterly
- decadal
- per-century
Challenges
In the past, we had issues when trying to combine variables using different time units in a scatterplot. That'll probably continue into the future.
In addition, we have to come up with reasonable serialisation schemes for the different time units.
For example, we could serialise "August 2022" to "2022-08"
, or 202208
, or 2022 * 12 + 8
.
Ideally, this serialization format sorts correctly (bonus points for negative values, like "August, 100 BCE"), and is integer-continuous (i.e. if n
is a valid value, then n + 1
is also a valid value).
Alternatives
Leave it as-is.
Context
We already have a few charts that basically use one of these time intervals:
- "Temperature anomaly" in the climate change explorer has monthly data
- Natural disasters explorer has decadal averages
- Manuscript production per century
In addition, we have a very bare-bones implementation of using quarterly observations already (which can only be used in explorers, and is never used in production). See this example explorer.
This could be a good one to discuss in a #data-viz chat.
For reference, there is also a proposal in Notion
Saloni requested this, for nicer tick marks in the flu explorer.
This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.