D3 provides a functional flow-based DSL for connecting data to DOM elements. It's an efficient alternative to the verbose DOM API (or to libraries such as jQuery). It's also very compact and easy to read, once you understand its fundamental concepts.
The d3-selection module contains not only methods for selecting DOM nodes, but also methods for merging and filtering selections; joining data to elements; modifying properties, attributes, styles, classes, and contents; adding and removing elements from a node tree; handling and dispatching events; sorting nodes; calling arbitrary functions; and iterating a node set.
A selection expression consists of a series of chained operations that select and transform a DOM node set, appending or removing sub-nodes; changing attributes, styles, and contents; adding event listeners; and calling custom functions. It starts...