https://github.com/d3/d3
Raw File
Tip revision: 108d65da0eebd431425bf3aa51f0ed234d04975e authored by Mike Bostock on 31 July 2012, 21:59:49 UTC
Merge branch '2.9.7'
Tip revision: 108d65d
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.v2");

module.exports = d3;

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