|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
659 bytes
|
| Line | |
|---|
| 1 | import {Selection} from "./index.js";
|
|---|
| 2 | import selector from "../selector.js";
|
|---|
| 3 |
|
|---|
| 4 | export 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.