How to use vega-time - 1 common examples

To help you get started, we’ve selected a few vega-time 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-transforms / src / TimeUnit.js View on Github external
prototype._floor = function(_, pulse) {
  const utc = _.timezone === 'utc';

  // get parameters
  let {units, step} = _.units
    ? {units: _.units, step: _.step || 1}
    : timeBin({
      extent:  extent(pulse.materialize(pulse.SOURCE).source, _.field),
      maxbins: _.maxbins
    });

  // check / standardize time units
  units = timeUnits(units);

  const prev = this.value || {},
        floor = (utc ? utcFloor : timeFloor)(units, step);

  floor.unit = peek(units);
  floor.units = units;
  floor.step = step;
  floor.start = prev.start;
  floor.stop = prev.stop;
  return this.value = floor;
};

vega-time

JavaScript date/time utilities for Vega.

BSD-3-Clause
Latest version published 5 months ago

Package Health Score

91 / 100
Full package analysis

Popular vega-time functions