forked from issa-tseng/d34raphael
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (17 loc) · 629 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (17 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var self = this,
globals = ["document", "window", "navigator", "CSSStyleDeclaration", "d3", "Sizzle"],
globalValues = {};
globals.forEach(function(global) {
if (global in self) globalValues[global] = self[global];
});
document = require("jsdom").jsdom("<html><head></head><body></body></html>");
window = document.createWindow();
navigator = window.navigator;
CSSStyleDeclaration = window.CSSStyleDeclaration;
Sizzle = require("sizzle");
require("./d3.v2");
module.exports = d3;
globals.forEach(function(global) {
if (global in globalValues) self[global] = globalValues[global];
else delete self[global];
});