-
-
Notifications
You must be signed in to change notification settings - Fork 229
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) make charts inherit indicator-level settings / TAS-567 #3793
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sophiamersmann
changed the title
🎉 (grapher) make charts inherit indicator-level settings
🎉 (grapher) make charts inherit indicator-level settings / TAS-567
Jul 16, 2024
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiamersmann and the rest of your teammates on Graphite |
2 tasks
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
July 16, 2024 16:09
9d2d676
to
b74f932
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-08-20 10:04:48 UTC |
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 17, 2024 10:01
4ec3a29
to
77a6539
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
2 times, most recently
from
July 17, 2024 12:41
352c71d
to
27d2a32
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 17, 2024 16:47
77a6539
to
b8531a5
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
July 17, 2024 16:47
27d2a32
to
4cc1e3c
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 17, 2024 16:48
b8531a5
to
659e513
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
July 17, 2024 16:48
4cc1e3c
to
885b742
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 18, 2024 11:18
659e513
to
bdbb4b6
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
2 times, most recently
from
July 18, 2024 15:34
64e3497
to
5a33473
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 18, 2024 15:54
bdbb4b6
to
72d7d49
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
July 18, 2024 15:54
5a33473
to
ed9f620
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 18, 2024 16:05
72d7d49
to
a66359d
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
4 times, most recently
from
July 19, 2024 11:06
5a0d382
to
e44c839
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 19, 2024 13:44
a66359d
to
b14cffe
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
July 19, 2024 13:44
e44c839
to
9a7cffc
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 19, 2024 14:23
b14cffe
to
598cbc1
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
2 times, most recently
from
July 19, 2024 15:49
ca24134
to
ab919cd
Compare
sophiamersmann
force-pushed
the
inherit-defaults
branch
from
July 22, 2024 06:12
598cbc1
to
466d271
Compare
sophiamersmann
force-pushed
the
inherit-indicator-settings
branch
from
September 4, 2024 14:34
1483820
to
d629147
Compare
Merge activity
|
This was referenced Sep 13, 2024
sophiamersmann
added a commit
that referenced
this pull request
Sep 17, 2024
Fixes #3931 The global entity selector manages the selection of a chart from outside by passing in its own `selection` object, which should take precedence over the config's `selectedEntityNames`. In #3793, Grapher's `updateFromObject` method was updated to also change the current selection if `selectedEntityNames` is given. That's sensible (and is needed in the admin), but `updateFromObject` is also called in the constructor. If `selectedEntityNames` and `selection` both are given then `selectedEntityNames` always won, which broke the global entity selector (since it relies on `selection` being respected). I think it's sensible to apply the passed-in selection only if it's non-empty, but this leads to funny behaviour of the global entity selector if the selection happens to be empty (e.g., http://staging-site-fix-global-entity-selector/energy/country/spain?country=). But, apparently, even before #3793, the global entity selector has behaved weirdly for empty selections (e.g., https://e7fd384b.owid.pages.dev/energy/country/spain?country=). It's not ideal, but I don't think it's too bad.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements chart config inheritance. Inheritance is opt-out, but disabled for all existing charts.
Database
variables.grapherConfigIdAdmin
andvariables.grapherConfigIdETL
that point to rows in thechart_configs
tablevariables.grapherConfigETL
to thechart_configs
table (variables.grapherConfigAdmin
is discarded)fullConfig
=patchConfig
(since they don't have a parent)fullConfigAdmin
=patchConfigETL
+patchConfigAdmin
charts.isInheritanceEnabled
column (disabled by default)charts_x_parents
that lists every chart and the parent variable it may inherit fromAdmin API
/charts/:chartId.config.json
returns the full config of a chart/charts/:chartId.patchConfig.json
returns the patch config (needed in admin)/charts/:chartId.parent.json
returns the parent variable id and config and whether inheritance is currently enabled (needed in the admin)/charts
and/charts/:chartId
)/charts/:chartId?inheritance=enable
saves a chart, with inheritance enabled/charts/:chartId?inheritance=disable
saved a chart, with inheritance disabledinheritance
parameter is not given then a chart is saved without changing the inheritance settinggrapherConfigETL
PUT /variables/:variableId/grapherConfigETL
creates a new config or updates an existing oneDELETE /variables/:variableId/grapherConfigETL
deletes an ETL-authored configGrapher schema
version
andtitle
are now optionalversion
gets set automatically by the server if missing on save$schema
anddimensions
are required$schema
is esp. important for merging Grapher configs$schema
is also set to a constant value, the current schema version (i.e. the schema validator fails if the$schema
is set to any other value) – it makes sense for now, but we might want to lift this restriction in the futuredetails
andtopicIds
, both were legacy and have been removedAdmin
<IndicatorChartEditorPage />
,<IndicatorChartEditor />
) are mostly empty for now and are not linked to<ChartEditorPage />
fetches data, inits aChartEditor
instance and renders<ChartEditorView />
, with itself as its managerChartEditor
handles state and IO that is specific to "normal" Grapher charts; common state and functionality that likely every editable chart needs is inherited fromAbstractChartEditor
IndicatorChartEditor
, for example, will handle state and IO that is specific to indicator-level chartsselectedEntityNames
) is edited can also be linked to the parent selectionCaveats
dimensions
from a parent indicator (since the dimensions are needed to figure out the parent indicator of a chart)ChartEditorPage
loads all things related to the chart, and laterChartEditorView
loads all things related to the admin (variables data, details)Testing
To do
To do after merging