How selectAll Works
This animation demonstrates how `selection.selectAll` works in D3: every element in the old selection becomes a group in the new selection. Using an initial selection of table rows to create a selection of table cells, it visualizes the hierarchical grouping of `td` elements by their parent `tr`. The example builds side-by-side tree diagrams with `d3.layout.tree`, rendering SVG nodes and links, and animates transitions between states to show how the nested selection is constructed and mapped.
AI-generated descriptionThis animation demonstrates how selection.selectAll works: every element in the old selection becomes a group in the new selection. Here, an initial selection of table rows is then used to create a selection of table cells:
d3.selectAll("tr").selectAll("td");
The result is a selection of table cells (td elements) grouped by their table row.