Your IP : 216.73.216.86


Current Path : /home/emeraadmin/public_html/node_modules/d3-selection/src/selection/
Upload File :
Current File : /home/emeraadmin/public_html/node_modules/d3-selection/src/selection/selectAll.js

import {Selection} from "./index";
import selectorAll from "../selectorAll";

export default function(select) {
  if (typeof select !== "function") select = selectorAll(select);

  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
      if (node = group[i]) {
        subgroups.push(select.call(node, node.__data__, i, group));
        parents.push(node);
      }
    }
  }

  return new Selection(subgroups, parents);
}