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 for more time intervals than yearly and daily #2007

Open
marcelgerber opened this issue Mar 15, 2023 · 4 comments
Open

Support for more time intervals than yearly and daily #2007

marcelgerber opened this issue Mar 15, 2023 · 4 comments

Comments

@marcelgerber
Copy link
Member

marcelgerber commented Mar 15, 2023

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

    image

  • 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

    image

  • For line charts, the x axis will show axis ticks for "irrelevant" increments.

    Example

    image

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:

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.

Slack discussion here

@larsyencken
Copy link
Contributor

This could be a good one to discuss in a #data-viz chat.

@sophiamersmann
Copy link
Member

For reference, there is also a proposal in Notion

@marcelgerber
Copy link
Member Author

Saloni requested this, for nicer tick marks in the flu explorer.

Copy link

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.

@github-actions github-actions bot added the stale label Mar 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
@marcelgerber marcelgerber reopened this Mar 25, 2024
@danyx23 danyx23 added the viz label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants