Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork21
Commit8386138
authored
fix: improve automatic compact notation detection (#278)
This pull request refactors how compact notation is determined for axistick labels in both the `AxisX.svelte` and `AxisY.svelte` components.The logic for deciding when to use compact notation (e.g., "1K" for1,000) is now extracted into a derived store for clarity andconsistency, and the code for formatting tick labels is updated to usethis new logic.**Axis tick label formatting improvements:*** Extracted the logic for determining whether to use compact notationinto a new `$derived` store called `useCompactNotation` in both`AxisX.svelte` and `AxisY.svelte`, improving code readability andmaintainability.[[1]](diffhunk://#diff-63aa453fb923bd6f90586018b1310d90e17b66f9cb818352d8235c23482573f2R117-R127)[[2]](diffhunk://#diff-409da8ecf2c0213a5e18a5a3d62148f893868b6dcbc6433fc4cd2aff1d0e1e0fR115-R122)* Updated the tick label formatting function to use the new`useCompactNotation` store instead of recalculating the logic inline,ensuring consistent behavior and reducing code duplication.[[1]](diffhunk://#diff-63aa453fb923bd6f90586018b1310d90e17b66f9cb818352d8235c23482573f2L135-R147)[[2]](diffhunk://#diff-409da8ecf2c0213a5e18a5a3d62148f893868b6dcbc6433fc4cd2aff1d0e1e0fL133-R142)1 parentc8a5bf3 commit8386138
File tree
4 files changed
+126
-8
lines changed- src
- lib/marks
- tests
4 files changed
+126
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
117 | 133 | | |
118 | 134 | | |
119 | 135 | | |
| |||
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 151 | + | |
| 152 | + | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| |||
130 | 146 | | |
131 | 147 | | |
132 | 148 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 149 | + | |
| 150 | + | |
137 | 151 | | |
138 | 152 | | |
139 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
277 | 322 | | |
278 | 323 | | |
279 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
198 | 243 | | |
0 commit comments
Comments
(0)