Graphics Reference
In-Depth Information
Figure 8-13: In the springy graph of e-mails in D3, clusters are much
more obvious.
Also note that the text x and y position is not set in the label creation.
These positions must update as the forces are updated. The x,y positions
must be set in the springy layout update function, just like the nodes.
label.attr("x", function(d) { return d.x; })
.attr("y", function(d) { return d.y; });
Figure 8-14 shows the labeled graph.
Figure 8-14: This shows a labeled springy graph.
Full Springy Graph Code
You have inserted and modified a lot of code since the start of this section
on D3. The following code represents the visualization in Figure 8-13 (also
 
 
 
Search WWH ::




Custom Search