https://github.com/d3/d3
Raw File
Tip revision: d3bad29fae4d383526f6be2f739fe6b4eb4ee592 authored by Mike Bostock on 19 April 2012, 01:30:22 UTC
Fix background events for d3.svg.brush.
Tip revision: d3bad29
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