(cb: () => boolean)
| 191 | let minNice: number; |
| 192 | |
| 193 | function loopIncreaseInterval(cb: () => boolean) { |
| 194 | // Typically this loop runs less than 5 times. But we still |
| 195 | // use a fail-safe for future changes. |
| 196 | const LOOP_MAX = 50; |
| 197 | let loopGuard = 0; |
| 198 | for (; loopGuard < LOOP_MAX; loopGuard++) { |
| 199 | if (cb()) { |
| 200 | break; |
| 201 | } |
| 202 | interval = isTargetLogScale |
| 203 | // TODO: `mathMax(base, 2)` is a guardcode to avoid infinite loop, |
| 204 | // but probably it should be guranteed by `LogScale` itself. |
| 205 | ? interval * mathMax(targetLogScaleBase, 2) |
| 206 | : increaseInterval(interval); |
| 207 | intervalPrecision = getIntervalPrecision(interval); |
| 208 | } |
| 209 | if (__DEV__) { |
| 210 | if (loopGuard >= LOOP_MAX) { |
| 211 | warn('incorrect impl in `scaleCalcAlign`.'); |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | function updateMinFromMinNice() { |
| 217 | min = round(minNice - interval * t0, intervalPrecision); |
no test coverage detected
searching dependent graphs…