Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support date in Timeline selection in Grapher #3927

Open
lucasrodes opened this issue Sep 5, 2024 · 1 comment
Open

Support date in Timeline selection in Grapher #3927

lucasrodes opened this issue Sep 5, 2024 · 1 comment
Labels
admin Issues that need to be solved in the grapher admin (mostly) feature needs triage viz

Comments

@lucasrodes
Copy link
Member

lucasrodes commented Sep 5, 2024

Core problem

In ETL, we sometimes work with time series with dates (not years). However, Grapher uses 'number of days since zeroDay' under the hood, and is not able to select dates in the Timeline selection.

image

Proposed solution

It'd be nice if we could render a date selector there. Or support date-like strings.

Context

For Grapher to support date format, we have been using a hack:

  • Before adding indicator data with dates to Grapher, convert to 'a number of days passed since [day of reference].'
  • This conversion was done manually by computing DATE_REFERENCE - date in days. Then, we filled the metadata fields yearIsDay=True and zeroDay=DATE_REFERENCE.
  • This was recently improved (see https://github.com/owid/etl/blob/1e261241e77b1717e975c9c2273a60e49867707a/etl/grapher_helpers.py#L750) and is now done automatically in ETL. As DATE_REFERENCE, we are using the minimum date appearing in the time series. However, this field is exposed in ETL and hence can be changed by the user. So, we it could be any date.
@lucasrodes
Copy link
Member Author

Saloni was confused with the Timeline selection in https://github.com/owid/owid-issues/issues/1653

@sophiamersmann sophiamersmann added viz admin Issues that need to be solved in the grapher admin (mostly) labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Issues that need to be solved in the grapher admin (mostly) feature needs triage viz
Projects
None yet
Development

No branches or pull requests

2 participants