-
-
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) let chart configs inherit default values / TAS-565 #3782
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiamersmann and the rest of your teammates on Graphite |
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-08-09 16:04:41 UTC |
c5e8003
to
5ffb9ff
Compare
94680ac
to
079ba9a
Compare
0bde167
to
3dd6700
Compare
079ba9a
to
4d2752b
Compare
b4e2aba
to
9b63a0e
Compare
a72aab8
to
98345c7
Compare
9b63a0e
to
40eb2b9
Compare
98345c7
to
f587577
Compare
1218965
to
06ec46a
Compare
7673208
to
be4487e
Compare
6820c13
to
1595f80
Compare
f49fc05
to
434ff19
Compare
12ec019
to
8e49eb3
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.
Nice work!
434ff19
to
fd2bb43
Compare
8e49eb3
to
9c7c0d5
Compare
9c7c0d5
to
6b6c45b
Compare
6b6c45b
to
a0c467a
Compare
Merge activity
|
Summary
Implements chart config inheritance and makes all chart configs inherit values from a parent config with default values.
Details
full
config is thepatch
config merged with the default layerfullpatch config for version history. The way we currently do revisions doesn't always work1.Using the full config for version history fixes this, but has the disadvantage that "old" default values (that have since been updated) are copied over when a config is restored.generate-default-object-from-schema.ts
with the--save-ts
flagfull
configs of stand-alone charts should be recomputedmergeGrapherConfigs
: merges two or more patch configsdiffGrapherConfigs
: diffs a given config against some reference config, where only values that are different in both configs are keptCaveats
I left the chart revisions as is but now store the full config in the chart revisions table whenever a chart is saved – this could be a bit confusingAs I said above, storing the full config in version history comes at the cost of copying over old default values when a chart is restored – how big of a problem is that?SVG tester
I dumped two new set of configs and reference charts for the SVG tester:
To do
Add some real-world testsit's ok as isDEFAULT_GRAPHER_CONFIG_SCHEMA
Footnotes
When restoring a config from version history, we re-apply an old config version. But that doesn't take default values into account. For example, let's say the v1 version of a chart relies on the default value for
hasMapTab
and has thus no map tab. In v2, a map tab is added (the config now contains{..., hasMapTab: true}
. Restoring v1 doesn't switchhasMapTab
back tofalse
sincehasMapTab
isn't contained in the v1 version of the config (since we were relying on the default). ↩