Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
var sg = require('vega-scenegraph').render,
canvas = sg.canvas,
svg = sg.svg.string,
View = require('./View');
function HeadlessView(width, height, model) {
View.call(this, width, height, model);
this._type = 'canvas';
this._renderers = {canvas: canvas, svg: svg};
}
var prototype = (HeadlessView.prototype = new View());
prototype.renderer = function(type) {
if(type) this._type = type;
return View.prototype.renderer.apply(this, arguments);
};