Socket
Socket
Sign inDemoInstall

vega

Package Overview
Dependencies
Maintainers
1
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega - npm Package Compare versions

Comparing version 1.5.0 to 1.5.3

.jshintignore

1

bower.json
{
"name": "vega",
"version": "1.5.0",
"main": "vega.js",

@@ -5,0 +4,0 @@ "scripts": [

{
"name": "vega",
"version": "1.5.0",
"version": "1.5.3",
"description": "Vega Runtime",

@@ -35,8 +35,10 @@ "keywords": [

"d3-geo-projection": "^0.2.13",
"d3.layout.cloud": "^1.0.5",
"canvas": "~1.1.6",
"topojson": "^1.6.18",
"yargs": "^2.3.0",
"request": "2.53.0"
"request": "^2.55.0"
},
"devDependencies": {
"jshint": "^2.7.0",
"uglify-js": "^2.4.16",

@@ -43,0 +45,0 @@ "vows": "^0.8.1"

@@ -12,2 +12,8 @@ vg.config = {};

// Allows additional headers to be sent to the server
// when requesting data. This could be useful when
// the graph definition is not trusted, and the server
// needs to be notified of that, e.g. {'Treat-as-Untrusted': 1}
vg.config.dataHeaders = false;
// If true, disable potentially unsafe transforms (filter, formula)

@@ -14,0 +20,0 @@ // involving possible JavaScript injection attacks.

@@ -43,3 +43,3 @@ // type checking functions

vg.date = function(s) {return s === null ? null : Date.parse(s); }
vg.date = function(s) {return s === null ? null : Date.parse(s); };

@@ -140,3 +140,3 @@ // ES6 compatibility per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill

return NaN;
}
};

@@ -143,0 +143,0 @@ vg.numcmp = function(a, b) { return a - b; };

@@ -337,3 +337,3 @@ vg.canvas.marks = (function() {

drawPathAll(pathFunc, g, scene, bounds);
}
};
}

@@ -347,3 +347,3 @@

drawPathOne(pathFunc, g, scene.items[0], scene.items);
}
};
}

@@ -350,0 +350,0 @@

@@ -24,5 +24,5 @@ // Define module using Universal Module Definition pattern

var vg = {
version: "1.5.0", // semantic versioning
version: "1.5.1", // semantic versioning
d3: d3, // stash d3 for use in property functions
topojson: topojson // stash topojson similarly
};

@@ -70,3 +70,3 @@ vg.Bounds = (function() {

.add(cos*x2 - sin*y2 + cx, sin*x2 + cos*y2 + cy);
}
};

@@ -73,0 +73,0 @@ prototype.union = function(b) {

@@ -11,3 +11,3 @@ vg.Gradient = (function() {

this.y2 = 0;
};
}

@@ -27,2 +27,2 @@ var prototype = gradient.prototype;

var vg_gradient_id = 0;
var vg_gradient_id = 0;

@@ -62,3 +62,3 @@ vg.data = {};

return data;
}
};
};

@@ -65,0 +65,0 @@

@@ -85,3 +85,3 @@ vg.data.aggregate = (function() {

if (ops[i] === 'count') {
o["count"] = this.count;
o.count = this.count;
} else {

@@ -88,0 +88,0 @@ o[ops[i] + "_" + this.field] = this.value(ops[i]);

@@ -6,5 +6,5 @@ vg.data.bin = function() {

setter,
min = undefined,
max = undefined,
step = undefined,
min,
max,
step,
maxbins = 20,

@@ -11,0 +11,0 @@ output = "bin";

@@ -8,3 +8,3 @@ vg.data.flatten = function() {

function flat(data, list) {
if (data.values) {
if (vg.isArray(data.values)) {
for (var i=0, n=data.values.length; i<n; ++i) {

@@ -11,0 +11,0 @@ flat(data.values[i], list);

@@ -77,3 +77,3 @@ vg.data.force = function() {

return force;
}
};
});

@@ -80,0 +80,0 @@

@@ -50,3 +50,3 @@ vg.data.geo = (function() {

return map;
}
};
});

@@ -75,6 +75,6 @@

return map;
};
}
geo.params = params;
return geo;
})();
})();

