-
-
Notifications
You must be signed in to change notification settings - Fork 228
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) support multiple chart types / TAS-694 #4159
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4966fad
to
c56c672
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 1366 (41e0ea) ❌ Edited: 2024-11-26 09:45:26 UTC |
c56c672
to
7e590e4
Compare
7e590e4
to
592a432
Compare
7903962
to
b29748a
Compare
96b4143
to
1fa7721
Compare
4367236
to
74039fd
Compare
14ea177
to
48abe5f
Compare
48abe5f
to
72d5a23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really well done, awesome!
I tested this a bunch by running the migration locally, and looking at a bunch of charts and setting one chart to line+slope. Didn't notice anything odd.
packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx
Outdated
Show resolved
Hide resolved
01171a2
to
833685e
Compare
833685e
to
f42ab08
Compare
Adds support for multiple chart types in Grapher.
This PR adds general support for chart-type switching in Grapher but does not yet make it available in the admin or explorers since much more work is needed to make switching between line and slope charts actually a nice experience.
Summary
type
->chartTypes
hasChartTab
has been removedchart_configs.chartType
column. For map-only Graphers,chartType
is null. For Graphers with multiple chart types,chartType
is the first chart type inchartTypes
tab=line
ortab=slope
. If more than one chart type is available,tab=chart
selects the first given chart type.hasChartTab
column in explorer configs has been dropped. If an author wants to hide the chart tab, they can select a special keyword ("None") for thetype
column. (No need to migrate anything sincehasChartTab
is not currently used by any published explorers.)Context
Will be addressed in upcoming PRs:
as unknown as ...
. The next PR refactors the types so that that isn't necessary anymoreNot addressed:
Testing
I migrated the SVG tester configs locally to the new version, using
chartTypes
instead oftype
, and exported a new set of SVGs. No chart differences were found.The Multiembedder fetches prod configs on staging, so any embedded chart (including all charts on test pages) are broken.
Sibling PRs