Selection set

Definition of selection set

A selection set is an ordered collection of DOM elements encapsulated in an abstract Selection. Abstract Selection provides an API to query and modify the elements it contains. The Selection API is declarative and supports chained method calls, so you can manipulate the DOM tree without traversing a single node.

Create selection set

Generally speaking, the initial selection set instance is obtained by calling the selection set method on the global d3 object. Then, you can call its own method on the Selection instance to create a subset of it

  • Global method for creating selection sets
    Insert picture description here
  • The method of creating a sub-selection set from the selection set (sel refers to the selection set object)
    Insert picture description here

Guess you like

Origin blog.csdn.net/qq_37335220/article/details/112298129