Skip to content

Commit

Permalink
Upgrade dependencies; remove Sizzle dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 24, 2013
1 parent 11a19ec commit 183060d
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 1,483 deletions.
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "d3",
"version": "3.0.4",
"version": "3.0.5",
"main": "./d3.js"
}
2 changes: 1 addition & 1 deletion d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
};
}
d3 = {
version: "3.0.4"
version: "3.0.5"
};
var π = Math.PI, ε = 1e-6, d3_radians = π / 180, d3_degrees = 180 / π;
function d3_target(d) {
Expand Down
2 changes: 1 addition & 1 deletion d3.min.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var document = global.document = require("jsdom").jsdom("<html><head></head><body></body></html>"),
window = global.window = document.createWindow(),
navigator = global.navigator = window.navigator,
getComputedStyle = global.getComputedStyle = window.getComputedStyle,
CSSStyleDeclaration = global.CSSStyleDeclaration = window.CSSStyleDeclaration;

// https://github.com/chad3814/CSSStyleDeclaration/issues/3
var CSSStyleDeclaration_setProperty = CSSStyleDeclaration.prototype.setProperty;
CSSStyleDeclaration.prototype.setProperty = function(name, value, priority) {
return CSSStyleDeclaration_setProperty.call(this, name + "", value == null ? null : value + "", priority == null ? null : priority + "");
};
21 changes: 7 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
var self = this,
globals = ["document", "window", "navigator", "CSSStyleDeclaration", "d3", "Sizzle"],
var globals = ["document", "window", "navigator", "CSSStyleDeclaration", "getComputedStyle", "d3"],
globalValues = {};

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

document = require("jsdom").jsdom("<html><head></head><body></body></html>");
window = document.createWindow();
navigator = window.navigator;
CSSStyleDeclaration = window.CSSStyleDeclaration;

Sizzle = require("sizzle");

require("./globals");
require("./d3");

module.exports = d3;

globals.forEach(function(global) {
if (global in globalValues) self[global] = globalValues[global];
else delete self[global];
globals.forEach(function(g) {
if (g in globalValues) global[g] = globalValues[g];
else delete global[g];
});
24 changes: 0 additions & 24 deletions lib/sizzle/LICENSE

This file was deleted.

0 comments on commit 183060d

Please sign in to comment.