| 15980 | } |
| 15981 | |
| 15982 | function tickInterval(start, stop, count) { |
| 15983 | const target = Math.abs(stop - start) / count; |
| 15984 | const i = bisector(([,, step]) => step).right(tickIntervals, target); |
| 15985 | if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count)); |
| 15986 | if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1)); |
| 15987 | const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; |
| 15988 | return t.every(step); |
| 15989 | } |
| 15990 | |
| 15991 | return [ticks, tickInterval]; |
| 15992 | } |