Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MUR Drupal
d3-library
Commits
5c4282f5
Commit
5c4282f5
authored
Mar 13, 2013
by
Mike Bostock
Browse files
Don't import index; move ns to core.
parent
fd5ee5de
Changes
16
Hide whitespace changes
Inline
Side-by-side
d3.js
View file @
5c4282f5
...
...
@@ -540,27 +540,6 @@ d3 = function() {
return
point
;
})
:
[];
};
var d3_nsPrefix = {
svg: "http://www.w3.org/2000/svg",
xhtml: "http://www.w3.org/1999/xhtml",
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
d3.ns = {
prefix: d3_nsPrefix,
qualify: function(name) {
var i = name.indexOf(":"), prefix = name;
if (i >= 0) {
prefix = name.substring(0, i);
name = name.substring(i + 1);
}
return d3_nsPrefix.hasOwnProperty(prefix) ? {
space: d3_nsPrefix[prefix],
local: name
} : name;
}
};
function
d3_selection
(
groups
)
{
d3_arraySubclass
(
groups
,
d3_selectionPrototype
);
return
groups
;
...
...
@@ -626,6 +605,27 @@ d3 = function() {
return
d3_selectAll
(
selector
,
this
);
};
}
var
d3_nsPrefix
=
{
svg
:
"
http://www.w3.org/2000/svg
"
,
xhtml
:
"
http://www.w3.org/1999/xhtml
"
,
xlink
:
"
http://www.w3.org/1999/xlink
"
,
xml
:
"
http://www.w3.org/XML/1998/namespace
"
,
xmlns
:
"
http://www.w3.org/2000/xmlns/
"
};
d3
.
ns
=
{
prefix
:
d3_nsPrefix
,
qualify
:
function
(
name
)
{
var
i
=
name
.
indexOf
(
"
:
"
),
prefix
=
name
;
if
(
i
>=
0
)
{
prefix
=
name
.
substring
(
0
,
i
);
name
=
name
.
substring
(
i
+
1
);
}
return
d3_nsPrefix
.
hasOwnProperty
(
prefix
)
?
{
space
:
d3_nsPrefix
[
prefix
],
local
:
name
}
:
name
;
}
};
d3_selectionPrototype
.
attr
=
function
(
name
,
value
)
{
if
(
arguments
.
length
<
2
)
{
if
(
typeof
name
===
"
string
"
)
{
...
...
@@ -6910,18 +6910,6 @@ d3 = function() {
});
d3
.
svg
.
symbolTypes
=
d3_svg_symbols
.
keys
();
var
d3_svg_symbolSqrt3
=
Math
.
sqrt
(
3
),
d3_svg_symbolTan30
=
Math
.
tan
(
30
*
d3_radians
);
d3_selectionPrototype.transition = function() {
var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = Object.create(d3_transitionInherit);
transition.time = Date.now();
for (var j = -1, m = this.length; ++j < m; ) {
subgroups.push(subgroup = []);
for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
if (node = group[i]) d3_transitionNode(node, i, id, transition);
subgroup.push(node);
}
}
return d3_transition(subgroups, id);
};
function
d3_transition
(
groups
,
id
)
{
d3_arraySubclass
(
groups
,
d3_transitionPrototype
);
groups
.
id
=
id
;
...
...
@@ -8209,6 +8197,18 @@ d3 = function() {
d3
.
time
.
scale
.
utc
=
function
()
{
return
d3_time_scale
(
d3
.
scale
.
linear
(),
d3_time_scaleUTCMethods
,
d3_time_scaleUTCFormat
);
};
d3_selectionPrototype
.
transition
=
function
()
{
var
id
=
d3_transitionInheritId
||
++
d3_transitionId
,
subgroups
=
[],
subgroup
,
node
,
transition
=
Object
.
create
(
d3_transitionInherit
);
transition
.
time
=
Date
.
now
();
for
(
var
j
=
-
1
,
m
=
this
.
length
;
++
j
<
m
;
)
{
subgroups
.
push
(
subgroup
=
[]);
for
(
var
group
=
this
[
j
],
i
=
-
1
,
n
=
group
.
length
;
++
i
<
n
;
)
{
if
(
node
=
group
[
i
])
d3_transitionNode
(
node
,
i
,
id
,
transition
);
subgroup
.
push
(
node
);
}
}
return
d3_transition
(
subgroups
,
id
);
};
d3
.
xhr
=
function
(
url
,
mimeType
,
callback
)
{
var
xhr
=
{},
dispatch
=
d3
.
dispatch
(
"
progress
"
,
"
load
"
,
"
error
"
),
headers
=
{},
response
=
d3_identity
,
request
=
new
(
d3_window
.
XDomainRequest
&&
/^
(
http
(
s
)?
:
)?\/\/
/
.
test
(
url
)
?
XDomainRequest
:
XMLHttpRequest
)();
"
onload
"
in
request
?
request
.
onload
=
request
.
onerror
=
respond
:
request
.
onreadystatechange
=
function
()
{
...
...
d3.min.js
View file @
5c4282f5
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/behavior/zoom.js
View file @
5c4282f5
...
...
@@ -3,7 +3,7 @@ import "../core/rebind";
import
"
../event/event
"
;
import
"
../event/mouse
"
;
import
"
../event/touches
"
;
import
"
../selection/
"
;
import
"
../selection/
selection
"
;
d3
.
behavior
.
zoom
=
function
()
{
var
translate
=
[
0
,
0
],
...
...
src/core/index.js
View file @
5c4282f5
import
"
functor
"
;
import
"
ns
"
;
import
"
rebind
"
;
src/
selection
/ns.js
→
src/
core
/ns.js
View file @
5c4282f5
File moved
src/math/transform.js
View file @
5c4282f5
import
"
../core/document
"
;
import
"
../core/ns
"
;
d3
.
transform
=
function
(
string
)
{
var
g
=
d3_document
.
createElementNS
(
d3
.
ns
.
prefix
.
svg
,
"
g
"
);
...
...
src/selection/append.js
View file @
5c4282f5
import
"
../core/document
"
;
import
"
ns
"
;
import
"
../core/
ns
"
;
import
"
selection
"
;
// TODO append(node)?
...
...
src/selection/attr.js
View file @
5c4282f5
import
"
ns
"
;
import
"
../core/
ns
"
;
import
"
selection
"
;
d3_selectionPrototype
.
attr
=
function
(
name
,
value
)
{
...
...
src/selection/index.js
View file @
5c4282f5
import
"
ns
"
;
import
"
selection
"
;
src/selection/insert.js
View file @
5c4282f5
import
"
../core/document
"
;
import
"
ns
"
;
import
"
../core/
ns
"
;
import
"
selection
"
;
d3_selectionPrototype
.
insert
=
function
(
name
,
before
)
{
...
...
src/selection/transition.js
View file @
5c4282f5
import
"
selection
"
;
import
"
../transition/
"
;
import
"
../transition/
transition
"
;
d3_selectionPrototype
.
transition
=
function
()
{
var
id
=
d3_transitionInheritId
||
++
d3_transitionId
,
...
...
src/svg/axis.js
View file @
5c4282f5
import
"
../scale/
"
;
import
"
../selection/
"
;
import
"
../transition/
"
;
import
"
../scale/linear
"
;
import
"
../scale/scale
"
;
import
"
../selection/selection
"
;
import
"
../transition/transition
"
;
import
"
svg
"
;
d3
.
svg
.
axis
=
function
()
{
...
...
src/svg/brush.js
View file @
5c4282f5
...
...
@@ -5,7 +5,7 @@ import "../event/event";
import
"
../event/mouse
"
;
import
"
../event/touches
"
;
import
"
../scale/scale
"
;
import
"
../selection/
"
;
import
"
../selection/
selection
"
;
import
"
svg
"
;
d3
.
svg
.
brush
=
function
()
{
...
...
src/transition/attr.js
View file @
5c4282f5
import
"
../core/ns
"
;
import
"
../interpolate/interpolate
"
;
import
"
../selection/ns
"
;
import
"
transition
"
;
import
"
tween
"
;
...
...
src/transition/transition.js
View file @
5c4282f5
...
...
@@ -3,7 +3,7 @@ import "../core/array";
import
"
../event/dispatch
"
;
import
"
../event/timer
"
;
import
"
../interpolate/ease
"
;
import
"
../selection/
"
;
import
"
../selection/
selection
"
;
function
d3_transition
(
groups
,
id
)
{
d3_arraySubclass
(
groups
,
d3_transitionPrototype
);
...
...
test/
selection
/ns-test.js
→
test/
core
/ns-test.js
View file @
5c4282f5
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment