6
Selections and Data Binding
D3 offers a functional flow-based DSL for connecting data to DOM elements. It’s an efficient alternative to the verbose DOM API, avoids the need for JavaScript loops, facilitates updating in interactive charts, and is compact and readable once its fundamentals are understood. This chapter will explore it in detail.
The toolset is provided by the d3-selection module – the most important module in D3. It contains tools to select DOM nodes, o filter selections, bind data to selections, modify element properties, attributes, styles, classes, and contents, add and remove elements from a node tree, handle and dispatch events, apply animated transitions, sort nodes, call arbitrary functions, and iterate over a node set. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access