source: node_modules/d3-transition/src/transition/selectAll.js@ e4c61dd

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: 889 bytes
RevLine 
[e4c61dd]1import {selectorAll} from "d3-selection";
2import {Transition} from "./index.js";
3import schedule, {get} from "./schedule.js";
4
5export default function(select) {
6 var name = this._name,
7 id = this._id;
8
9 if (typeof select !== "function") select = selectorAll(select);
10
11 for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
12 for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
13 if (node = group[i]) {
14 for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {
15 if (child = children[k]) {
16 schedule(child, name, id, k, children, inherit);
17 }
18 }
19 subgroups.push(children);
20 parents.push(node);
21 }
22 }
23 }
24
25 return new Transition(subgroups, parents, name, id);
26}
Note: See TracBrowser for help on using the repository browser.