<commit_before># d3-selection

This EXPERIMENTAL module implements the core concept of D3: manipulating the DOM by selecting elements and joining to data.

API changes from D3 3.x:

* The implementation is now organized into ES6 modules, rather than the ad hoc [SMASH](https://github.com/mbostock/smash) bundling used previously. A [UMD](https://github.com/umdjs/umd) build is provided for your convenience using [Esperanto](http://esperantojs.org/), but you are free to define your own build process (e.g., [Browserify](http://browserify.org/) or [Webpack](https://webpack.github.io/)). See [#2220](https://github.com/mbostock/d3/issues/2220).

* The Selection class now extends Object, not Array, obviating the need for [prototype injection](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_prototype_chain_injection) (and [direct property injection](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_direct_property_injection) on runtimes that do not support `__proto__`). See [#2191](https://github.com/mbostock/d3/issues/2191).

* Selections are now truly hierarchical! Rather than always being a nested array, selections have arbitrary depth. Accessor functions such as those accepted by selection.attr and selection.style can now refer to [parent data](http://bl.ocks.org/mbostock/7a8a2de2b99d391add4b) (and indices) if desired.

* The selection.data method, when called with arguments, now modifies the current selection to be the update selection, rather than returning a new selection. Likewise, the enter and exit selections are lazily constructed and modified in-place. The selection.enter and selection.exit methods now return empty selections if the selection has not yet been bound to data. (Previously, attempting to access these methods before binding to data would throw an error.) See [#2402](https://github.com/mbostock/d3/issues/2402).

* The selection.data method, when called *without* arguments, now returns an array of data for all elements in the selection, not just the first group.

* Similarly, a new selection selection.nodes method returns an array of all elements in the selection (flattening the underlying hierarchy).

* The selection.insert method has been renamed (and replaces) selection.append. Thus, the enter.append method now inserts elements in data order by default when joining by key! (This assumes that new data is in the same order as old data; if not, use selection.order after.)

* The enter.append method now moves (rather than copies) elements to the update selection. (In practice, you are unlikely to notice the difference, as enter selections are typically discarded upon append. But this makes more sense now that enter selections are persistent.)

* Enter selections no longer have a special subclass. Instead, enter nodes function as virtual placeholders, providing appendChild and insertBefore methods for use with selection.append.

* The selection.classed method has been renamed selection.class. (Note: `class` is a reserved word in ES6, but ES5 and later allow reserved words as identifier names.) The old name is deprecated but preserved for backwards-compatibility.

* The selection.on method has been renamed selection.event. The old name is deprecated but preserved for backwards-compatibility.

* A new selection.dispatch method dispatches a [custom event](https://dom.spec.whatwg.org/#interface-customevent) of the specified type to all selected elements. It’s like trigger in jQuery.

* [Multi-value map](http://bl.ocks.org/mbostock/3305515) variants of selection.attr, selection.style, selection.property, selection.class and selection.on are now implemented as distinct methods in the [d3-selection-multi plugin](https://github.com/d3/d3-selection-multi), rather than overloading the arguments. See [#2109](https://github.com/mbostock/d3/issues/2109).

* The d3.ns.prefix namespace map has been renamed to d3.namespaces and is now a Map rather than an object. The d3.ns.qualify method has likewise been renamed to d3.namespace.

* Removed support for Sizzle. It’s time.<commit_msg>Update README.<commit_after># d3-selection

This module implements the core concept of D3: manipulating the DOM by selecting elements and joining to data.

This module is currently EXPERIMENTAL and represents the in-development D3 4.0 API. The 4.0 API is largely backwards-compatible, but differs from 3.x in several ways:

* The implementation is now organized into ES6 modules, rather than the ad hoc concatentation used previously. A [UMD](https://github.com/umdjs/umd) build is provided using [Esperanto](http://esperantojs.org/), but you are free to define your own build.

* The Selection class now extends Object, rather than Array. This obviates the need for [prototype injection](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_prototype_chain_injection) and [direct property injection](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_direct_property_injection).

* Selections are now hierarchical, rather than having fixed two-level nesting. Accessor functions such as those accepted by selection.attr and selection.style can now refer to [parent data](http://bl.ocks.org/mbostock/7a8a2de2b99d391add4b) (and indices) if desired.

* The selection.data method (when called with arguments) now modifies the current selection to be the update selection, rather than returning a new selection.

* The enter and exit selections are now empty prior to a data-join, rather than non-existant.

* The selection.data method (when called *without* arguments) now returns an array of data for *all* selected elements, not just the first group.

* Similarly, a new selection selection.nodes method returns an array of all selected elements.

* The selection.append method now takes an optional before selector and replaces selection.insert. The selection.insert method is now deprecated.

* The enter.append method now inserts elements in data order by default when joining by key. (This assumes that new data is in the same order as old data; if not, use selection.order after.)

* The enter.append method now moves, rather than copies, elements to the update selection.

* Enter selections no longer have a special subclass, and thus supports all selection methods. (Internally, enter nodes function as virtual placeholders, providing specialized appendChild and insertBefore methods.)

* The selection.classed method has been renamed selection.class. The old name is deprecated but preserved for backwards-compatibility.

* The selection.on method has been renamed selection.event. The old name is deprecated but preserved for backwards-compatibility.

* A new selection.dispatch method dispatches a [custom event](https://dom.spec.whatwg.org/#interface-customevent) of the specified type to all selected elements. Think of it like jQuery’s trigger.

* [Multi-value map](http://bl.ocks.org/mbostock/3305515) variants of selection.attr, selection.style, selection.property, selection.class and selection.on are now implemented as distinct methods in the [d3-selection-multi plugin](https://github.com/d3/d3-selection-multi), rather than overloading the arguments. See [#2109](https://github.com/mbostock/d3/issues/2109).

* The d3.ns.prefix namespace map has been renamed to d3.namespaces and is now a Map rather than an object.

* The d3.ns.qualify method has been renamed to d3.namespace.

* Sizzle is no longer supported. It’s time.
{'fraction_non_alphanumeric': 0.07869025613942435, 'fraction_numerical': 0.014919461315025086, 'mean_word_length': 4.8949416342412455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4056246', 'n_tokens_mistral': 2041, 'n_tokens_neox': 1952, 'n_words': 889}