D3 - Grouping

About

Subselecting via selectAll groups elements by ancestor.

Thus:

  • d3.selectAll(“p”).selectAll(“b”) groups by paragraph, while
  • d3.selectAll(“p b”) returns a flat selection.

Subselecting via select is similar, but preserves groups and propagates data.


Powered by ComboStrap