© Tarek Amr and Rayna Stamboliyska 2016

Tarek Amr and Rayna Stamboliyska, Practical D3.js, 10.1007/978-1-4842-1928-7_6

6. Creating Complex Shapes

Tarek Amr and Rayna Stamboliyska2

(1)Amsterdam, The Netherlands

(2)Issy-les-Moulineaux, Paris, France

This chapter introduces SVG Paths, and explains how you can use them in D3 to create any shapes you want. You will also learn about D3 Path Generators and how to use them to make the creation of paths easier.

Forget Rectangles, Go Freehand

Unless you are Piet Mondrian1, you cannot limit yourself to drawing only rectangles, and eventually circles. SVG provides a path element that allows you to draw anything, from line charts to the world map. D3, in turn, makes use of the path element to draw interesting and ...

Get Practical D3.js 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.