Table of Contents

D3 - Selection

About

D3 adopts the W3C Selectors API to identify document elements for selection.

Any number of operators can be applied to selected elements. These operators wrap the W3C DOM API, setting:

D3’s selection operators such as attr, style and property allow to specify the value either as:

Since each selection is simply an array, elements can also be accessed directly (e.g., [0]).

If you’re using a DOM framework like React, you probably don’t need selections (if you don’t need transitions)

Nested / Hierarchy Selection

Operations

Documentation / Reference