How to use the vega-scale.timeInterval function in vega-scale

To help you get started, we’ve selected a few vega-scale examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vega / vega / packages / vega-encode / src / ticks.js View on Github external
export function tickCount(scale, count, minStep) {
  var step;

  if (isNumber(count) && minStep != null) {
    count = Math.min(count, ~~(span(scale.domain()) / minStep) || 1);
  }

  if (isObject(count)) {
    step = count.step;
    count = count.interval;
  }

  if (isString(count)) {
    count = timeInterval(count, scale.type)
          || error('Only time and utc scales accept interval strings.');
    if (step) count = count.every(step);
  }

  return count;
}