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'),
template = dl.template,
expr = require('vega-expression'),
args = ['datum', 'parent', 'event', 'signals'];
var compile = expr.compiler(args, {
idWhiteList: args,
fieldVar: args[0],
globalVar: function(id) {
return 'this.sig[' + dl.str(id) + ']._value';
},
functions: function(codegen) {
var fn = expr.functions(codegen);
fn.eventItem = 'event.vg.getItem';
fn.eventGroup = 'event.vg.getGroup';
fn.eventX = 'event.vg.getX';
fn.eventY = 'event.vg.getY';
fn.open = 'window.open';
fn.scale = scaleGen(codegen, false);
fn.iscale = scaleGen(codegen, true);
fn.inrange = 'this.defs.inrange';
fn.indata = indataGen(codegen);