@@ -30,3 +30,3 @@ vg.data.geopath = function() {

return map;
}
};
});

@@ -33,0 +33,0 @@

@@ -86,3 +86,9 @@ vg.data.load = (function() {

vg.log('LOAD XHR: ' + url);
d3.xhr(url, function(err, resp) {
var xhrReq = d3.xhr(url);
if (vg.config.dataHeaders) {
vg.keys(vg.config.dataHeaders).forEach(function(k) {
xhrReq.header(k, vg.config.dataHeaders[k]);
});
}
xhrReq.get(function(err, resp) {
if (resp) resp = resp.responseText;

@@ -100,3 +106,7 @@ callback(err, resp);

vg.log('LOAD HTTP: ' + url);
var req = require('request')(url, function(error, response, body) {
var options = {url: url, encoding: null, gzip: true};
if (vg.config.dataHeaders) {
options.headers = vg.config.dataHeaders;
}
require('request').get(options, function(error, response, body) {
if (!error && response.statusCode === 200) {

@@ -103,0 +113,0 @@ callback(null, body);

@@ -13,5 +13,5 @@ vg.data.stack = function() {

function stack(data) {
var out_y0 = output["y0"],
out_y1 = output["y1"],
out_cy = output["cy"];
var out_y0 = output.y0,
out_y1 = output.y1,
out_cy = output.cy;

@@ -82,3 +82,3 @@ var series = stacks(data);

return stack;
}
};
});

@@ -85,0 +85,0 @@

@@ -51,3 +51,3 @@ vg.data.treemap = function() {

return treemap;
}
};
});

@@ -54,0 +54,0 @@

@@ -91,3 +91,3 @@ vg.data.wordcloud = function() {

return cloud;
}
};
});

@@ -94,0 +94,0 @@

@@ -5,3 +5,3 @@ vg.data.zip = function() {

key = vg.accessor("data"),
defaultValue = undefined,
defaultValue,
withKey = null;

@@ -8,0 +8,0 @@

@@ -99,8 +99,16 @@ var vg_expression_functions = function(codegen) {

// shared sequence functions
"length": function(args) {
return fncall("length", args, null, -1);
},
"indexof": function(args) {
return fncall("indexOf", args, null);
},
"lastindexof": function(args) {
return fncall("lastIndexOf", args, null);
},
// STRING functions
"parseFloat": "parseFloat",
"parseInt": "parseInt",
"length": function(args) {
return fncall("length", args, null, -1);
},
"upper": function(args) {

@@ -107,0 +115,0 @@ return fncall("toUpperCase", args, STRING, 0);

@@ -45,3 +45,3 @@ vg.headless.svg = (function() {

if (bgcolor != null) {
headAttr.style = 'background-color:' + bgcolor + ';'
headAttr.style = 'background-color:' + bgcolor + ';';
}

@@ -394,3 +394,3 @@

}
s += name + ':' + value + ';'
s += name + ':' + value + ';';
}

@@ -397,0 +397,0 @@ }

@@ -203,3 +203,3 @@ vg.headless.View = (function() {

this._renderer.initialize(this._el, tw, th, pad, bg);
}
};

@@ -206,0 +206,0 @@ prototype.render = function(items) {

@@ -16,3 +16,3 @@ vg.parse.axes = (function() {

});
};
}

@@ -19,0 +19,0 @@ function axis(def, index, axis, scales) {

@@ -18,6 +18,10 @@ vg.parse.data = function(spec, callback) {

} else {
model.load[d.name] = vg.data.read(data.toString(), d.format);
try {
model.load[d.name] = vg.data.read(data.toString(), d.format);
} catch (err) {
vg.error("UNABLE TO PARSE: " + d.url + ' ' + err.toString());
}
}
if (--count === 0) callback();
}
};
}

@@ -24,0 +28,0 @@

@@ -8,3 +8,3 @@ vg.parse.legends = (function() {

});
};
}

