All examples By author By category About

emeeks

Ch. 1, Fig. 20 - D3.js in Action

This is the code for Chapter 1, Figure 20 from D3.js in Action that demonstrates how SVG transform works. The elements on page are translated (position has changed) and scaled (size has changed). This transformation is applied to a g element, which is a logical grouping and has not visual representation, but the transformation applies to all child elements--in this case text and circles.

Note that D3 (or any other JavaScript) are not used in this example.