Skip to content

Commit f40d56a

Browse files
tree added comments
1 parent be2cdf3 commit f40d56a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/src/tree/TreeChart.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ function TreeChart({ data }) {
4343
// insert our data into the tree layout
4444
treeLayout(root);
4545

46-
// nodes
46+
// nodes - each element in the tree
4747
svg
48-
.selectAll(".node") // grab all nodes
48+
.selectAll(".node")
4949
.data(root.descendants())
5050
.join(enter => enter.append("circle").attr("opacity", 0))
5151
.attr("class", "node")
@@ -56,10 +56,10 @@ function TreeChart({ data }) {
5656
*/
5757
.attr("cx", node => node.y)
5858
.attr("cy", node => node.x)
59-
.attr("r", 4)
59+
.attr("r", 4) // radius of circle
6060
.attr("opacity", 1);
6161

62-
// links
62+
// links - lines that connect the nodes
6363
const enteringAndUpdatingLinks = svg
6464
.selectAll(".link")
6565
.data(root.links())
@@ -82,7 +82,7 @@ function TreeChart({ data }) {
8282
.attr("stroke-dashoffset", 0);
8383
}
8484

85-
// labels
85+
// label - the names of each html element (node)
8686
svg
8787
.selectAll(".label")
8888
.data(root.descendants())

0 commit comments

Comments
 (0)