Permalink
Browse files

Capture d3, as well.

This allows multiple instances of D3 to be loaded, or the d3 variable to be
renamed without breaking code. Fixes #1058.
  • Loading branch information...
1 parent 0991f3b commit 46a586d4eefbf26c8dc4f19ca3c18805442e4dbf @mbostock mbostock committed Feb 6, 2013
Showing with 12 additions and 13 deletions.
  1. +5 −5 d3.js
  2. +4 −4 d3.min.js
  3. +1 −2 src/core/core.js
  4. +1 −1 src/end.js
  5. +1 −1 src/start.js
View
10 d3.js
@@ -1,8 +1,7 @@
-(function() {
- d3 = {
+d3 = function() {
+ var π = Math.PI, ε = 1e-6, d3 = {
version: "3.0.5"
- };
- var π = Math.PI, ε = 1e-6, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window;
+ }, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window;
function d3_target(d) {
return d.target;
}
@@ -7803,4 +7802,5 @@
d3.time.scale.utc = function() {
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
};
-})();
+ return d3;
+}();
View
Oops, something went wrong.
View
@@ -1,7 +1,6 @@
-d3 = {version: "3.0.5"}; // semver
-
var π = Math.PI,
ε = 1e-6,
+ d3 = {version: "3.0.5"}, // semver
d3_radians = π / 180,
d3_degrees = 180 / π,
d3_document = document,
View
@@ -1 +1 @@
-})();
+return d3;})();
View
@@ -1 +1 @@
-(function(){
+d3 = (function(){

0 comments on commit 46a586d

Please sign in to comment.