In D3, the selection is achieved through the intersection of data and the DOM. Each call to data()
generates:
enter
, representing data that has not been mounted to elementsupdate
, representing all elements that are mounted with dataexit
, representing elements that are surplus to the mounted data
These three areas.
The reason for this design is to allow elements to follow data changes in a declarative manner.