Published
Edited
Nov 9, 2019
1 fork
Insert cell
md`# d3-selection/src/selection/select.js new`
Insert cell
Insert cell
selectAll("h1")//.select("#test")
Insert cell

selection_select = function(select) {
if (typeof select !== "function") select = selector(select);

for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
if ("__data__" in node) subnode.__data__ = node.__data__;
subgroup[i] = subnode;
}
}
}

return new Selection(subgroups, this._parents);
}
Insert cell
import {Selection, selection} from "@embracelife/d3-selection-src-selection-index-js";
Insert cell
import { selector } from "@embracelife/d3-selection-src-selector-js";
Insert cell
import { selectAll } from "@embracelife/d3-selection-src-selectall-js";
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more