Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var dl = require('datalib'),
log = require('vega-logging'),
Item = require('vega-scenegraph').Item,
df = require('vega-dataflow'),
Node = df.Node, // jshint ignore:line
Deps = df.Dependencies,
Tuple = df.Tuple,
ChangeSet = df.ChangeSet,
Sentinel = {},
Encoder = require('./Encoder'),
Bounder = require('./Bounder'),
parseData = require('../parse/data');
function Builder() {
return arguments.length ? this.init.apply(this, arguments) : this;
}
var Status = Builder.STATUS = {
ENTER: 'enter',
UPDATE: 'update',
EXIT: 'exit'
};
var dl = require('datalib'),
log = require('vega-logging'),
df = require('vega-dataflow'),
Node = df.Node, // jshint ignore:line
Deps = df.Dependencies,
bound = require('vega-scenegraph').bound;
var EMPTY = {};
function Encoder(graph, mark, builder) {
var props = mark.def.properties || {},
enter = props.enter,
update = props.update,
exit = props.exit;
Node.prototype.init.call(this, graph);
this._mark = mark;
this._builder = builder;
var s = this._scales = [];
var d3 = require('d3'),
dl = require('datalib'),
df = require('vega-dataflow'),
sg = require('vega-scenegraph').render,
log = require('vega-logging'),
Deps = df.Dependencies,
parseStreams = require('../parse/streams'),
Encoder = require('../scene/Encoder'),
Transition = require('../scene/Transition');
function View(el, width, height) {
this._el = null;
this._model = null;
this._width = this.__width = width || 500;
this._height = this.__height = height || 300;
this._bgcolor = null;
this._cursor = true; // Set cursor based on hover propset?
this._autopad = 1;
this._padding = {top:0, left:0, bottom:0, right:0};
this._viewport = null;
this._renderer = null;
this._handler = null;
var dl = require('datalib'),
Deps = require('vega-dataflow').Dependencies;
var arrayType = /array/i,
dataType = /data/i,
fieldType = /field/i,
exprType = /expr/i,
valType = /value/i;
function Parameter(name, type, transform) {
this._name = name;
this._type = type;
this._transform = transform;
// If parameter is defined w/signals, it must be resolved
// on every pulse.
this._value = [];
this._accessors = [];
var dl = require('datalib'),
df = require('vega-dataflow'),
Node = df.Node, // jshint ignore:line
Deps = df.Dependencies,
Tuple = df.Tuple,
Collector = df.Collector,
log = require('vega-logging'),
Builder = require('./Builder'),
Scale = require('./Scale'),
parseAxes = require('../parse/axes'),
parseLegends = require('../parse/legends');
function GroupBuilder() {
this._children = {};
this._scaler = null;
this._recursor = null;
this._scales = {};
this.scale = scale.bind(this);
return arguments.length ? this.init.apply(this, arguments) : this;
var dl = require('datalib'),
df = require('vega-dataflow'),
log = require('vega-logging'),
ChangeSet = df.ChangeSet,
Tuple = df.Tuple,
Deps = df.Dependencies,
Transform = require('./Transform'),
Facetor = require('./Facetor');
function Aggregate(graph) {
Transform.prototype.init.call(this, graph);
Transform.addParameters(this, {
groupby: {type: 'array'},
summarize: {
type: 'custom',
set: function(summarize) {
var signalDeps = {},
tx = this._transform,
i, len, f, fields, name, ops;
if (!dl.isArray(fields = summarize)) { // Object syntax from dl
var d3 = require('d3'),
dl = require('datalib'),
df = require('vega-dataflow'),
log = require('vega-logging'),
Node = df.Node, // jshint ignore:line
Deps = df.Dependencies,
Aggregate = require('../transforms/Aggregate');
var Properties = {
width: 1,
height: 1
};
var Types = {
LINEAR: 'linear',
ORDINAL: 'ordinal',
LOG: 'log',
POWER: 'pow',
SQRT: 'sqrt',
TIME: 'time',
TIME_UTC: 'utc',
QUANTILE: 'quantile',
var dl = require('datalib'),
log = require('vega-logging'),
df = require('vega-dataflow'),
Node = df.Node, // jshint ignore:line
Tuple = df.Tuple,
Deps = df.Dependencies;
var Types = {
INSERT: "insert",
REMOVE: "remove",
UPSERT: "upsert",
TOGGLE: "toggle",
CLEAR: "clear"
};
var EMPTY = [];
function filter(fields, value, src, dest) {
if ((fields = dl.array(fields)) && !fields.length) {
fields = dl.isObject(value) ? dl.keys(value) : ['data'];
}
var dl = require('datalib'),
expr = require('./expr'),
SIGNALS = require('vega-dataflow').Dependencies.SIGNALS;
var RESERVED = ['datum', 'event', 'signals', 'width', 'height', 'padding']
.concat(dl.keys(expr.codegen.functions));
function parseSignals(model, spec) {
// process each signal definition
(spec || []).forEach(function(s) {
if (RESERVED.indexOf(s.name) !== -1) {
throw Error('Signal name "'+s.name+'" is a '+
'reserved keyword ('+RESERVED.join(', ')+').');
}
var signal = model.signal(s.name, s.init)
.verbose(s.verbose);
if (s.init && s.init.expr) {
s.evaluate = function(input) {
if (!input.signals[selector.signal]) return model.doNotPropagate;
var val = exp.fn();
if (spec.scale) {
val = parseSignals.scale(model, spec, val);
}
if (val !== sig.value() || sig.verbose()) {
sig.value(val);
input.signals[n] = 1;
input.reflow = true;
}
return input;
};
s.dependency(df.Dependencies.SIGNALS, selector.signal);
s.addListener(sig);
model.signal(selector.signal).addListener(s);
}