Repository navigation
fix(compare): keep each chart axis inside its metric's range, in one format with distinct ticks - #398
Merged
Merged
Conversation
nice_ticks padded a single value both ways, so an axis of zeros ran from -1 to 1, and a cost axis mixed $-1.0000 with $1.00. A zero now gets 0 to 1; the bars' own special case for it goes.
…, inside the metric's range A tick label used the value formatter, so labels repeated after rounding ($0.02 five times), changed precision or unit within an axis (0 $0.0025 $0.01, 500 beside 1.0k, 30s 1m 2m) and the origin read a bare 0. An axis now picks one unit from its largest tick and the decimals its step needs in that unit. A rate's axis keeps to 0 to 100%: one value at a bound pads inwards only.
… and tokens in the fewest The origin keeps its unit and drops its decimals ($0, 0k, 0%, 0m). A rate or token axis whose step needs a decimal more than twice the step doubles it, so all rates of 100% read 90% 95% 100% and tokens 1000 and 1100 read 1.00k 1.05k 1.10k.
This file contains hidden or 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
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.
Closes #390
What
nice_ticks, for every chart kind. A metric can carry bounds; rates carry 0 and 1, so one rate at a bound pads inwards only.$0,0k,0%,0m).90% 95% 100%, not92.5%).app/web/compare.py;app/nullius/charts.pykeeps the step arithmetic and imports no web code. Values outside axes (readings, table cells) are unchanged.Touches
backend, web
Before and after
Rows: Compare, Chart view, at 1280 px: scatter of Cost against Adjusted rate,
nopagainstoracle; dots of Run wall time, the same runs.Verified
$0.01 $0.01 $0.02 $0.03 $0.03;$0.010 $0.015 $0.020 $0.025 $0.030$0.02;$0.018to$0.0221.0k 1.0k 1.1k 1.1k 1.1k;1.00k 1.05k 1.10k1m 2m 2m 2m 3m;1.0m 1.5m 2.0m 2.5m 3.0m0.00;0.001to0.0040 $0.0025 $0.0050 $0.0075 $0.01;$0 $0.0025 $0.0050 $0.0075 $0.01000 250 500 750 1.0k;0k 0.5k 1.0k; 1M:0 250.0k ... 1.00M;0M 0.5M 1.0M0 30s 1m 2m 2m;0m 0.5m 1.0m 1.5m 2.0m90% 100% 110%;90% 95% 100%0 $0.20 $0.40 $0.60;$0 $0.20 $0.40 $0.60$-1.0000 0 $1.00;$0 $1.00Risk
Every Compare chart's tick labels. A chart axis can show more decimals than the table (
$0.018,1.05k), and a rate or token axis can have fewer ticks than before. A unit missing from the axis table falls back to plain numbers. Undone by a revert.