Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Scene.defaultProperties = function(props) {
// Note that scene has no "properties" property
return dl.extend({
// Containers for child marks
scales: [],
legends: [],
axes: [],
marks: [],
// type will be removed later on, but is used to generate an appropriate name
type: 'scene',
// Scene has no Vega properties object, but we mock it for now to avoid
// distrupting the export functionality
properties: {
update: {}
},
// Scene-specific visual properties
width: 610,
height: 610,
padding: 'auto',
Group.defaultProperties = function(props) {
return dl.extend({
type: 'group',
// name: 'group' + '_' + counter.type('group'); // Assign name in the reducer
// _id: assign ID in the reducer
properties: Mark.mergeProperties(Mark.defaultProperties(), {
update: {
x: {value: 0},
y: {value: 0},
width: {signal: ns('vis_width')},
height: {signal: ns('vis_height')},
fill: {value: 'transparent'}
}
}),
// Containers for child marks
scales: [],
legends: [],
axes: [],
Area.defaultProperties = function(props) {
return dl.extend({
type: 'area',
// name: 'area' + '_' + counter.type('area'); // Assign name in the reducer
// _id: assign ID in the reducer
properties: Mark.mergeProperties(Mark.defaultProperties(), {
update: {
x2: {value: 0},
y2: {value: 0},
xc: {value: 60, _disabled: true},
yc: {value: 60, _disabled: true},
tension: {value: 13},
interpolate: {value: 'monotone'},
fill: {value: '#55498D'},
stroke: {value: '#55498D'},
orient: {value: 'vertical'},
width: {value: 30, _disabled: true},
height: {value: 30, _disabled: true}
Line.defaultProperties = function(props) {
var defaults = {
type: 'line',
// name: 'line' + '_' + counter.type('line'); // Assign name in the reducer
// _id: assign ID in the reducer
properties: Mark.mergeProperties(Mark.defaultProperties(), {
update: {
stroke: {value: '#000000'},
strokeWidth: {value: 3}
}
})
};
// Mark gives us two defaults we do not want
delete defaults.properties.update.fill;
delete defaults.properties.update.fillOpacity;
return dl.extend(defaults, props);
};
}
if (hasPath(mark, vars)) code += "\n d += (item.touch(), 1);";
code += "\n if (trans) trans.interpolate(item, o);";
code += "\n return d > 0;";
try {
/* jshint evil:true */
var encoder = Function('item', 'group', 'trans', 'db',
'signals', 'predicates', code);
encoder.tpl = Tuple;
encoder.exprs = exprs;
encoder.util = dl;
encoder.d3 = d3; // For color spaces
dl.extend(encoder, dl.template.context);
return {
encode: encoder,
signals: dl.keys(deps.signals),
scales: dl.keys(deps.scales),
data: dl.keys(deps.data),
fields: dl.keys(deps.fields),
nested: deps.nested,
reflow: deps.reflow
};
} catch (e) {
log.error(e);
log.log(code);
}
}
function addGuide(guideProps) {
var props = dl.extend({
_id: guideProps._id || counter.global(),
}, guideProps);
return {
id: props._id,
type: ADD_GUIDE,
props: props
};
}
function hoverCell(t, f, parent) {
var rule = [{
test: sg.CELL + '.key === ' + (parent ? 'parent.key' : 'datum.key')
}];
dl.extend(rule[0], t);
rule.push(f);
return {rule: rule};
}
input.mod.forEach(function(x) {
if (x[fieldName] === datum[fieldName]) {
dl.extend(x, datum);
++up;
}
});
prototype.config = function(cfg) {
if (!arguments.length) return this._config;
this._config = Object.create(config);
for (var name in cfg) {
var x = cfg[name], y = this._config[name];
if (dl.isObject(x) && dl.isObject(y)) {
dl.extend(y, x);
} else {
this._config[name] = x;
}
}
return this;
};
prototype.config = function(cfg) {
if (!arguments.length) return this._config;
this._config = Object.create(config);
for (var name in cfg) {
var x = cfg[name], y = this._config[name];
if (dl.isObject(x) && dl.isObject(y)) {
dl.extend(y, x);
} else {
this._config[name] = x;
}
}
return this;
};