MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / skip

Function skip

static/plugins/chart.js/Chart.bundle.js:11399–11428  ·  view source on GitHub ↗
(ticks, spacing, majorStart, majorEnd)

Source from the content-addressed store, hash-verified

11397}
11398
11399function skip(ticks, spacing, majorStart, majorEnd) {
11400 var start = valueOrDefault$a(majorStart, 0);
11401 var end = Math.min(valueOrDefault$a(majorEnd, ticks.length), ticks.length);
11402 var count = 0;
11403 var length, i, tick, next;
11404
11405 spacing = Math.ceil(spacing);
11406 if (majorEnd) {
11407 length = majorEnd - majorStart;
11408 spacing = length / Math.floor(length / spacing);
11409 }
11410
11411 next = start;
11412
11413 while (next < 0) {
11414 count++;
11415 next = Math.round(start + count * spacing);
11416 }
11417
11418 for (i = Math.max(start, 0); i < end; i++) {
11419 tick = ticks[i];
11420 if (i === next) {
11421 tick._index = i;
11422 count++;
11423 next = Math.round(start + count * spacing);
11424 } else {
11425 delete tick.label;
11426 }
11427 }
11428}
11429
11430var Scale = core_element.extend({
11431

Callers 1

Chart.bundle.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected