MCPcopy Create free account
hub / github.com/breck7/scroll / tickInterval

Function tickInterval

external/.d3.js:15982–15989  ·  view source on GitHub ↗
(start, stop, count)

Source from the content-addressed store, hash-verified

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}

Callers 2

ticksFunction · 0.85
calendarFunction · 0.85

Calls 4

bisectorFunction · 0.85
tickStepFunction · 0.85
maxMethod · 0.80
everyMethod · 0.45

Tested by

no test coverage detected