diff --git a/README.md b/README.md index 0b4a74b..4e605e0 100644 --- a/README.md +++ b/README.md @@ -60,11 +60,11 @@ The arc generator produces a [circular](https://en.wikipedia.org/wiki/Circular_s See also the [pie generator](#pies), which computes the necessary angles to represent an array of data as a pie or donut chart; these angles can then be passed to an arc generator. -# d3.arc() +# d3.arc() [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js "Source") Constructs a new arc generator with the default settings. -# arc(arguments…) +# arc(arguments…) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L89 "Source") Generates an arc for the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the arc generator’s accessor functions along with the `this` object. For example, with the default settings, an object with radii and angles is expected: @@ -93,7 +93,7 @@ arc(); // "M0,-100A100,100,0,0,1,100,0L0,0Z" If the arc generator has a [context](#arc_context), then the arc is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned. -# arc.centroid(arguments…) +# arc.centroid(arguments…) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L224 "Source") Computes the midpoint [*x*, *y*] of the center line of the arc that would be [generated](#_arc) by the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the arc generator’s accessor functions along with the `this` object. To be consistent with the generated arc, the accessors must be deterministic, *i.e.*, return the same value given the same arguments. The midpoint is defined as ([startAngle](#arc_startAngle) + [endAngle](#arc_endAngle)) / 2 and ([innerRadius](#arc_innerRadius) + [outerRadius](#arc_outerRadius)) / 2. For example: @@ -101,7 +101,7 @@ Computes the midpoint [*x*, *y*] of the center line of the arc that would be [ge Note that this is **not the geometric center** of the arc, which may be outside the arc; this method is merely a convenience for positioning labels. -# arc.innerRadius([radius]) +# arc.innerRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L230 "Source") If *radius* is specified, sets the inner radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current inner radius accessor, which defaults to: @@ -113,7 +113,7 @@ function innerRadius(d) { Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a [sqrt scale](https://github.com/d3/d3-scale#sqrt). More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. A negative value is treated as zero. -# arc.outerRadius([radius]) +# arc.outerRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L234 "Source") If *radius* is specified, sets the outer radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current outer radius accessor, which defaults to: @@ -125,7 +125,7 @@ function outerRadius(d) { Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, often in conjunction with a [sqrt scale](https://github.com/d3/d3-scale#sqrt). More commonly, a constant outer radius is used for a pie or donut chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. A negative value is treated as zero. -# arc.cornerRadius([radius]) +# arc.cornerRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L238 "Source") If *radius* is specified, sets the corner radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current corner radius accessor, which defaults to: @@ -141,7 +141,7 @@ If the corner radius is greater than zero, the corners of the arc are rounded us The corner radius may not be larger than ([outerRadius](#arc_outerRadius) - [innerRadius](#arc_innerRadius)) / 2. In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. This is occurs more often with the inner corners. See the [arc corners animation](http://bl.ocks.org/mbostock/b7671cb38efdfa5da3af) for illustration. -# arc.startAngle([angle]) +# arc.startAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L246 "Source") If *angle* is specified, sets the start angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current start angle accessor, which defaults to: @@ -153,7 +153,7 @@ function startAngle(d) { The *angle* is specified in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise. If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. -# arc.endAngle([angle]) +# arc.endAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L250 "Source") If *angle* is specified, sets the end angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current end angle accessor, which defaults to: @@ -165,7 +165,7 @@ function endAngle(d) { The *angle* is specified in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise. If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. -# arc.padAngle([angle]) +# arc.padAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L254 "Source") If *angle* is specified, sets the pad angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current pad angle accessor, which defaults to: @@ -185,11 +185,11 @@ The recommended minimum inner radius when using padding is outerRadius \* padAng Often, the pad angle is not set directly on the arc generator, but is instead computed by the [pie generator](#pies) so as to ensure that the area of padded arcs is proportional to their value; see [*pie*.padAngle](#pie_padAngle). See the [pie padding animation](http://bl.ocks.org/mbostock/3e961b4c97a1b543fff2) for illustration. If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion. -# arc.padRadius([radius]) +# arc.padRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L242 "Source") If *radius* is specified, sets the pad radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt([innerRadius](#arc_innerRadius) * innerRadius + [outerRadius](#arc_outerRadius) * outerRadius). The pad radius determines the fixed linear distance separating adjacent arcs, defined as padRadius * [padAngle](#arc_padAngle). -# arc.context([context]) +# arc.context([context]) [<>](https://github.com/d3/d3-shape/blob/master/src/arc.js#L258 "Source") If *context* is specified, sets the context and returns this arc generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated arc](#_arc) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated arc is returned. @@ -197,11 +197,11 @@ If *context* is specified, sets the context and returns this arc generator. If * The pie generator does not produce a shape directly, but instead computes the necessary angles to represent a tabular dataset as a pie or donut chart; these angles can then be passed to an [arc generator](#arcs). -# d3.pie() +# d3.pie() [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js "Source") Constructs a new pie generator with the default settings. -# pie(data[, arguments…]) +# pie(data[, arguments…]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L14 "Source") Generates a pie for the given array of *data*, returning an array of objects representing each datum’s arc angles. Any additional *arguments* are arbitrary; they are simply propagated to the pie generator’s accessor functions along with the `this` object. The length of the returned array is the same as *data*, and each element *i* in the returned array corresponds to the element *i* in the input data. Each object in the returned array has the following properties: @@ -238,7 +238,7 @@ The first pair of parens, `pie()`, [constructs](#pie) a default pie generator. T Note that the returned array is in the same order as the data, even though this pie chart is [sorted](#pie_sortValues) by descending value, starting with the arc for the last datum (value 21) at 12 o’clock. -# pie.value([value]) +# pie.value([value]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L54 "Source") If *value* is specified, sets the value accessor to the specified function or number and returns this pie generator. If *value* is not specified, returns the current value accessor, which defaults to: @@ -273,7 +273,7 @@ var arcs = d3.pie()(data.map(function(d) { return d.number; })); The benefit of an accessor is that the input data remains associated with the returned objects, thereby making it easier to access other fields of the data, for example to set the color or to add text labels. -# pie.sort([compare]) +# pie.sort([compare]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L62 "Source") If *compare* is specified, sets the data comparator to the specified function and returns this pie generator. If *compare* is not specified, returns the current data comparator, which defaults to null. If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. Otherwise, the data is sorted according to the data comparator, and the resulting order is used. Setting the data comparator implicitly sets the [value comparator](#pie_sortValues) to null. @@ -285,7 +285,7 @@ pie.sort(function(a, b) { return a.name.localeCompare(b.name); }); Sorting does not affect the order of the [generated arc array](#_pie) which is always in the same order as the input data array; it merely affects the computed angles of each arc. The first arc starts at the [start angle](#pie_startAngle) and the last arc ends at the [end angle](#pie_endAngle). -# pie.sortValues([compare]) +# pie.sortValues([compare]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L58 "Source") If *compare* is specified, sets the value comparator to the specified function and returns this pie generator. If *compare* is not specified, returns the current value comparator, which defaults to descending value. The default value comparator is implemented as: @@ -305,7 +305,7 @@ pie.sortValues(function(a, b) { return a - b; }); Sorting does not affect the order of the [generated arc array](#_pie) which is always in the same order as the input data array; it merely affects the computed angles of each arc. The first arc starts at the [start angle](#pie_startAngle) and the last arc ends at the [end angle](#pie_endAngle). -# pie.startAngle([angle]) +# pie.startAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L66 "Source") If *angle* is specified, sets the overall start angle of the pie to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current start angle accessor, which defaults to: @@ -317,7 +317,7 @@ function startAngle() { The start angle here means the *overall* start angle of the pie, *i.e.*, the start angle of the first arc. The start angle accessor is invoked once, being passed the same arguments and `this` context as the [pie generator](#_pie). The units of *angle* are arbitrary, but if you plan to use the pie generator in conjunction with an [arc generator](#arcs), you should specify an angle in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise. -# pie.endAngle([angle]) +# pie.endAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L70 "Source") If *angle* is specified, sets the overall end angle of the pie to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current end angle accessor, which defaults to: @@ -331,7 +331,7 @@ The end angle here means the *overall* end angle of the pie, *i.e.*, the end ang The value of the end angle is constrained to [startAngle](#pie_startAngle) ± τ, such that |endAngle - startAngle| ≤ τ. -# pie.padAngle([angle]) +# pie.padAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/pie.js#L74 "Source") If *angle* is specified, sets the pad angle to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current pad angle accessor, which defaults to: @@ -349,15 +349,15 @@ The pad angle here means the angular separation between each adjacent arc. The t The line generator produces a [spline](https://en.wikipedia.org/wiki/Spline_\(mathematics\)) or [polyline](https://en.wikipedia.org/wiki/Polygonal_chain), as in a line chart. Lines also appear in many other visualization types, such as the links in [hierarchical edge bundling](http://bl.ocks.org/mbostock/7607999). -# d3.line() +# d3.line() [<>](https://github.com/d3/d3-shape/blob/master/src/line.js "Source") Constructs a new line generator with the default settings. -# line(data) +# line(data) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L14 "Source") Generates a line for the given array of *data*. Depending on this line generator’s associated [curve](#line_curve), the given input *data* may need to be sorted by *x*-value before being passed to the line generator. If the line generator has a [context](#line_context), then the line is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned. -# line.x([x]) +# line.x([x]) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L34 "Source") If *x* is specified, sets the x accessor to the specified function or number and returns this line generator. If *x* is not specified, returns the current x accessor, which defaults to: @@ -385,7 +385,7 @@ var line = d3.line() .y(function(d) { return y(d.value); }); ``` -# line.y([y]) +# line.y([y]) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L38 "Source") If *y* is specified, sets the y accessor to the specified function or number and returns this line generator. If *y* is not specified, returns the current y accessor, which defaults to: @@ -397,7 +397,7 @@ function y(d) { When a line is [generated](#_line), the y accessor will be invoked for each [defined](#line_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default y accessor assumes that the input data are two-element arrays of numbers. See [*line*.x](#line_x) for more information. -# line.defined([defined]) +# line.defined([defined]) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L42 "Source") If *defined* is specified, sets the defined accessor to the specified function or boolean and returns this line generator. If *defined* is not specified, returns the current defined accessor, which defaults to: @@ -413,29 +413,29 @@ The default accessor thus assumes that the input data is always defined. When a Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square [line caps](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap). In addition, some curves such as [curveCardinalOpen](#curveCardinalOpen) only render a visible segment if it contains multiple points. -# line.curve([curve]) +# line.curve([curve]) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L46 "Source") If *curve* is specified, sets the [curve factory](#curves) and returns this line generator. If *curve* is not specified, returns the current curve factory, which defaults to [curveLinear](#curveLinear). -# line.context([context]) +# line.context([context]) [<>](https://github.com/d3/d3-shape/blob/master/src/line.js#L50 "Source") If *context* is specified, sets the context and returns this line generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated line](#_line) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated line is returned. -# d3.radialLine() +# d3.radialLine() [<>](https://github.com/d3/d3-shape/blob/master/src/radialLine.js "Source") Radial Line Constructs a new radial line generator with the default settings. A radial line generator is equivalent to the standard Cartesian [line generator](#line), except the [x](#line_x) and [y](#line_y) accessors are replaced with [angle](#radialLine_angle) and [radius](#radialLine_radius) accessors. Radial lines are always positioned relative to ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to change the origin. -# radialLine(data) +# radialLine(data) [<>](https://github.com/d3/d3-shape/blob/master/src/radialLine.js#L4 "Source") Equivalent to [*line*](#_line). -# radialLine.angle([angle]) +# radialLine.angle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialLine.js#L7 "Source") Equivalent to [*line*.x](#line_x), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). -# radialLine.radius([radius]) +# radialLine.radius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialLine.js#L8 "Source") Equivalent to [*line*.y](#line_y), except the accessor returns the radius: the distance from the origin ⟨0,0⟩. @@ -443,7 +443,7 @@ Equivalent to [*line*.y](#line_y), except the accessor returns the radius: the d Equivalent to [*line*.defined](#line_defined). -# radialLine.curve([curve]) +# radialLine.curve([curve]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialLine.js#L10 "Source") Equivalent to [*line*.curve](#line_curve). Note that [curveMonotoneX](#curveMonotoneX) or [curveMonotoneY](#curveMonotoneY) are not recommended for radial lines because they assume that the data is monotonic in *x* or *y*, which is typically untrue of radial lines. @@ -457,19 +457,19 @@ Equivalent to [*line*.context](#line_context). The area generator produces an area, as in an area chart. An area is defined by two bounding [lines](#lines), either splines or polylines. Typically, the two lines share the same [*x*-values](#area_x) ([x0](#area_x0) = [x1](#area_x1)), differing only in *y*-value ([y0](#area_y0) and [y1](#area_y1)); most commonly, y0 is defined as a constant representing [zero](http://www.vox.com/2015/11/19/9758062/y-axis-zero-chart). The first line (the topline) is defined by x1 and y1 and is rendered first; the second line (the baseline) is defined by x0 and y0 and is rendered second, with the points in reverse order. With a [curveLinear](#curveLinear) [curve](#area_curve), this produces a clockwise polygon. -# d3.area() +# d3.area() [<>](https://github.com/d3/d3-shape/blob/master/src/area.js "Source") Constructs a new area generator with the default settings. -# area(data) +# area(data) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L17 "Source") Generates an area for the given array of *data*. Depending on this area generator’s associated [curve](#area_curve), the given input *data* may need to be sorted by *x*-value before being passed to the area generator. If the area generator has a [context](#line_context), then the area is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned. -# area.x([x]) +# area.x([x]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L59 "Source") If *x* is specified, sets [x0](#area_x0) to *x* and [x1](#area_x1) to null and returns this area generator. If *x* is not specified, returns the current x0 accessor. -# area.x0([x]) +# area.x0([x]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L63 "Source") If *x* is specified, sets the x0 accessor to the specified function or number and returns this area generator. If *x* is not specified, returns the current x0 accessor, which defaults to: @@ -498,17 +498,17 @@ var area = d3.area() .y0(y(0)); ``` -# area.x1([x]) +# area.x1([x]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L67 "Source") If *x* is specified, sets the x1 accessor to the specified function or number and returns this area generator. If *x* is not specified, returns the current x1 accessor, which defaults to null, indicating that the previously-computed [x0](#area_x0) value should be reused for the x1 value. When an area is [generated](#_area), the x1 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information. -# area.y([y]) +# area.y([y]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L71 "Source") If *y* is specified, sets [y0](#area_y0) to *y* and [y1](#area_y1) to null and returns this area generator. If *y* is not specified, returns the current y0 accessor. -# area.y0([y]) +# area.y0([y]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L75 "Source") If *y* is specified, sets the y0 accessor to the specified function or number and returns this area generator. If *y* is not specified, returns the current y0 accessor, which defaults to: @@ -520,7 +520,7 @@ function y() { When an area is [generated](#_area), the y0 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information. -# area.y1([y]) +# area.y1([y]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L79 "Source") If *y* is specified, sets the y1 accessor to the specified function or number and returns this area generator. If *y* is not specified, returns the current y1 accessor, which defaults to: @@ -532,7 +532,7 @@ function y(d) { A null accessor is also allowed, indicating that the previously-computed [y0](#area_y0) value should be reused for the y1 value. When an area is [generated](#_area), the y1 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information. -# area.defined([defined]) +# area.defined([defined]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L96 "Source") If *defined* is specified, sets the defined accessor to the specified function or boolean and returns this area generator. If *defined* is not specified, returns the current defined accessor, which defaults to: @@ -548,28 +548,28 @@ The default accessor thus assumes that the input data is always defined. When an Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square [line caps](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap). In addition, some curves such as [curveCardinalOpen](#curveCardinalOpen) only render a visible segment if it contains multiple points. -# area.curve([curve]) +# area.curve([curve]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L100 "Source") If *curve* is specified, sets the [curve factory](#curves) and returns this area generator. If *curve* is not specified, returns the current curve factory, which defaults to [curveLinear](#curveLinear). -# area.context([context]) +# area.context([context]) [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L104 "Source") If *context* is specified, sets the context and returns this area generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated area](#_area) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated area is returned. -# area.lineX0() -
# area.lineY0() +# area.lineX0() [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L83 "Source") +
# area.lineY0() [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L84 "Source") Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x0*-accessor](#area_x0), and the line’s [*y*-accessor](#line_y) is this area’s [*y0*-accessor](#area_y0). -# area.lineX1() +# area.lineX1() [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L92 "Source") Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x1*-accessor](#area_x1), and the line’s [*y*-accessor](#line_y) is this area’s [*y0*-accessor](#area_y0). -# area.lineY1() +# area.lineY1() [<>](https://github.com/d3/d3-shape/blob/master/src/area.js#L88 "Source") Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x0*-accessor](#area_x0), and the line’s [*y*-accessor](#line_y) is this area’s [*y1*-accessor](#area_y1). -# d3.radialArea() +# d3.radialArea() [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js "Source") Radial Area @@ -579,27 +579,27 @@ Constructs a new radial area generator with the default settings. A radial area Equivalent to [*area*](#_area). -# radialArea.angle([angle]) +# radialArea.angle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L13 "Source") Equivalent to [*area*.x](#area_x), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). -# radialArea.startAngle([angle]) +# radialArea.startAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L14 "Source") Equivalent to [*area*.x0](#area_x0), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). Note: typically [angle](#radialArea_angle) is used instead of setting separate start and end angles. -# radialArea.endAngle([angle]) +# radialArea.endAngle([angle]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L15 "Source") Equivalent to [*area*.x1](#area_x1), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). Note: typically [angle](#radialArea_angle) is used instead of setting separate start and end angles. -# radialArea.radius([radius]) +# radialArea.radius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L16 "Source") Equivalent to [*area*.y](#area_y), except the accessor returns the radius: the distance from the origin ⟨0,0⟩. -# radialArea.innerRadius([radius]) +# radialArea.innerRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L17 "Source") Equivalent to [*area*.y0](#area_y0), except the accessor returns the radius: the distance from the origin ⟨0,0⟩. -# radialArea.outerRadius([radius]) +# radialArea.outerRadius([radius]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L18 "Source") Equivalent to [*area*.y1](#area_y1), except the accessor returns the radius: the distance from the origin ⟨0,0⟩. @@ -607,7 +607,7 @@ Equivalent to [*area*.y1](#area_y1), except the accessor returns the radius: the Equivalent to [*area*.defined](#area_defined). -# radialArea.curve([curve]) +# radialArea.curve([curve]) [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L24 "Source") Equivalent to [*area*.curve](#area_curve). Note that [curveMonotoneX](#curveMonotoneX) or [curveMonotoneY](#curveMonotoneY) are not recommended for radial areas because they assume that the data is monotonic in *x* or *y*, which is typically untrue of radial areas. @@ -615,16 +615,16 @@ Equivalent to [*area*.curve](#area_curve). Note that [curveMonotoneX](#curveMono Equivalent to [*line*.context](#line_context). -# radialArea.lineStartAngle() -
# radialArea.lineInnerRadius() +# radialArea.lineStartAngle() [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L19 "Source") +
# radialArea.lineInnerRadius() [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L21 "Source") Returns a new [radial line generator](#radialLine) that has this radial area generator’s current [defined accessor](#radialArea_defined), [curve](#radialArea_curve) and [context](#radialArea_context). The line’s [angle accessor](#radialLine_angle) is this area’s [start angle accessor](#radialArea_startAngle), and the line’s [radius accessor](#radialLine_radius) is this area’s [inner radius accessor](#radialArea_innerRadius). -# radialArea.lineEndAngle() +# radialArea.lineEndAngle() [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L20 "Source") Returns a new [radial line generator](#radialLine) that has this radial area generator’s current [defined accessor](#radialArea_defined), [curve](#radialArea_curve) and [context](#radialArea_context). The line’s [angle accessor](#radialLine_angle) is this area’s [end angle accessor](#radialArea_endAngle), and the line’s [radius accessor](#radialLine_radius) is this area’s [inner radius accessor](#radialArea_innerRadius). -# radialArea.lineOuterRadius() +# radialArea.lineOuterRadius() [<>](https://github.com/d3/d3-shape/blob/master/src/radialArea.js#L22 "Source") Returns a new [radial line generator](#radialLine) that has this radial area generator’s current [defined accessor](#radialArea_defined), [curve](#radialArea_curve) and [context](#radialArea_context). The line’s [angle accessor](#radialLine_angle) is this area’s [start angle accessor](#radialArea_startAngle), and the line’s [radius accessor](#radialLine_radius) is this area’s [outer radius accessor](#radialArea_outerRadius). @@ -641,31 +641,31 @@ var line = d3.line() .curve(d3.curveCatmullRom.alpha(0.5)); ``` -# d3.curveBasis(context) +# d3.curveBasis(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/basis.js#L12 "Source") basis Produces a cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. The first and last points are triplicated such that the spline starts at the first point and ends at the last point, and is tangent to the line between the first and second points, and to the line between the penultimate and last points. -# d3.curveBasisClosed(context) +# d3.curveBasisClosed(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/basisClosed.js "Source") basisClosed Produces a closed cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. When a line segment ends, the first three control points are repeated, producing a closed loop with C2 continuity. -# d3.curveBasisOpen(context) +# d3.curveBasisOpen(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/basisOpen.js "Source") basisOpen Produces a cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. Unlike [basis](#basis), the first and last points are not repeated, and thus the curve typically does not intersect these points. -# d3.curveBundle(context) +# d3.curveBundle(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/bundle.js "Source") bundle Produces a straightened cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points, with the spline straightened according to the curve’s [*beta*](#curveBundle_beta), which defaults to 0.85. This curve is typically used in [hierarchical edge bundling](http://bl.ocks.org/mbostock/7607999) to disambiguate connections, as proposed by [Danny Holten](https://www.win.tue.nl/vis1/home/dholten/) in [Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data](https://www.win.tue.nl/vis1/home/dholten/papers/bundles_infovis.pdf). This curve does not implement [*curve*.areaStart](#curve_areaStart) and [*curve*.areaEnd](#curve_areaEnd); it is intended to work with [d3.line](#lines), not [d3.area](#areas). -# bundle.beta(beta) +# bundle.beta(beta) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/bundle.js#L51 "Source") Returns a bundle curve with the specified *beta* in the range [0, 1], representing the bundle strength. If *beta* equals zero, a straight line between the first and last point is produced; if *beta* equals one, a standard [basis](#basis) spline is produced. For example: @@ -673,25 +673,25 @@ Returns a bundle curve with the specified *beta* in the range [0, 1], representi var line = d3.line().curve(d3.curveBundle.beta(0.5)); ``` -# d3.curveCardinal(context) +# d3.curveCardinal(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/cardinal.js "Source") cardinal Produces a cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points, with one-sided differences used for the first and last piece. The default [tension](#curveCardinal_tension) is 0. -# d3.curveCardinalClosed(context) +# d3.curveCardinalClosed(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalClosed.js "Source") cardinalClosed Produces a closed cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points. When a line segment ends, the first three control points are repeated, producing a closed loop. The default [tension](#curveCardinal_tension) is 0. -# d3.curveCardinalOpen(context) +# d3.curveCardinalOpen(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalOpen.js "Source") cardinalOpen Produces a cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points. Unlike [curveCardinal](#curveCardinal), one-sided differences are not used for the first and last piece, and thus the curve starts at the second point and ends at the penultimate point. The default [tension](#curveCardinal_tension) is 0. -# cardinal.tension(tension) +# cardinal.tension(tension) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalOpen.js#L44 "Source") Returns a cardinal curve with the specified *tension* in the range [0, 1]. The *tension* determines the length of the tangents: a *tension* of one yields all zero tangents, equivalent to [curveLinear](#curveLinear); a *tension* of zero produces a uniform [Catmull–Rom](#curveCatmullRom) spline. For example: @@ -699,25 +699,25 @@ Returns a cardinal curve with the specified *tension* in the range [0, 1]. The * var line = d3.line().curve(d3.curveCardinal.tension(0.5)); ``` -# d3.curveCatmullRom(context) +# d3.curveCatmullRom(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRom.js "Source") catmullRom Produces a cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#catmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. in [On the Parameterization of Catmull–Rom Curves](http://www.cemyuksel.com/research/catmullrom_param/), with one-sided differences used for the first and last piece. -# d3.curveCatmullRomClosed(context) +# d3.curveCatmullRomClosed(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRomClosed.js "Source") catmullRomClosed Produces a closed cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#catmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. When a line segment ends, the first three control points are repeated, producing a closed loop. -# d3.curveCatmullRomOpen(context) +# d3.curveCatmullRomOpen(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRomOpen.js "Source") catmullRomOpen Produces a cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#catmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. Unlike [curveCatmullRom](#curveCatmullRom), one-sided differences are not used for the first and last piece, and thus the curve starts at the second point and ends at the penultimate point. -# catmullRom.alpha(alpha) +# catmullRom.alpha(alpha) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRom.js#L83 "Source") Returns a cubic Catmull–Rom curve with the specified *alpha* in the range [0, 1]. If *alpha* is zero, produces a uniform spline, equivalent to [curveCardinal](#curveCardinal) with a tension of zero; if *alpha* is one, produces a chordal spline; if *alpha* is 0.5, produces a [centripetal spline](https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline). Centripetal splines are recommended to avoid self-intersections and overshoot. For example: @@ -725,49 +725,49 @@ Returns a cubic Catmull–Rom curve with the specified *alpha* in the range [0, var line = d3.line().curve(d3.curveCatmullRom.alpha(0.5)); ``` -# d3.curveLinear(context) +# d3.curveLinear(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/linear.js "Source") linear Produces a polyline through the specified points. -# d3.curveLinearClosed(context) +# d3.curveLinearClosed(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/linearClosed.js "Source") linearClosed Produces a closed polyline through the specified points by repeating the first point when the line segment ends. -# d3.curveMonotoneX(context) +# d3.curveMonotoneX(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/monotone.js#L98 "Source") monotoneX Produces a cubic spline that [preserves monotonicity](https://en.wikipedia.org/wiki/Monotone_cubic_interpolation) in *y*, assuming monotonicity in *x*, as proposed by Steffen in [A simple method for monotonic interpolation in one dimension](http://adsabs.harvard.edu/full/1990A%26A...239..443S): “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” -# d3.curveMonotoneY(context) +# d3.curveMonotoneY(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/monotone.js#L102 "Source") monotoneY Produces a cubic spline that [preserves monotonicity](https://en.wikipedia.org/wiki/Monotone_cubic_interpolation) in *x*, assuming monotonicity in *y*, as proposed by Steffen in [A simple method for monotonic interpolation in one dimension](http://adsabs.harvard.edu/full/1990A%26A...239..443S): “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” -# d3.curveNatural(context) +# d3.curveNatural(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/natural.js "Source") natural Produces a [natural](https://en.wikipedia.org/wiki/Spline_interpolation) [cubic spline](http://mathworld.wolfram.com/CubicSpline.html) with the second derivative of the spline set to zero at the endpoints. -# d3.curveStep(context) +# d3.curveStep(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js "Source") step Produces a piecewise constant function (a [step function](https://en.wikipedia.org/wiki/Step_function)) consisting of alternating horizontal and vertical lines. The *y*-value changes at the midpoint of each pair of adjacent *x*-values. -# d3.curveStepAfter(context) +# d3.curveStepAfter(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L51 "Source") stepAfter Produces a piecewise constant function (a [step function](https://en.wikipedia.org/wiki/Step_function)) consisting of alternating horizontal and vertical lines. The *y*-value changes after the *x*-value. -# d3.curveStepBefore(context) +# d3.curveStepBefore(context) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L47 "Source") stepBefore @@ -777,23 +777,23 @@ Produces a piecewise constant function (a [step function](https://en.wikipedia.o Curves are typically not used directly, instead being passed to [*line*.curve](#line_curve) and [*area*.curve](#area_curve). However, you can define your own curve implementation should none of the built-in curves satisfy your needs using the following interface. You can also use this low-level interface with a built-in curve type as an alternative to the line and area generators. -# curve.areaStart() +# curve.areaStart() [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L7 "Source") Indicates the start of a new area segment. Each area segment consists of exactly two [line segments](#curve_lineStart): the topline, followed by the baseline, with the baseline points in reverse order. -# curve.areaEnd() +# curve.areaEnd() [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L10 "Source") Indicates the end of the current area segment. -# curve.lineStart() +# curve.lineStart() [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L13 "Source") Indicates the start of a new line segment. Zero or more [points](#curve_point) will follow. -# curve.lineEnd() +# curve.lineEnd() [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L17 "Source") Indicates the end of the current line segment. -# curve.point(x, y) +# curve.point(x, y) [<>](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L22 "Source") Indicates a new point in the current line segment with the given *x*- and *y*-values. @@ -803,15 +803,15 @@ Indicates a new point in the current line segment with the given *x*- and *y*-va Symbols provide a categorical shape encoding as is commonly used in scatterplots. Symbols are always centered at ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to move the arc to a different position. -# d3.symbol() +# d3.symbol() [<>](https://github.com/d3/d3-shape/blob/master/src/symbol.js "Source") Constructs a new symbol generator with the default settings. -# symbol(arguments…) +# symbol(arguments…) [<>](https://github.com/d3/d3-shape/blob/master/src/symbol.js#L11 "Source") Generates a symbol for the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the symbol generator’s accessor functions along with the `this` object. For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. If the symbol generator has a [context](#symbol_context), then the symbol is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned. -# symbol.type([type]) +# symbol.type([type]) [<>](https://github.com/d3/d3-shape/blob/master/src/symbol.js#L33 "Source") If *type* is specified, sets the symbol type to the specified function or symbol type and returns this line generator. If *type* is not specified, returns the current symbol type accessor, which defaults to: @@ -823,7 +823,7 @@ function type() { See [symbols](#symbols) for the set of built-in symbol types. To implement a custom symbol type, pass an object that implements [*symbolType*.draw](#symbolType_draw). -# symbol.size([size]) +# symbol.size([size]) [<>](https://github.com/d3/d3-shape/blob/master/src/symbol.js#L37 "Source") If *size* is specified, sets the size to the specified function or number and returns this symbol generator. If *size* is not specified, returns the current size accessor, which defaults to: @@ -835,7 +835,7 @@ function size() { Specifying the size as a function is useful for constructing a scatterplot with a size encoding. If you wish to scale the symbol to fit a given bounding box, rather than by area, try [SVG’s getBBox](http://bl.ocks.org/mbostock/3dd515e692504c92ab65). -# symbol.context([context]) +# symbol.context([context]) [<>](https://github.com/d3/d3-shape/blob/master/src/symbol.js#L41 "Source") If *context* is specified, sets the context and returns this symbol generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated symbol](#_symbol) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated symbol is returned. @@ -843,31 +843,31 @@ If *context* is specified, sets the context and returns this symbol generator. I An array containing the set of all built-in symbol types: [circle](#symbolCircle), [cross](#symbolCross), [diamond](#symbolDiamond), [square](#symbolSquare), [star](#symbolStar), [triangle](#symbolTriangle), and [wye](#symbolWye). Useful for constructing the range of an [ordinal scale](https://github.com/d3/d3-scale#ordinal-scales) should you wish to use a shape encoding for categorical data. -# d3.symbolCircle +# d3.symbolCircle [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/circle.js "Source") The circle symbol type. -# d3.symbolCross +# d3.symbolCross [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/cross.js "Source") The Greek cross symbol type, with arms of equal length. -# d3.symbolDiamond +# d3.symbolDiamond [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/diamond.js "Source") The rhombus symbol type. -# d3.symbolSquare +# d3.symbolSquare [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/square.js "Source") The square symbol type. -# d3.symbolStar +# d3.symbolStar [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/star.js "Source") The pentagonal star (pentagram) symbol type. -# d3.symbolTriangle +# d3.symbolTriangle [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/triangle.js "Source") The up-pointing triangle symbol type. -# d3.symbolWye +# d3.symbolWye [<>](https://github.com/d3/d3-shape/blob/master/src/symbol/wye.js "Source") The Y-shape symbol type. @@ -889,11 +889,11 @@ Stacked charts can show overall value and per-category value simultaneously; how Like the [pie generator](#pies), the stack generator does not produce a shape directly. Instead it computes positions which you can then pass to an [area generator](#areas) or use directly, say to position bars. -# d3.stack() +# d3.stack() [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js "Source") Constructs a new stack generator with the default settings. -# stack(data[, arguments…]) +# stack(data[, arguments…]) [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js#L16 "Source") Generates a stack for the given array of *data*, returning an array representing each series. Any additional *arguments* are arbitrary; they are simply propagated to accessors along with the `this` object. @@ -943,11 +943,11 @@ The resulting array has one element per *series*. Each series has one point per Each series in then typically passed to an [area generator](#areas) to render an area chart, or used to construct rectangles for a bar chart. -# stack.keys([keys]) +# stack.keys([keys]) [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js#L40 "Source") If *keys* is specified, sets the keys accessor to the specified function or array and returns this stack generator. If *keys* is not specified, returns the current keys accessor, which defaults to the empty array. A series (layer) is [generated](#_stack) for each key. Keys are typically strings, but they may be arbitrary values. The series’ key is passed to the [value accessor](#stack_value), along with each data point, to compute the point’s value. -# stack.value([value]) +# stack.value([value]) [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js#L44 "Source") If *value* is specified, sets the value accessor to the specified function or number and returns this stack generator. If *value* is not specified, returns the current value accessor, which defaults to: @@ -959,7 +959,7 @@ function value(d, key) { Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see [*stack*](#_stack) for an example. -# stack.order([order]) +# stack.order([order]) [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js#L48 "Source") If *order* is specified, sets the order accessor to the specified function or array and returns this stack generator. If *order* is not specified, returns the current order acccesor, which defaults to [stackOrderNone](#stackOrderNone); this uses the order given by the [key accessor](#stack_key). See [stack orders](#stack-orders) for the built-in orders. @@ -975,7 +975,7 @@ function orderNone(series) { The stack order is computed prior to the [offset](#stack_offset); thus, the lower value for all points is zero at the time the order is computed. The index attribute for each series is also not set until after the order is computed. -# stack.offset([offset]) +# stack.offset([offset]) [<>](https://github.com/d3/d3-shape/blob/master/src/stack.js#L52 "Source") If *offset* is specified, sets the offset accessor to the specified function or array and returns this stack generator. If *offset* is not specified, returns the current offset acccesor, which defaults to [stackOffsetNone](#stackOffsetNone); this uses a zero baseline. See [stack offsets](#stack-offsets) for the built-in offsets. @@ -997,23 +997,23 @@ function offsetNone(series, order) { Stack orders are typically not used directly, but are instead passed to [*stack*.order](#stack_order). -# d3.stackOrderAscending(series) +# d3.stackOrderAscending(series) [<>](https://github.com/d3/d3-shape/blob/master/src/order/ascending.js "Source") Returns a series order such that the smallest series (according to the sum of values) is at the bottom. -# d3.stackOrderDescending(series) +# d3.stackOrderDescending(series) [<>](https://github.com/d3/d3-shape/blob/master/src/order/descending.js "Source") Returns a series order such that the largest series (according to the sum of values) is at the bottom. -# d3.stackOrderInsideOut(series) +# d3.stackOrderInsideOut(series) [<>](https://github.com/d3/d3-shape/blob/master/src/order/insideOut.js "Source") Returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside. This order is recommended for streamgraphs in conjunction with the [wiggle offset](#stackOffsetWiggle). See [Stacked Graphs—Geometry & Aesthetics](http://leebyron.com/streamgraph/) by Bryon & Wattenberg for more information. -# d3.stackOrderNone(series) +# d3.stackOrderNone(series) [<>](https://github.com/d3/d3-shape/blob/master/src/order/none.js "Source") Returns the given series order [0, 1, … *n* - 1] where *n* is the number of elements in *series*. Thus, the stack order is given by the [key accessor](#stack_keys). -# d3.stackOrderReverse(series) +# d3.stackOrderReverse(series) [<>](https://github.com/d3/d3-shape/blob/master/src/order/reverse.js "Source") Returns the reverse of the given series order [*n* - 1, *n* - 2, … 0] where *n* is the number of elements in *series*. Thus, the stack order is given by the reverse of the [key accessor](#stack_keys). @@ -1021,18 +1021,18 @@ Returns the reverse of the given series order [*n* - 1, *n* - 2, … 0] where *n Stack offsets are typically not used directly, but are instead passed to [*stack*.offset](#stack_offset). -# d3.stackOffsetExpand(series, order) +# d3.stackOffsetExpand(series, order) [<>](https://github.com/d3/d3-shape/blob/master/src/offset/expand.js "Source") Applies a zero baseline and normalizes the values for each point such that the topline is always one. -# d3.stackOffsetNone(series, order) +# d3.stackOffsetNone(series, order) [<>](https://github.com/d3/d3-shape/blob/master/src/offset/none.js "Source") Applies a zero baseline. -# d3.stackOffsetSilhouette(series, order) +# d3.stackOffsetSilhouette(series, order) [<>](https://github.com/d3/d3-shape/blob/master/src/offset/silhouette.js "Source") Shifts the baseline down such that the center of the streamgraph is always at zero. -# d3.stackOffsetWiggle(series, order) +# d3.stackOffsetWiggle(series, order) [<>](https://github.com/d3/d3-shape/blob/master/src/offset/wiggle.js "Source") Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the [inside-out order](#stackOrderInsideOut). See [Stacked Graphs—Geometry & Aesthetics](http://leebyron.com/streamgraph/) by Bryon & Wattenberg for more information.