Repository navigation
Commit 0153c9e
committed
Snap near-zero tick values to tick0 to fix float artefacts in labels
When ticks are built by repeated increments, a tick that should sit
exactly on tick0 can come out as a tiny nonzero value like -8.9e-17.
The default numeric format rounds that away, but d3-format specs such as
`~r` render it literally, so a tick at zero showed as
-0.0000000000000000888178. When a computed tick value is far closer to
tick0 than one dtick, snap it to exactly tick0.
Fixes #77651 parent 227bba9 commit 0153c9e
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
93 | 107 | | |
94 | 108 | | |
95 | 109 | | |
| |||
1067 | 1081 | | |
1068 | 1082 | | |
1069 | 1083 | | |
| 1084 | + | |
1070 | 1085 | | |
1071 | 1086 | | |
1072 | 1087 | | |
| |||
1110 | 1125 | | |
1111 | 1126 | | |
1112 | 1127 | | |
1113 | | - | |
| 1128 | + | |
1114 | 1129 | | |
1115 | 1130 | | |
1116 | 1131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3502 | 3502 | | |
3503 | 3503 | | |
3504 | 3504 | | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
3505 | 3528 | | |
3506 | 3529 | | |
3507 | 3530 | | |
| |||
0 commit comments