You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// if we consider the container for our radial node graph as a box encapsulating, half of this container width is essentially the radius of our radial node graph
128
132
letradius=width/2;
129
133
130
-
letroot=d3.hierarchy(dataset);
134
+
// d3.hierarchy constructs a root node from the specified hierarchical data (our object titled dataset), which must be an object representing the root node
135
+
lethierarchy=d3.hierarchy(dataset);
131
136
132
-
lettreeLayout=d3.tree()
137
+
lettree=d3.tree()
138
+
// this assigns width of tree to be 2pi
133
139
.size([2*Math.PI,radius])
134
140
135
-
lettree=treeLayout(root);
141
+
letroot=tree(hierarchy);
136
142
137
143
console.log('children',root.descendants());
138
144
139
-
g.selectAll('path')
145
+
g.selectAll('.link')
146
+
// root.links() gets an array of all the links, where each element is an object containing a source property, which represents the link's source node, and a target property, which represents the link's target node.
0 commit comments