You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1270,21 +1270,22 @@ Selects the highest point of each series.
1270
1270
1271
1271
The supported stack options are:
1272
1272
1273
-
-**order** - the order in which the data points are stacked
1273
+
-**offset** - the offset (or baseline) method
1274
+
-**order** - the order in which stacks are layered
1274
1275
-**reverse** - true to reverse order
1275
-
-**offset** - sets the offset (or baseline) method
1276
1276
1277
1277
The following order methods are supported:
1278
-
- null - default, stack the data points in input order
1279
-
-*value* - stack the data points in value order (from smaller to larger).
1280
1278
1281
-
These two methods do not ensure consistency of the series order across the stacks, and can lead to criss-crossing paths. The following methods, on the contrary, maintain a consistent order of series:
1282
-
-[array of *z* values] - stack the series in the order given by this arbitrary array of *z* values; the array will usually be defined manually or with [d3.groupSort](https://github.com/d3/d3-array/blob/master/README.md#groupSort)
1283
-
-*sum* - stack the series in the order given by the sums of their values; equivalent to [d3.stackOrderAscending](https://github.com/d3/d3-shape/blob/master/README.md#stackOrderAscending), and [d3.stackOrderDescending](https://github.com/d3/d3-shape/blob/master/README.md#stackOrderDescending) if combined with *reverse*.
1284
-
-*appearance* - stack the series in the order given by the location (*x*) of their maximum value; equivalent to [d3.stackOrderAppearance](https://github.com/d3/d3-shape/blob/master/README.md#stackOrderAppearance).
1285
-
-*inside-out* - stack the series in an order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside. This order is recommended for streamgraphs in conjunction with the wiggle offset. See [Stacked Graphs—Geometry & Aesthetics](http://leebyron.com/streamgraph/) by Byron & Wattenberg for more information. Equivalent to [d3.stackOrderInsideOut](https://github.com/d3/d3-shape/blob/master/README.md#stackOrderInsideOut).
1279
+
- null - input order
1280
+
-*value* - ascending value order (or descending with **reverse**)
1281
+
-*sum* - order series by their total value
1282
+
-*appearance* - order series by the position of their maximum value
1283
+
-*inside-out* - order the earliest-appearing series on the inside
1284
+
- an array of *z* values
1286
1285
1287
-
The **reverse** option reverses the order.
1286
+
The **reverse** option reverses the effective order. For the *value* order, Plot.stackY uses the *y*-value whereas Plot.stackX uses the *x*-value. For the *appearance* order, Plot.stackY uses the *x*-position of the maximum *y*-value, and Plot.stackX uses the *y*-position of the maximum *x*-value. If an array of *z* values are specified, they should correspond to the *z* values for all series, and specify the order of those series; this array is typically hard-coded or computed with [d3.groupSort](https://github.com/d3/d3-array/blob/master/README.md#groupSort). This *inside-out* order is recommended for streamgraphs in conjunction with the *wiggle* offset; see [Byron & Wattenberg](http://leebyron.com/streamgraph/).
1287
+
1288
+
The input order (null) and *value* order can lead to criss-crossing paths: unlike the other order methods, they do not guarantee a consistent series order across stacks.
1288
1289
1289
1290
The stacking algorithm tracks two values, *lo* and *hi*, both starting at zero for each stack. Considering the values in the given *order*, it progresses by adding non-negative values to the current *hi*, and negative values to the current *lo*. The value of *lo* or *hi* before adding is saved in *y1*, and the new value is saved in *y2*.
0 commit comments