@@ -43,2 +43,2 @@ function legend(def, index, legend, scales) {

return legends;
})();
})();

@@ -7,3 +7,3 @@ vg.parse.properties = (function() {

code += "var o = trans ? {} : item;\n"
code += "var o = trans ? {} : item;\n";

@@ -25,3 +25,3 @@ for (i=0, len=names.length; i<len; ++i) {

} else {
code += "\n o.x = o.x2;"
code += "\n o.x = o.x2;";
}

@@ -33,3 +33,3 @@ }

} else {
code += "\n o.x = o.xc;"
code += "\n o.x = o.xc;";
}

@@ -46,3 +46,3 @@ }

} else {
code += "\n o.y = o.y2;"
code += "\n o.y = o.y2;";
}

@@ -54,3 +54,3 @@ }

} else {
code += "\n o.y = o.yc;"
code += "\n o.y = o.yc;";
}

@@ -57,0 +57,0 @@ }

@@ -62,5 +62,11 @@ vg.parse.scales = (function() {

len = domain.length,
start = rng[0] || 0,
space = def.points ? (pad*bw) : (pad*bw*(len-1) + 2*outer);
rng = [start, start + (bw * len + space)];
space = def.points ? (pad*bw) : (pad*bw*(len-1) + 2*outer),
start;
if (rng[0] > rng[1]) {
start = rng[1] || 0;
rng = [start + (bw * len + space), start];
} else {
start = rng[0] || 0;
rng = [start, start + (bw * len + space)];
}
}

@@ -217,3 +223,5 @@

}
if (rev) rng = rng.reverse();
if (rev) {
rng = rng.reverse();
}
}

@@ -220,0 +228,0 @@

@@ -128,3 +128,3 @@ vg.parse.template = function(text) {

return source;
}
};

@@ -131,0 +131,0 @@ var vg_template_re = /\{\{(.+?)\}\}|$/g;

@@ -8,3 +8,3 @@ vg.scene = {};

vg.scene.DEFAULT_DATA = {"sentinel":1}
vg.scene.DEFAULT_DATA = {"sentinel":1};

@@ -11,0 +11,0 @@ vg.scene.data = function(data, parentData) {

@@ -24,3 +24,3 @@ vg.scene.build = (function() {

return node;
};
}

@@ -31,3 +31,3 @@ function buildNode(def, node) {

node.marktype = def.type;
node.interactive = !(def.interactive === false);
node.interactive = (def.interactive !== false);
return node;

@@ -97,3 +97,3 @@ }

if (def.duration) node.duration = def.duration;
if (def.ease) node.ease = d3.ease(def.ease)
if (def.ease) node.ease = d3.ease(def.ease);
if (def.delay) {

@@ -114,6 +114,6 @@ var items = node.items, group = node.group, n = items.length, i;

return s;
}
};
}
return build;
})();
})();

@@ -10,3 +10,3 @@ vg.scene.legend = function() {

formatString = null,
title = undefined,
title,
orient = "right",

@@ -360,3 +360,3 @@ offset = vg.config.legend.offset,

break;
};
}
case "right": {

@@ -369,3 +369,3 @@ gx = group.width;

break;
};
}
}

@@ -372,0 +372,0 @@

@@ -90,3 +90,3 @@ vg.scene.Transition = (function() {

return stop;
};
}

@@ -99,2 +99,2 @@ return trans;

return new vg.scene.Transition(dur, ease);
};
};

@@ -127,3 +127,3 @@ vg.svg.Renderer = (function() {

}
}
};

@@ -130,0 +130,0 @@ prototype.draw = function(ctx, scene, index) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc