From 06a8ebd826df3685610095adf8094a3cbffc0a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 17 Mar 2023 15:29:48 +0100 Subject: [PATCH 01/11] expand is deprecated; use normalize --- test/plots/industry-unemployment-share.ts | 2 +- test/plots/stacked-bar.ts | 2 +- test/plots/stacked-rect.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/plots/industry-unemployment-share.ts b/test/plots/industry-unemployment-share.ts index fd454cbd31..edfea6f2b5 100644 --- a/test/plots/industry-unemployment-share.ts +++ b/test/plots/industry-unemployment-share.ts @@ -15,7 +15,7 @@ export async function industryUnemploymentShare() { x: "date", y: "unemployed", fill: "industry", - offset: "expand", + offset: "normalize", title: "industry" }) ), diff --git a/test/plots/stacked-bar.ts b/test/plots/stacked-bar.ts index 9cb6f7af80..b4b6df65d2 100644 --- a/test/plots/stacked-bar.ts +++ b/test/plots/stacked-bar.ts @@ -12,7 +12,7 @@ export async function stackedBar() { x: (d, i) => i, fill: (d, i) => i, insetLeft: 1, - offset: "expand" + offset: "normalize" }) ) ] diff --git a/test/plots/stacked-rect.ts b/test/plots/stacked-rect.ts index fd491f9bc9..00d07e8de8 100644 --- a/test/plots/stacked-rect.ts +++ b/test/plots/stacked-rect.ts @@ -12,7 +12,7 @@ export async function stackedRect() { x: (d, i) => i, fill: (d, i) => i, insetLeft: 1, - offset: "expand" + offset: "normalize" } ) ] From 9937da5a7ea0ff65edac8966b91b646e64cefff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 17 Mar 2023 15:55:03 +0100 Subject: [PATCH 02/11] normalize is the reference, expand the deprecated value --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ada8ff287f..1529ae0605 100644 --- a/README.md +++ b/README.md @@ -2570,7 +2570,7 @@ The stack transform supports diverging stacks: negative values are stacked below After all values have been stacked from zero, an optional **offset** can be applied to translate or scale the stacks. The following **offset** methods are supported: - null (default) - a zero baseline -- *expand* (or *normalize*) - rescale each stack to fill [0, 1] +- *normalize* (or *expand*) - rescale each stack to fill [0, 1] - *center* (or *silhouette*) - align the centers of all stacks - *wiggle* - translate stacks to minimize apparent movement - a function to be passed a nested index, and start, end, and *z* values From 398f7cc33b1376464f638bac99956cf0c55946eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 17 Mar 2023 15:55:11 +0100 Subject: [PATCH 03/11] stackOptions --- src/transforms/stack.d.ts | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 73c48733d3..8cf8464f69 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -21,9 +21,53 @@ export type StackOrder = | any[]; // explicit ordinal values export interface StackOptions { + /** + * After all values have been stacked from zero, an optional **offset** can be + * applied to translate or scale the stacks: + * + * - null (default) - a zero baseline + * - *normalize* (or *expand*) - rescale each stack to fill [0, 1] + * - *center* (or *silhouette*) - align the centers of all stacks + * - *wiggle* - translate stacks to minimize apparent movement + * - a function to be passed a nested index, and start, end, and *z* values + * + * If a given stack has zero total value, the *expand* offset will not adjust + * the stack’s position. Both the *center* and *wiggle* offsets ensure that + * the lowest element across stacks starts at zero for better default axes. + * The *wiggle* offset is recommended for streamgraphs, and if used, changes + * the default order to *inside-out*. + */ offset?: StackOffset | null; + + /** + * The order in which stacks are layered: + * + * - null (default) - input order + * - *value* - ascending value order (or descending with **reverse**) + * - *sum* - order series by their total value + * - *appearance* - order series by the position of their maximum value + * - *inside-out* - order the earliest-appearing series on the inside + * (recommended for the *wiggle* offset) + * - a named field or function of data - order data by priority + * - an array enumerating all the *z* values in the desired order + * + * The **reverse** option reverses the effective order. For the *value* order, + * Plot.stackY uses the *y* value while Plot.stackX uses the *x* value. For + * the *appearance* order, Plot.stackY uses the *x* position of the maximum + * *y* value while Plot.stackX uses the *y* position of the maximum *x* value. + */ order?: StackOrder | null; + + /** + * If true, reverse the effective order of the stacks. + */ reverse?: boolean; + + /** + * The *z* channel defines the series of each value in the stack. Used when + * the *order* is sum, appearance, inside-out, or an explicit array of z + * values. + */ z?: ChannelValue; } From 2ae600f4d2ed8620d9abac2cff309b51aaa7d17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 17 Mar 2023 16:21:32 +0100 Subject: [PATCH 04/11] stack transforms --- src/transforms/stack.d.ts | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 8cf8464f69..83e82dc58e 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -71,26 +71,104 @@ export interface StackOptions { z?: ChannelValue; } +/** + * Transforms a length channel *x* into starting and ending position channels + * *x1* and *x2* by “stacking” elements that share a given *y* position. The + * starting position of each element equals the ending position of the preceding + * element in the stack. Non-positive values are stacked to the left of zero, + * with *x2* to the left of *x1*. A new *x* channel is derived that represents + * the midpoint between *x1* and *x2*, for example to place a label. If not + * specified, the input channel *x* defaults to the constant one. Elements can + * be stacked in a given *order*. After stacking, an optional *offset* can be + * applied. + */ export function stackX(options?: T & StackOptions): Transformed; +/** + * Transforms a length channel *x* into starting and ending position channels + * *x1* and *x2* by “stacking” elements that share a given *y* position. The + * starting position of each element equals the ending position of the preceding + * element in the stack. Non-positive values are stacked to the left of zero, + * with *x2* to the left of *x1*. A new *x* channel is derived that represents + * the midpoint between *x1* and *x2*, for example to place a label. If not + * specified, the input channel *x* defaults to the constant one. Elements can + * be stacked in a given *order*. After stacking, an optional *offset* can be + * applied. + */ export function stackX(stackOptions?: StackOptions, options?: T): Transformed; +/** + * Like **stackX**, but returns the starting position *x1* as the *x* channel, + * for example to position a dot on the left-hand side of each element of a + * stack. + */ export function stackX1(options?: T & StackOptions): Transformed; +/** + * Like **stackX**, but returns the starting position *x1* as the *x* channel, + * for example to position a dot on the left-hand side of each element of a + * stack. + */ export function stackX1(stackOptions?: StackOptions, options?: T): Transformed; +/** + * Like **stackX**, but returns the starting position *x2* as the *x* channel, + * for example to position a dot on the right-hand side of each element of a + * stack. + */ export function stackX2(options?: T & StackOptions): Transformed; +/** + * Like **stackX**, but returns the starting position *x2* as the *x* channel, + * for example to position a dot on the right-hand side of each element of a + * stack. + */ export function stackX2(stackOptions?: StackOptions, options?: T): Transformed; +/** + * Transforms a length channel *y* into starting and ending position channels + * *y1* and *y2* by “stacking” elements that share a given *x* position. The + * starting position of each element equals the ending position of the preceding + * element in the stack. Non-positive values are stacked below zero, with *y2* + * below *y1*. A new *y* channel is derived that represents the midpoint between + * *y1* and *y2*, for example to place a label. If not specified, the input + * channel *y* defaults to the constant one. Elements can be stacked in a given + * *order*. After stacking, an optional *offset* can be applied. + */ export function stackY(options?: T & StackOptions): Transformed; +/** + * Transforms a length channel *y* into starting and ending position channels + * *y1* and *y2* by “stacking” elements that share a given *x* position. The + * starting position of each element equals the ending position of the preceding + * element in the stack. Non-positive values are stacked below zero, with *y2* + * below *y1*. A new *y* channel is derived that represents the midpoint between + * *y1* and *y2*, for example to place a label. If not specified, the input + * channel *y* defaults to the constant one. Elements can be stacked in a given + * *order*. After stacking, an optional *offset* can be applied. + */ export function stackY(stackOptions?: StackOptions, options?: T): Transformed; +/** + * Like **stackY**, but returns the starting position *y1* as the *y* channel, + * for example to position a dot at the bottom of each element of a stack. + */ export function stackY1(options?: T & StackOptions): Transformed; +/** + * Like **stackY**, but returns the starting position *y1* as the *y* channel, + * for example to position a dot at the bottom of each element of a stack. + */ export function stackY1(stackOptions?: StackOptions, options?: T): Transformed; +/** + * Like **stackY**, but returns the ending position *y2* as the *y* channel, + * for example to position a dot at the top of each element of a stack. + */ export function stackY2(options?: T & StackOptions): Transformed; +/** + * Like **stackY**, but returns the ending position *y2* as the *y* channel, + * for example to position a dot at the top of each element of a stack. + */ export function stackY2(stackOptions?: StackOptions, options?: T): Transformed; From eb67c3ad8ff68883aa0841d8d7e15b9efbcc14b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Mon, 20 Mar 2023 09:42:09 +0100 Subject: [PATCH 05/11] avoid duplications --- src/transforms/stack.d.ts | 45 --------------------------------------- 1 file changed, 45 deletions(-) diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 83e82dc58e..456a13802b 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -83,18 +83,6 @@ export interface StackOptions { * applied. */ export function stackX(options?: T & StackOptions): Transformed; - -/** - * Transforms a length channel *x* into starting and ending position channels - * *x1* and *x2* by “stacking” elements that share a given *y* position. The - * starting position of each element equals the ending position of the preceding - * element in the stack. Non-positive values are stacked to the left of zero, - * with *x2* to the left of *x1*. A new *x* channel is derived that represents - * the midpoint between *x1* and *x2*, for example to place a label. If not - * specified, the input channel *x* defaults to the constant one. Elements can - * be stacked in a given *order*. After stacking, an optional *offset* can be - * applied. - */ export function stackX(stackOptions?: StackOptions, options?: T): Transformed; /** @@ -103,12 +91,6 @@ export function stackX(stackOptions?: StackOptions, options?: T): Transformed * stack. */ export function stackX1(options?: T & StackOptions): Transformed; - -/** - * Like **stackX**, but returns the starting position *x1* as the *x* channel, - * for example to position a dot on the left-hand side of each element of a - * stack. - */ export function stackX1(stackOptions?: StackOptions, options?: T): Transformed; /** @@ -117,12 +99,6 @@ export function stackX1(stackOptions?: StackOptions, options?: T): Transforme * stack. */ export function stackX2(options?: T & StackOptions): Transformed; - -/** - * Like **stackX**, but returns the starting position *x2* as the *x* channel, - * for example to position a dot on the right-hand side of each element of a - * stack. - */ export function stackX2(stackOptions?: StackOptions, options?: T): Transformed; /** @@ -136,17 +112,6 @@ export function stackX2(stackOptions?: StackOptions, options?: T): Transforme * *order*. After stacking, an optional *offset* can be applied. */ export function stackY(options?: T & StackOptions): Transformed; - -/** - * Transforms a length channel *y* into starting and ending position channels - * *y1* and *y2* by “stacking” elements that share a given *x* position. The - * starting position of each element equals the ending position of the preceding - * element in the stack. Non-positive values are stacked below zero, with *y2* - * below *y1*. A new *y* channel is derived that represents the midpoint between - * *y1* and *y2*, for example to place a label. If not specified, the input - * channel *y* defaults to the constant one. Elements can be stacked in a given - * *order*. After stacking, an optional *offset* can be applied. - */ export function stackY(stackOptions?: StackOptions, options?: T): Transformed; /** @@ -154,11 +119,6 @@ export function stackY(stackOptions?: StackOptions, options?: T): Transformed * for example to position a dot at the bottom of each element of a stack. */ export function stackY1(options?: T & StackOptions): Transformed; - -/** - * Like **stackY**, but returns the starting position *y1* as the *y* channel, - * for example to position a dot at the bottom of each element of a stack. - */ export function stackY1(stackOptions?: StackOptions, options?: T): Transformed; /** @@ -166,9 +126,4 @@ export function stackY1(stackOptions?: StackOptions, options?: T): Transforme * for example to position a dot at the top of each element of a stack. */ export function stackY2(options?: T & StackOptions): Transformed; - -/** - * Like **stackY**, but returns the ending position *y2* as the *y* channel, - * for example to position a dot at the top of each element of a stack. - */ export function stackY2(stackOptions?: StackOptions, options?: T): Transformed; From 5a0814bc147fc4cd01a46c32854d795db8b8d70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 21 Mar 2023 11:00:15 +0100 Subject: [PATCH 06/11] mark *x* and *y* as being an alias of *value* --- README.md | 1 + src/transforms/stack.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 1529ae0605..ea0248d87a 100644 --- a/README.md +++ b/README.md @@ -2557,6 +2557,7 @@ The following **order** methods are supported: - null (default) - input order - *value* - ascending value order (or descending with **reverse**) +- *x* for stackY, or *y* for stackX - alias of *value* - *sum* - order series by their total value - *appearance* - order series by the position of their maximum value - *inside-out* - order the earliest-appearing series on the inside diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 456a13802b..5246c648c4 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -44,6 +44,7 @@ export interface StackOptions { * * - null (default) - input order * - *value* - ascending value order (or descending with **reverse**) + * - *x* for stackY, or *y* for stackX - alias of *value* * - *sum* - order series by their total value * - *appearance* - order series by the position of their maximum value * - *inside-out* - order the earliest-appearing series on the inside From 239e92564d347e8555e1ccc832a5990ef64dff66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 22 Mar 2023 09:45:05 +0100 Subject: [PATCH 07/11] Update src/transforms/stack.d.ts Co-authored-by: Mike Bostock --- src/transforms/stack.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 5246c648c4..6388a9b2b5 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -26,8 +26,8 @@ export interface StackOptions { * applied to translate or scale the stacks: * * - null (default) - a zero baseline - * - *normalize* (or *expand*) - rescale each stack to fill [0, 1] - * - *center* (or *silhouette*) - align the centers of all stacks + * - *normalize* - rescale each stack to fill [0, 1] + * - *center* - align the centers of all stacks * - *wiggle* - translate stacks to minimize apparent movement * - a function to be passed a nested index, and start, end, and *z* values * From d260da696aac26cf8946be893433986ee125e7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 22 Mar 2023 09:45:17 +0100 Subject: [PATCH 08/11] Update src/transforms/stack.d.ts Co-authored-by: Mike Bostock --- src/transforms/stack.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 6388a9b2b5..bf57108a45 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -44,7 +44,8 @@ export interface StackOptions { * * - null (default) - input order * - *value* - ascending value order (or descending with **reverse**) - * - *x* for stackY, or *y* for stackX - alias of *value* + * - *x* - alias of *value*; for stackY only + * - *y* - alias of *value*; for stackX only * - *sum* - order series by their total value * - *appearance* - order series by the position of their maximum value * - *inside-out* - order the earliest-appearing series on the inside From 8a922fc9f3107cafd98bc6f4f99bf4da0ed82a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 22 Mar 2023 09:50:51 +0100 Subject: [PATCH 09/11] simpler --- README.md | 10 ++++++---- src/transforms/stack.d.ts | 9 ++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ea0248d87a..debcf296c4 100644 --- a/README.md +++ b/README.md @@ -2557,10 +2557,12 @@ The following **order** methods are supported: - null (default) - input order - *value* - ascending value order (or descending with **reverse**) -- *x* for stackY, or *y* for stackX - alias of *value* +- *x* - alias of *value*; for stackY only +- *y* - alias of *value*; for stackX only - *sum* - order series by their total value - *appearance* - order series by the position of their maximum value -- *inside-out* - order the earliest-appearing series on the inside +- *inside-out* - order the earliest-appearing series on the inside (default for + the *wiggle* offset) - a named field or function of data - order data by priority - an array of *z* values @@ -2571,8 +2573,8 @@ The stack transform supports diverging stacks: negative values are stacked below After all values have been stacked from zero, an optional **offset** can be applied to translate or scale the stacks. The following **offset** methods are supported: - null (default) - a zero baseline -- *normalize* (or *expand*) - rescale each stack to fill [0, 1] -- *center* (or *silhouette*) - align the centers of all stacks +- *normalize* - rescale each stack to fill [0, 1] +- *center* - align the centers of all stacks - *wiggle* - translate stacks to minimize apparent movement - a function to be passed a nested index, and start, end, and *z* values diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index bf57108a45..119f2176b8 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -48,15 +48,10 @@ export interface StackOptions { * - *y* - alias of *value*; for stackX only * - *sum* - order series by their total value * - *appearance* - order series by the position of their maximum value - * - *inside-out* - order the earliest-appearing series on the inside - * (recommended for the *wiggle* offset) + * - *inside-out* - order the earliest-appearing series on the inside (default + * for the *wiggle* offset) * - a named field or function of data - order data by priority * - an array enumerating all the *z* values in the desired order - * - * The **reverse** option reverses the effective order. For the *value* order, - * Plot.stackY uses the *y* value while Plot.stackX uses the *x* value. For - * the *appearance* order, Plot.stackY uses the *x* position of the maximum - * *y* value while Plot.stackX uses the *y* position of the maximum *x* value. */ order?: StackOrder | null; From 84324b06d57b5d6bc655614efa1fb22049b74a7e Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 22 Mar 2023 17:48:27 -0700 Subject: [PATCH 10/11] tweaks --- README.md | 4 ++-- src/transforms/stack.d.ts | 41 ++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index debcf296c4..7ebc8b843c 100644 --- a/README.md +++ b/README.md @@ -2557,8 +2557,8 @@ The following **order** methods are supported: - null (default) - input order - *value* - ascending value order (or descending with **reverse**) -- *x* - alias of *value*; for stackY only -- *y* - alias of *value*; for stackX only +- *x* - alias of *value*; for stackX only +- *y* - alias of *value*; for stackY only - *sum* - order series by their total value - *appearance* - order series by the position of their maximum value - *inside-out* - order the earliest-appearing series on the inside (default for diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 119f2176b8..45b7413e8d 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -8,18 +8,21 @@ export type StackOffsetName = | ("expand" & Record) // deprecated; use normalize | ("silhouette" & Record); // deprecated; use center -export type StackOffsetFunction = (stacks: number[][][], y1: number[], y2: number[], z: any[]) => void; +export type StackOffsetFunction = (index: number[][][], y1: number[], y2: number[], z: any[]) => void; +/** How the baseline of stacked layers may be offset. */ export type StackOffset = StackOffsetName | StackOffsetFunction; export type StackOrderName = "value" | "x" | "y" | "z" | "sum" | "appearance" | "inside-out"; +/** How to order layers prior to stacking. */ export type StackOrder = | StackOrderName | (string & Record) // field name; see also https://github.com/microsoft/TypeScript/issues/29729 | ((d: any, i: number) => any) // function of data | any[]; // explicit ordinal values +/** Options for the stack transform. */ export interface StackOptions { /** * After all values have been stacked from zero, an optional **offset** can be @@ -35,7 +38,9 @@ export interface StackOptions { * the stack’s position. Both the *center* and *wiggle* offsets ensure that * the lowest element across stacks starts at zero for better default axes. * The *wiggle* offset is recommended for streamgraphs, and if used, changes - * the default order to *inside-out*. + * the default **order** to *inside-out*. + * + * For details on the *wiggle* offset, see [Byron & Wattenberg](http://leebyron.com/streamgraph/). */ offset?: StackOffset | null; @@ -43,27 +48,26 @@ export interface StackOptions { * The order in which stacks are layered: * * - null (default) - input order - * - *value* - ascending value order (or descending with **reverse**) - * - *x* - alias of *value*; for stackY only - * - *y* - alias of *value*; for stackX only - * - *sum* - order series by their total value - * - *appearance* - order series by the position of their maximum value - * - *inside-out* - order the earliest-appearing series on the inside (default - * for the *wiggle* offset) - * - a named field or function of data - order data by priority + * - *value* - ascending value (or descending with **reverse**) + * - *x* - alias of *value*; for stackX only + * - *y* - alias of *value*; for stackY only + * - *sum* - total value per series + * - *appearance* - position of maximum value per series + * - *inside-out* (default with *wiggle*) - order the earliest-appearing series on the inside + * - a named field or function of data - natural order * - an array enumerating all the *z* values in the desired order + * + * For details on the *inside-out* order, see [Byron & Wattenberg](http://leebyron.com/streamgraph/). */ order?: StackOrder | null; - /** - * If true, reverse the effective order of the stacks. - */ + /** If true, reverse the effective order of the stacks. */ reverse?: boolean; /** * The *z* channel defines the series of each value in the stack. Used when - * the *order* is sum, appearance, inside-out, or an explicit array of z - * values. + * the **order** is *sum*, *appearance*, *inside-out*, or an explicit array of + * *z* values. */ z?: ChannelValue; } @@ -75,9 +79,7 @@ export interface StackOptions { * element in the stack. Non-positive values are stacked to the left of zero, * with *x2* to the left of *x1*. A new *x* channel is derived that represents * the midpoint between *x1* and *x2*, for example to place a label. If not - * specified, the input channel *x* defaults to the constant one. Elements can - * be stacked in a given *order*. After stacking, an optional *offset* can be - * applied. + * specified, the input channel *x* defaults to the constant one. */ export function stackX(options?: T & StackOptions): Transformed; export function stackX(stackOptions?: StackOptions, options?: T): Transformed; @@ -105,8 +107,7 @@ export function stackX2(stackOptions?: StackOptions, options?: T): Transforme * element in the stack. Non-positive values are stacked below zero, with *y2* * below *y1*. A new *y* channel is derived that represents the midpoint between * *y1* and *y2*, for example to place a label. If not specified, the input - * channel *y* defaults to the constant one. Elements can be stacked in a given - * *order*. After stacking, an optional *offset* can be applied. + * channel *y* defaults to the constant one. */ export function stackY(options?: T & StackOptions): Transformed; export function stackY(stackOptions?: StackOptions, options?: T): Transformed; From 05eb2e73e29db3dc028e91addc5139bbf60b59e1 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 22 Mar 2023 17:49:51 -0700 Subject: [PATCH 11/11] Update README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ebc8b843c..ccbdf16f59 100644 --- a/README.md +++ b/README.md @@ -2561,8 +2561,7 @@ The following **order** methods are supported: - *y* - alias of *value*; for stackY only - *sum* - order series by their total value - *appearance* - order series by the position of their maximum value -- *inside-out* - order the earliest-appearing series on the inside (default for - the *wiggle* offset) +- *inside-out* (default with *wiggle*) - order the earliest-appearing series on the inside - a named field or function of data - order data by priority - an array of *z* values