File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ function TreeChart({ data }) {
43
43
// insert our data into the tree layout
44
44
treeLayout ( root ) ;
45
45
46
- // nodes
46
+ // nodes - each element in the tree
47
47
svg
48
- . selectAll ( ".node" ) // grab all nodes
48
+ . selectAll ( ".node" )
49
49
. data ( root . descendants ( ) )
50
50
. join ( enter => enter . append ( "circle" ) . attr ( "opacity" , 0 ) )
51
51
. attr ( "class" , "node" )
@@ -56,10 +56,10 @@ function TreeChart({ data }) {
56
56
*/
57
57
. attr ( "cx" , node => node . y )
58
58
. attr ( "cy" , node => node . x )
59
- . attr ( "r" , 4 )
59
+ . attr ( "r" , 4 ) // radius of circle
60
60
. attr ( "opacity" , 1 ) ;
61
61
62
- // links
62
+ // links - lines that connect the nodes
63
63
const enteringAndUpdatingLinks = svg
64
64
. selectAll ( ".link" )
65
65
. data ( root . links ( ) )
@@ -82,7 +82,7 @@ function TreeChart({ data }) {
82
82
. attr ( "stroke-dashoffset" , 0 ) ;
83
83
}
84
84
85
- // labels
85
+ // label - the names of each html element (node)
86
86
svg
87
87
. selectAll ( ".label" )
88
88
. data ( root . descendants ( ) )
You can’t perform that action at this time.
0 commit comments