|
1 | | -import type {Channel} from "./channel.js"; |
2 | | - |
3 | 1 | type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; |
4 | 2 |
|
5 | 3 | export type ReducerPercentile = |
@@ -29,36 +27,9 @@ export type ReducerName = |
29 | 27 |
|
30 | 28 | export type ReducerFunction = (values: any[]) => any; |
31 | 29 |
|
32 | | -export type ReducerImplementation = |
33 | | - | { |
34 | | - reduce: ReducerName; |
35 | | - scale?: Channel["scale"]; |
36 | | - } |
37 | | - | { |
38 | | - reduce(index: number[], values: any[]): any; |
39 | | - } |
40 | | - | { |
41 | | - reduce(index: number[], values: any[], summary?: any): any; |
42 | | - scope: "data" | "facet"; |
43 | | - }; |
44 | | - |
45 | | -export type BinReducerImplementation = |
46 | | - | { |
47 | | - reduce: BinReducerName; |
48 | | - scale?: Channel["scale"]; |
49 | | - } |
50 | | - | { |
51 | | - reduce(index: number[], values: any[], extent: {x1: any; y1: any; x2: any; y2: any}): any; |
52 | | - } |
53 | | - | { |
54 | | - reduce(index: number[], values: any[], summary?: any, extent?: {x1: any; y1: any; x2: any; y2: any}): any; |
55 | | - scope: "data" | "facet"; |
56 | | - }; |
| 30 | +// TODO scope, label |
| 31 | +export interface ReducerImplementation { |
| 32 | + reduce(index: number[], values: any[]): any; |
| 33 | +} |
57 | 34 |
|
58 | 35 | export type Reducer = ReducerName | ReducerFunction | ReducerImplementation; |
59 | | - |
60 | | -type BinReducerFunction = (values: any[], extent: {x1: any; y1: any; x2: any; y2: any}) => any; |
61 | | - |
62 | | -type BinReducerName = ReducerName | "x" | "x1" | "x2" | "y" | "y1" | "y2"; |
63 | | - |
64 | | -export type BinReducer = BinReducerName | BinReducerFunction | BinReducerImplementation; |
0 commit comments