-
-
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
✨ (line chart) set y-axis min default to 0 #4080
Conversation
283367a
to
5604383
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 31 (25d0a4) ❌ Edited: 2024-11-06 16:05:32 UTC |
5f8a77a
to
ffdc35c
Compare
3597b31
to
e07f64a
Compare
ffdc35c
to
34a35c4
Compare
e07f64a
to
c60c2c5
Compare
34a35c4
to
c95ccf1
Compare
c60c2c5
to
7ff306f
Compare
f9cf121
to
d234fe8
Compare
7ff306f
to
7d455e6
Compare
2056540
to
f107534
Compare
7d455e6
to
adf0264
Compare
f107534
to
9e86996
Compare
adf0264
to
a3b1e38
Compare
7e9094f
to
635477e
Compare
a3b1e38
to
fce4f27
Compare
635477e
to
27aad3d
Compare
27aad3d
to
f801620
Compare
fce4f27
to
26ae780
Compare
f801620
to
d057b20
Compare
d3b015d
to
a680591
Compare
a680591
to
8438f8a
Compare
26ae780
to
cc4dcf3
Compare
8438f8a
to
9bf41a6
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!
One thing I didn't entirely find out, but I think I got a sense: Existing charts stay unchanged in this, right? I.e., the migration makes it so the "effective chart diff" is empty?
public async down(): Promise<void> {} | ||
} | ||
|
||
const defaultGrapherConfig = { |
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.
If I understand this correctly, then this is the default config before this PR was merged, right?
If that's the case, then let's make this more explicit - either in the name or in a comment.
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.
Oh shoot, I copy-pasted the wrong config! This should just be the default config as it exists on this branch. I copied it over (instead of importing) because I realised that relying on the default config version of the code that is running the migration is a bit dangerous (because we really do need this specific version of the default config). Sorry for the confusion!
So, the default config we're working with doesn't have a default value for yAxis.min
. Then, the gist of the migration is:
- If a chart relied on the default for
yAxis.min
beingauto
, addyAxis.min=auto
to its patch config to make this explicit - Then recompute the full config using the new default config
- The full config should thus be unchanged (but the patch config of a chart might have been changed)
Before reading your comment, I was testing an upstream PR upstream and I couldn't make sense of some of the chart diffs I was seeing. I'm pretty sure this is the reason – so thanks for spotting it! It probably would have taken ages to figure it out 🫠
9bf41a6
to
5da7000
Compare
Resolves #3797
Summary
Makes 0 the new default minimum value for the y-axis of line charts
Details
About the default Grapher config
yAxis.min
depends on the chart type (0
for line charts,auto
for others). As a result,yAxis.min
can't be included in the default base layer (since there isn't a single default value that should apply to all configs)About the Grapher/config interface
auto
value parsed from the config used to be translated toundefined
for Grapher, which told Grapher to infer the min/max value from the dataauto
value is translated to Infinity, which also means "infer from data", and having no value triggers the default behaviour, which is usually "auto" behaviour but is overwritten to be 0 for line chartsAbout the admin
SVG tester
The SVG tester updates are technically correct. I'll re-export configs for the SVG tester next week after removing the default config layer.
To do