https://github.com/d3/d3
Raw File
Tip revision: af2af6ac9080529d102aacfa57807371fd983d2b authored by Mike Bostock on 02 March 2012, 00:30:25 UTC
Merge branch 'release'
Tip revision: af2af6a
index.js
var self = this,
    globals = ["document", "window", "navigator", "CSSStyleDeclaration", "d3"],
    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;

require("./d3.v2");

module.exports = d3;

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