Shapes are no longer limited to SVG; they can now render to Canvas! Each shape generator supports an optional *context*: if you pass it a [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D), you can generate a canvas path to be filled or stroked. For example, a [canvas pie chart](https://bl.ocks.org/mbostock/8878e7fd82034f1d63cf) might use an arc generator:
See [*line*.context](https://github.com/d3/d3-shape#line_context), [*area*.context](https://github.com/d3/d3-shape#area_context) and [*arc*.context](https://github.com/d3/d3-shape#arc_context) for more. Under the hood, this uses [d3-path](#paths-d3-path) to serialize canvas path methods to an SVG path data string when the context is null. Thus, shapes are optimized for rendering to canvas.
**area*.context
**arc*.context
* see also d3-path
* fast; uses streaming geometry transforms similar to d3-geo
new curve API!
new curve API!
...
@@ -941,6 +950,8 @@ new curve API!
...
@@ -941,6 +950,8 @@ new curve API!
* "step-before" ↦ d3.curveStepBefore
* "step-before" ↦ d3.curveStepBefore
* no more funky *interpolate*.reverse; curves can define different behavior for topline vs. baseline
* no more funky *interpolate*.reverse; curves can define different behavior for topline vs. baseline
new derived shapes: e.g., *area*.lineY0 for the baseline, *area*.lineY1 for the topline.
new symbol API
new symbol API
* d3.svg.symbol ↦ d3.symbol
* d3.svg.symbol ↦ d3.symbol
...
@@ -956,11 +967,15 @@ new stack API!
...
@@ -956,11 +967,15 @@ new stack API!
* no more x-accessor
* no more x-accessor
* no more weird *stack*.out
* no more weird *stack*.out
more robust arc padding?
removed diagonal shapes
removed diagonal shapes
* d3.svg.diagonal ↦ REMOVED
* d3.svg.diagonal ↦ REMOVED
* d3.svg.diagonal.radial ↦ REMOVED
* d3.svg.diagonal.radial ↦ REMOVED
For more, see [Introducing d3-shape](https://medium.com/@mbostock/introducing-d3-shape-73f8367e6d12).