Comparing version 1.5.0 to 1.5.3
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
812610
95
20041
7
3
+ Addedd3.layout.cloud@^1.0.5
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedd3-dispatch@0.2.6(transitive)
+ Addedd3.layout.cloud@1.2.0(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.2(transitive)
- Removedaws-sign2@0.5.0(transitive)
- Removedbl@0.9.5(transitive)
- Removedboom@2.10.1(transitive)
- Removedcaseless@0.9.0(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcryptiles@2.0.5(transitive)
- Removedctype@0.5.3(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedforever-agent@0.5.2(transitive)
- Removedform-data@0.2.0(transitive)
- Removedhawk@2.3.1(transitive)
- Removedhoek@2.16.3(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removedisarray@0.0.1(transitive)
- Removedmime-db@1.12.0(transitive)
- Removedmime-types@2.0.14(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedoauth-sign@0.6.0(transitive)
- Removedqs@2.3.3(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedrequest@2.53.0(transitive)
- Removedsntp@1.0.9(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstringstream@0.0.6(transitive)
- Removedtldts@6.1.48(transitive)
- Removedtldts-core@6.1.48(transitive)
- Removedtough-cookie@5.0.0(transitive)
- Removedtunnel-agent@0.4.3(transitive)
Updatedrequest@^2.55.0