Skip to content

Commit 8b48a4a

Browse files
committed
explicit stack reverse
1 parent 6a5c034 commit 8b48a4a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/transforms/stack.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ Plot.plot({
184184
},
185185
color: {legend: true},
186186
marks: [
187-
Plot.areaY(riaa, {x: "year", y: "revenue", z: "format", fill: "group", order: "appearance", reverse}),
187+
Plot.areaY(riaa, Plot.stackY({order: "appearance", reverse}, {x: "year", y: "revenue", z: "format", fill: "group"})),
188188
Plot.ruleY([0])
189189
]
190190
})
191191
```
192192
:::
193193

194-
:::warning CAUTION
195-
The **reverse** option is also used by the [sort transform](./sort.md). To disambiguate, pass the *stack* options separately using the two-argument form of the stack transform.
194+
:::tip
195+
The **reverse** option is also used by the [sort transform](./sort.md). To disambiguate, pass the *stack* options separately using the two-argument form of the stack transform as above.
196196
:::
197197

198198
The *value* **order** is worth special mention: it sorts each stack by value independently such that the order of layers can change, emphasizing the changing ranks of layers. This is sometimes called a “ribbon” chart. (In fact, the default null **order** supports changing order of layers, too! But most often data comes already sorted by series.)
@@ -255,7 +255,7 @@ Plot.plot({
255255
percent: true
256256
},
257257
marks: [
258-
Plot.areaY(riaa, {x: "year", y: "revenue", z: "format", fill: "group", offset: "normalize", order: "group", reverse: true}),
258+
Plot.areaY(riaa, Plot.stackY({offset: "normalize", order: "group", reverse: true}, {x: "year", y: "revenue", z: "format", fill: "group"})),
259259
Plot.ruleY([0, 1])
260260
]
261261
})

0 commit comments

Comments
 (0)