UNPKG

d3

Version:

A small, free JavaScript library for manipulating documents based on data.

22 lines (16 loc) 582 B
function d3_selection(groups) { d3_arraySubclass(groups, d3_selectionPrototype); return groups; } var d3_select = function(s, n) { return n.querySelector(s); }, d3_selectAll = function(s, n) { return n.querySelectorAll(s); }; // Prefer Sizzle, if available. if (typeof Sizzle === "function") { d3_select = function(s, n) { return Sizzle(s, n)[0]; }; d3_selectAll = function(s, n) { return Sizzle.uniqueSort(Sizzle(s, n)); }; } var d3_selectionPrototype = []; d3.selection = function() { return d3_selectionRoot; }; d3.selection.prototype = d3_selectionPrototype;