Operators act on selections, modifying content.
Operator values are specified either as constants or functions; the latter (the functions) are evaluated for each element. (The functions are evaluated per element with access to data).
To tighten the scope of reference capture, D3 applies operators immediately; for example, D3’s attr operator immediately sets attributes on selected nodes and then returns.
The operator return value is the selection and therefore D3 supports method chaining.
For example, the append and insert operators add a new element for each element in the current selection, returning the added nodes, thus allowing the convenient creation of nested structures.
The remove operator discards selected elements.
- simplifies D3’s selection structure (requiring only one level of grouping) (???)
- avoids variable arguments. (???)