Skip to content

Commit 46a586d

Browse files
committed
Capture d3, as well.
This allows multiple instances of D3 to be loaded, or the d3 variable to be renamed without breaking code. Fixes d3#1058.
1 parent 0991f3b commit 46a586d

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

d3.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
(function() {
2-
d3 = {
1+
d3 = function() {
2+
var π = Math.PI, ε = 1e-6, d3 = {
33
version: "3.0.5"
4-
};
5-
var π = Math.PI, ε = 1e-6, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window;
4+
}, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window;
65
function d3_target(d) {
76
return d.target;
87
}
@@ -7803,4 +7802,5 @@
78037802
d3.time.scale.utc = function() {
78047803
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
78057804
};
7806-
})();
7805+
return d3;
7806+
}();

d3.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/core.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
d3 = {version: "3.0.5"}; // semver
2-
31
var π = Math.PI,
42
ε = 1e-6,
3+
d3 = {version: "3.0.5"}, // semver
54
d3_radians = π / 180,
65
d3_degrees = 180 / π,
76
d3_document = document,

src/end.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
})();
1+
return d3;})();

src/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(function(){
1+
d3 = (function(){

0 commit comments

Comments
 (0)