Graphics Reference
In-Depth Information
example, for node size, D3 will interpolate between a minimum size of 2 and
a maximum of 15. D3 scales will also interpolate colors. In this example, a
color scale is created where D3 will interpolate between the colors listed,
yellow to red.
Finally, you use the scale functions when the data is assigned to the visual
attribute, as shown here:
.attr("r", function(d) { return
nodesize(d.numEmail); })
.attr("fill", function(d) { return
nodecolor(d.recency); })
Figure 8-11 shows how the visualization now appears.
 
Search WWH ::




Custom Search