source: node_modules/d3-selection/src/selection/select.js@ a762898

Last change on this file since a762898 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 659 bytes
Line 
1import {Selection} from "./index.js";
2import selector from "../selector.js";
3
4export default function(select) {
5 if (typeof select !== "function") select = selector(select);
6
7 for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
8 for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
9 if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
10 if ("__data__" in node) subnode.__data__ = node.__data__;
11 subgroup[i] = subnode;
12 }
13 }
14 }
15
16 return new Selection(subgroups, this._parents);
17}
Note: See TracBrowser for help on using the repository browser.