Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 46a586d4eefbf26c8dc4f19ca3c18805442e4dbf 1 parent 0991f3b
@mbostock authored
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
8 d3.min.js
4 additions, 4 deletions not shown
View
3  src/core/core.js
@@ -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
2  src/end.js
@@ -1 +1 @@
-})();
+return d3;})();
View
2  src/start.js
@@ -1 +1 @@
-(function(){
+d3 = (function(){
Please sign in to comment.
Something went wrong with that request. Please try again.