https://github.com/d3/d3
Raw File
Tip revision: baf78553069cffa6b7925a5781872024fe5d1eac authored by Mike Bostock on 11 January 2013, 00:42:56 UTC
Merge branch '3.0.3'
Tip revision: baf7855
index.js
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");

module.exports = d3;

globals.forEach(function(global) {
  if (global in globalValues) self[global] = globalValues[global];
  else delete self[global];
});
back to top