Skip to content

Commit 5c4282f

Browse files
committed
Don't import index; move ns to core.
1 parent fd5ee5d commit 5c4282f

16 files changed

Lines changed: 52 additions & 50 deletions

File tree

d3.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -540,27 +540,6 @@ d3 = function() {
540540
return point;
541541
}) : [];
542542
};
543-
var d3_nsPrefix = {
544-
svg: "http://www.w3.org/2000/svg",
545-
xhtml: "http://www.w3.org/1999/xhtml",
546-
xlink: "http://www.w3.org/1999/xlink",
547-
xml: "http://www.w3.org/XML/1998/namespace",
548-
xmlns: "http://www.w3.org/2000/xmlns/"
549-
};
550-
d3.ns = {
551-
prefix: d3_nsPrefix,
552-
qualify: function(name) {
553-
var i = name.indexOf(":"), prefix = name;
554-
if (i >= 0) {
555-
prefix = name.substring(0, i);
556-
name = name.substring(i + 1);
557-
}
558-
return d3_nsPrefix.hasOwnProperty(prefix) ? {
559-
space: d3_nsPrefix[prefix],
560-
local: name
561-
} : name;
562-
}
563-
};
564543
function d3_selection(groups) {
565544
d3_arraySubclass(groups, d3_selectionPrototype);
566545
return groups;
@@ -626,6 +605,27 @@ d3 = function() {
626605
return d3_selectAll(selector, this);
627606
};
628607
}
608+
var d3_nsPrefix = {
609+
svg: "http://www.w3.org/2000/svg",
610+
xhtml: "http://www.w3.org/1999/xhtml",
611+
xlink: "http://www.w3.org/1999/xlink",
612+
xml: "http://www.w3.org/XML/1998/namespace",
613+
xmlns: "http://www.w3.org/2000/xmlns/"
614+
};
615+
d3.ns = {
616+
prefix: d3_nsPrefix,
617+
qualify: function(name) {
618+
var i = name.indexOf(":"), prefix = name;
619+
if (i >= 0) {
620+
prefix = name.substring(0, i);
621+
name = name.substring(i + 1);
622+
}
623+
return d3_nsPrefix.hasOwnProperty(prefix) ? {
624+
space: d3_nsPrefix[prefix],
625+
local: name
626+
} : name;
627+
}
628+
};
629629
d3_selectionPrototype.attr = function(name, value) {
630630
if (arguments.length < 2) {
631631
if (typeof name === "string") {
@@ -6910,18 +6910,6 @@ d3 = function() {
69106910
});
69116911
d3.svg.symbolTypes = d3_svg_symbols.keys();
69126912
var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
6913-
d3_selectionPrototype.transition = function() {
6914-
var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = Object.create(d3_transitionInherit);
6915-
transition.time = Date.now();
6916-
for (var j = -1, m = this.length; ++j < m; ) {
6917-
subgroups.push(subgroup = []);
6918-
for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
6919-
if (node = group[i]) d3_transitionNode(node, i, id, transition);
6920-
subgroup.push(node);
6921-
}
6922-
}
6923-
return d3_transition(subgroups, id);
6924-
};
69256913
function d3_transition(groups, id) {
69266914
d3_arraySubclass(groups, d3_transitionPrototype);
69276915
groups.id = id;
@@ -8209,6 +8197,18 @@ d3 = function() {
82098197
d3.time.scale.utc = function() {
82108198
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
82118199
};
8200+
d3_selectionPrototype.transition = function() {
8201+
var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = Object.create(d3_transitionInherit);
8202+
transition.time = Date.now();
8203+
for (var j = -1, m = this.length; ++j < m; ) {
8204+
subgroups.push(subgroup = []);
8205+
for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
8206+
if (node = group[i]) d3_transitionNode(node, i, id, transition);
8207+
subgroup.push(node);
8208+
}
8209+
}
8210+
return d3_transition(subgroups, id);
8211+
};
82128212
d3.xhr = function(url, mimeType, callback) {
82138213
var xhr = {}, dispatch = d3.dispatch("progress", "load", "error"), headers = {}, response = d3_identity, request = new (d3_window.XDomainRequest && /^(http(s)?:)?\/\//.test(url) ? XDomainRequest : XMLHttpRequest)();
82148214
"onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {

d3.min.js

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

src/behavior/zoom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "../core/rebind";
33
import "../event/event";
44
import "../event/mouse";
55
import "../event/touches";
6-
import "../selection/";
6+
import "../selection/selection";
77

88
d3.behavior.zoom = function() {
99
var translate = [0, 0],

src/core/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import "functor";
2+
import "ns";
23
import "rebind";
File renamed without changes.

src/math/transform.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "../core/document";
2+
import "../core/ns";
23

34
d3.transform = function(string) {
45
var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");

src/selection/append.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "../core/document";
2-
import "ns";
2+
import "../core/ns";
33
import "selection";
44

55
// TODO append(node)?

src/selection/attr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "ns";
1+
import "../core/ns";
22
import "selection";
33

44
d3_selectionPrototype.attr = function(name, value) {

src/selection/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
import "ns";
21
import "selection";

src/selection/insert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "../core/document";
2-
import "ns";
2+
import "../core/ns";
33
import "selection";
44

55
d3_selectionPrototype.insert = function(name, before) {

0 commit comments

Comments
 (0)