d3-selection
Version:
Data-driven DOM manipulation: select elements and join them to data.
9 lines (7 loc) • 324 B
JavaScript
import array from "./array.js";
import {Selection, root} from "./selection/index.js";
export default function(selector) {
return typeof selector === "string"
? new Selection([document.querySelectorAll(selector)], [document.documentElement])
: new Selection([selector == null ? [] : array(selector)], root);
}