Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel committed Apr 6, 2013
2 parents b827645 + 61789da commit 26e153d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
examples/
test/
.DS_Store
2 changes: 1 addition & 1 deletion examples/vega/lifelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "people",
"values": [
{"label":"Washington", "born":-7506057600000, "died":-5365324800000,
{"label":"Washington", "born":-7506057600000, "died":-5366196000000,
"enter":-5701424400000, "leave":-5453884800000},
{"label":"Adams", "born":-7389766800000, "died":-4528285200000,
"enter":-5453884800000, "leave":-5327740800000},
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var globals = ["vg"],
// cache pre-existing global values
var globals = ["vg", "d3"],
globalValues = {};

globals.forEach(function(g) {
if (g in global) globalValues[g] = global[g];
});

// Namespace pollution!
// ensure availability of d3 in global namespace
// NOTE: will "pollute" namespace with jsdom window, etc
d3 = require("d3");

// load and export vega
require("./vega");
module.exports = vg;

// restore pre-existing global values
globals.forEach(function(g) {
if (g in globalValues) global[g] = globalValues[g];
else delete global[g];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vega",
"version": "1.1.0",
"version": "1.1.1",
"description": "Vega Runtime",
"keywords": [
"vega",
Expand Down
2 changes: 1 addition & 1 deletion src/_package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var vg = {};

// semantic versioning
vg.version = '1.1.0';
vg.version = '1.1.1';

// type checking functions
var toString = Object.prototype.toString;
Expand Down
2 changes: 1 addition & 1 deletion src/core/_end.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
return vg;
})();
})(d3); // assumes availability of D3 in global namespace
2 changes: 1 addition & 1 deletion src/core/_start.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vg = (function(){
vg = (function(d3){ // take d3 instance as sole import
6 changes: 3 additions & 3 deletions vega.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vg = (function(){
vg = (function(d3){ // take d3 instance as sole import
var vg = {};

// semantic versioning
vg.version = '1.1.0';
vg.version = '1.1.1';

// type checking functions
var toString = Object.prototype.toString;
Expand Down Expand Up @@ -4141,4 +4141,4 @@ vg.spec = function(s) {
return new vg.Spec(s);
};
return vg;
})();
})(d3); // assumes availability of D3 in global namespace
4 changes: 2 additions & 2 deletions vega.min.js

Large diffs are not rendered by default.

0 comments on commit 26e153d

Please sign in to comment.