✨ (admin) allow to overwrite parent values with automatic defaults #3976
+322
−170
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.
Background
Grapher sometimes assigns meaning to config values being
undefined
. For example, iftimelineMaxTime
is undefined, Grapher uses the latest year in the data. This is problematic in an inheritance model sinceundefined
can't be used to overwrite values. As a result, it's currently not possible to overwrite custom parent values with the automatic-default option for the following properties:timelineMinTime
andtimelineMaxTime
yAxis.min
,yAxis.max
,xAxis.min
,xAxis.max
baseColorScheme
yAxis.label
andxAxis.label
map.columnSlug
Summary
Instead of relying on
undefined
to have a value derived from the data, this PR adds a new value, like"auto"
or"latest"
, to make the behaviour explicit.This is done for:
timelineMinTime
andtimelineMaxTime
("earliest"
and"latest"
respectively)yAxis.min
,yAxis.max
,xAxis.min
,xAxis.max
("auto"
)But not for:
map.columnSlug
yAxis.label
andxAxis.label
baseColorScheme
Other changes