Skip to content

Commit 792f0ec

Browse files
committed
better comparator type
1 parent c9f3db0 commit 792f0ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/transforms/stack.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {ChannelValue} from "../channel.js";
2-
import type {Transformed} from "./basic.js";
2+
import type {CompareFunction, Transformed} from "./basic.js";
33

44
/**
55
* A built-in stack offset method; one of:
@@ -62,15 +62,16 @@ export type StackOrderName = "value" | "x" | "y" | "z" | "sum" | "appearance" |
6262
*
6363
* - a named stack order method such as *inside-out* or *sum*
6464
* - a field name, for natural order of the corresponding values
65-
* - a function of data, for natural order of the corresponding values
65+
* - an accessor function, for natural order of the corresponding values
6666
* - a comparator function for ordering data
6767
* - an array of explicit **z** values in the desired order
6868
*/
6969
export type StackOrder =
7070
| StackOrderName
7171
| `-${StackOrderName}`
7272
| (string & Record<never, never>)
73-
| ((a: any, b: any) => any)
73+
| ((d: any) => any) // accessor
74+
| CompareFunction
7475
| any[];
7576

7677
/** Options for the stack transform. */

0 commit comments

Comments
 (0)