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

✨ (grapher) pull in data types from metadata #3375

Merged
merged 5 commits into from
Apr 3, 2024
Merged

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Mar 20, 2024

Note

Wait for #3362 to be merged into master.

  • Indicator metadata comes with types
  • Up until now, Grapher has been ignoring type information and marked every column as mixed type
  • This PR pulls in the metadata type information into Grapher by setting the appropriate column type

  • Open question: Should we split Numeric into Integer and Float? Using Integer for int and Numeric for float

Closes #1692

@sophiamersmann
Copy link
Member Author

After marking int columns as Integer columns in Grapher, the SVG reported a few charts with differences like this:

Screenshot 2024-03-28 at 12 23 42

The incorrect rounding stems from the fact that the data column is marked as integer (which is technically correct), but then a conversion factor is applied to it, which turns the Integer column into a Non-integer column.

This is fixed by updating the column definition when a conversion factor is applied.


For the remaining SVG differences, integer rounding is an improvement

@marcelgerber
Copy link
Member

marcelgerber commented Mar 28, 2024

In theory, we could check if the conversionFactor is itself integer (for example 1000), and in that case keep the column type as Integer.
Not necessary, though, the difference is not stark.

Co-authored-by: Marcel Gerber <[email protected]>
Base automatically changed from ordinal-types to master April 2, 2024 15:44
@sophiamersmann sophiamersmann merged commit d6dfeda into master Apr 3, 2024
16 of 18 checks passed
@sophiamersmann sophiamersmann deleted the data-types branch April 3, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concept: types in grapher data model
2 participants