-
Book Overview & Buying
-
Table Of Contents
Learn D3.js - Second Edition
By :
The d3-shape module provides functions to create and manipulate shapes and paths for data visualizations. These functions can be divided into two groups: shape generators, which generate SVG path strings or Canvas path commands from a provided dataset, and layout generators, which transform a dataset, making it easier to create a complex chart, such as a pie or stacked area chart. This chapter covers all shape generators, except arcs and links. Layout generators and arc functions are explored in Chapter 12, and link functions will be used to create hierarchical trees in Chapter 15.
Shape generator functions generate data strings for the SVG <path> element, which can be used to draw straight lines, curves, symbols, and arcs. Instead of SVG path strings, they can alternatively be configured to generate path commands that draw the same shapes in Canvas.
In SVG, shapes are described by a path language expressed as a concise string of letters...