All examples By author By category About

emeeks

Ch. 2, Fig. 25 - D3.js in Action

This is the code for Chapter 2, Figure 25 from D3.js in Action that draws a scatterplot from loaded JSON data. For each datapoint in the loaded data, an SVG g element is rendered, each of which has an SVG circle and SVG text element as children. The g element is placed according to the attributes of the data, while the circle element is sized according to the data and the text element has its .text() populated from the data.