How to use the vega-transforms.aggregate.Definition function in vega-transforms

To help you get started, we’ve selected a few vega-transforms 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 / dataflow-api / src / parameters.js View on Github external
import {aggregate, window} from 'vega-transforms';
import {
  accessor, array, compare, error, field,
  isArray, isObject, isFunction, isRegExp, isString,
  toBoolean, toNumber, toSet, toString
} from 'vega-util';

const Ascending = 'ascending',
      Descending = 'descending',
      AggregateOps = toSet(aggregate.Definition.params[1].values),
      WindowOps = toSet(window.Definition.params[2].values);

export function parser(p) {
  const type = p.array ? 'array' : p.type;
  return TypeParsers[type](p);
}

export const TypeParsers = {
  array: p => {
    const len = p.length,
          name = p.name,
          type = TypeParsers[p.type];

    return value => {
      if (!isArray(value)) {
        error(`Expected array parameter: ${name}.`);

vega-transforms

Data processing transforms for Vega dataflows.

BSD-3-Clause
Latest version published 6 months ago

Package Health Score

88 / 100
Full package analysis