Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}.`);
}
import {extendParams, removeParams} from './util';
import transform from '../transform';
import {window} from 'vega-transforms';
import {extend} from 'vega-util';
const def = extend({}, window.Definition);
def.params = removeParams(def.params, ['ops', 'fields', 'as', 'params']);
def.params = extendParams(def.params, {
sort: { alias: 'compare' }
});
def.params.push({name: 'measure', type: 'window', proxy: true});
export default transform(def, ['compare', 'frame', 'measure']);
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}.`);