Transformations

Before jumping into more complicated things, let's take a look at transformations. For now, think of transformations as manipulations of whole SVG shapes. Without going into too much mathematical detail, it suffices to say that transformations, as used in SVG, are affine transformations of coordinate systems used by shapes in our drawing. The beautiful thing is they can be defined as matrix multiplications, making them very efficient to compute--it's much more performant for your graphics card to animate a shape moving from left to right using a transformation than it is to recalculate the position of each point in a shape and modify the shape directly.

However, unless your brain is made out of linear algebra, using transformations ...

Get D3.js 4.x Data Visualization - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.