|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
832 bytes
|
| Rev | Line | |
|---|
| [e4c61dd] | 1 | import {selector} from "d3-selection";
|
|---|
| 2 | import {Transition} from "./index.js";
|
|---|
| 3 | import schedule, {get} from "./schedule.js";
|
|---|
| 4 |
|
|---|
| 5 | export default function(select) {
|
|---|
| 6 | var name = this._name,
|
|---|
| 7 | id = this._id;
|
|---|
| 8 |
|
|---|
| 9 | if (typeof select !== "function") select = selector(select);
|
|---|
| 10 |
|
|---|
| 11 | for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|---|
| 12 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|---|
| 13 | if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
|---|
| 14 | if ("__data__" in node) subnode.__data__ = node.__data__;
|
|---|
| 15 | subgroup[i] = subnode;
|
|---|
| 16 | schedule(subgroup[i], name, id, i, subgroup, get(node, id));
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | return new Transition(subgroups, this._parents, name, id);
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.