@sportsdataverse/sdvtables 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -112
- package/data/table_themes.json +12136 -0
- package/data/table_themes.json.sha256 +1 -0
- package/dist/aggrid.d.ts +104 -0
- package/dist/aggrid.js +230 -0
- package/dist/aggrid.js.map +1 -0
- package/dist/chunk-3TJR7TKS.js +223 -0
- package/dist/chunk-3TJR7TKS.js.map +1 -0
- package/dist/{chunk-UCRLJGDL.js → chunk-R375P3MN.js} +963 -276
- package/dist/chunk-R375P3MN.js.map +1 -0
- package/dist/chunk-UTOVFIFT.js +15176 -0
- package/dist/chunk-UTOVFIFT.js.map +1 -0
- package/dist/{chunk-U6W6MWKW.js → chunk-VLF2S6VW.js} +7 -5
- package/dist/chunk-VLF2S6VW.js.map +1 -0
- package/dist/chunk-WBTFIGYK.js +189 -0
- package/dist/chunk-WBTFIGYK.js.map +1 -0
- package/dist/{engine-CkfxYXAL.d.ts → engine-BFIPJUlC.d.ts} +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +4 -3
- package/dist/export.js.map +1 -1
- package/dist/html.d.ts +8 -5
- package/dist/html.js +4 -3
- package/dist/index.d.ts +121 -8
- package/dist/index.js +51 -3
- package/dist/index.js.map +1 -1
- package/dist/mui.d.ts +134 -0
- package/dist/mui.js +193 -0
- package/dist/mui.js.map +1 -0
- package/dist/react.d.ts +2 -2
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/dist/spec-A88vJX5A.d.ts +748 -0
- package/dist/tanstack-table.d.ts +113 -0
- package/dist/tanstack-table.js +98 -0
- package/dist/tanstack-table.js.map +1 -0
- package/dist/{tokens-CpYFsFtf.d.ts → tokens-CHwBt9gs.d.ts} +1 -1
- package/package.json +40 -3
- package/dist/chunk-4VKYHOHL.js +0 -2081
- package/dist/chunk-4VKYHOHL.js.map +0 -1
- package/dist/chunk-U6W6MWKW.js.map +0 -1
- package/dist/chunk-UCRLJGDL.js.map +0 -1
- package/dist/spec-BEhLDtj_.d.ts +0 -430
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
import { League, SeasonInput, IdSystem, Variant, EspnHeadshotLeague, HeadshotIdSystem, Which } from '@sportsdataverse/sdvplot';
|
|
2
|
+
|
|
3
|
+
type Density = "comfortable" | "compact" | "social";
|
|
4
|
+
type Align = "left" | "center" | "right";
|
|
5
|
+
/** `& keyof Row & string`: a mapped-type index alone is not provably a string key of Row (TS2344 otherwise). */
|
|
6
|
+
type NumericKey<Row> = {
|
|
7
|
+
[K in keyof Row]-?: Row[K] extends number | null | undefined ? K : never;
|
|
8
|
+
}[keyof Row] & keyof Row & string;
|
|
9
|
+
/**
|
|
10
|
+
* The keys of `Row` whose values are arrays of numbers: the series an in-cell chart (`sparkline`, `sparkbar`) draws.
|
|
11
|
+
* A `null` entry (or any non-finite number: `NaN`, `Infinity`) is a gap; a missing or empty array leaves the cell blank.
|
|
12
|
+
*/
|
|
13
|
+
type SeriesKey<Row> = {
|
|
14
|
+
[K in keyof Row]-?: Row[K] extends readonly (number | null)[] | null | undefined ? K : never;
|
|
15
|
+
}[keyof Row] & keyof Row & string;
|
|
16
|
+
type StringKey<Row> = {
|
|
17
|
+
[K in keyof Row]-?: Row[K] extends string | null | undefined ? K : never;
|
|
18
|
+
}[keyof Row] & keyof Row & string;
|
|
19
|
+
type PredicateOp = "==" | "!=" | ">" | ">=" | "<" | "<=" | "in" | "notIn" | "isNull" | "notNull" | "matches";
|
|
20
|
+
interface Predicate<Row> {
|
|
21
|
+
readonly key: keyof Row & string;
|
|
22
|
+
readonly op: PredicateOp;
|
|
23
|
+
readonly value?: unknown;
|
|
24
|
+
}
|
|
25
|
+
type RowSelector<Row> = readonly number[] | Predicate<Row>;
|
|
26
|
+
interface ColumnBase<Row, K extends keyof Row & string = keyof Row & string> {
|
|
27
|
+
readonly key: K;
|
|
28
|
+
readonly label?: string;
|
|
29
|
+
readonly subheader?: string;
|
|
30
|
+
readonly align?: Align;
|
|
31
|
+
/** CSS width of the column, written on its `<th>` (e.g. "220px"). */
|
|
32
|
+
readonly width?: string;
|
|
33
|
+
/** Phase 5 (headless engine) — accepted and ignored by renderHTML. */
|
|
34
|
+
readonly sortable?: boolean;
|
|
35
|
+
readonly filterable?: boolean;
|
|
36
|
+
/** Phase 5 — the one non-serializable field (JSON.stringify drops it). A method signature, so a numeric kind's comparator still fits `ColumnBase<Row>`. */
|
|
37
|
+
compare?(a: Row[K], b: Row[K]): number;
|
|
38
|
+
/** reactablefmtr `tooltip = TRUE`: the cell's formatted value as its `title` attribute (no tooltip library). */
|
|
39
|
+
readonly tooltip?: boolean;
|
|
40
|
+
}
|
|
41
|
+
type FormatType = "number" | "comma" | "currency" | "percent";
|
|
42
|
+
interface TeamOpts {
|
|
43
|
+
readonly league: League;
|
|
44
|
+
readonly season?: SeasonInput;
|
|
45
|
+
readonly idSystem?: IdSystem;
|
|
46
|
+
readonly strict?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* How a reactablefmtr-style kind prints its number (reactablefmtr `number_fmt`): `value * scale`, then `digits`
|
|
50
|
+
* decimals (default: as many as the value needs, up to 7 significant figures), then the `type` (`comma` groups
|
|
51
|
+
* thousands, `currency` adds `$`, `percent` adds `%`), wrapped in `prefix` and `suffix`.
|
|
52
|
+
*/
|
|
53
|
+
interface NumberFormat {
|
|
54
|
+
readonly digits?: number;
|
|
55
|
+
readonly type?: FormatType;
|
|
56
|
+
readonly scale?: number;
|
|
57
|
+
readonly prefix?: string;
|
|
58
|
+
readonly suffix?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Per-row colour for a reactablefmtr-style kind (reactablefmtr `fill_color_ref` / `color_ref`): `colorRef` names a
|
|
62
|
+
* column holding a hex colour or CSS colour name (`"steelblue"`) per row; or `team` names a column of team names/ids,
|
|
63
|
+
* resolved in `league` to the team's `which` colour. `colorRef` wins over `team`. Any other `colorRef` value (blank,
|
|
64
|
+
* unknown name, `rgb()`, `url(...)`) counts as no row colour: never written to CSS, the row falls back to `team`, then
|
|
65
|
+
* the kind's own scale (or `iconSet`'s bucket colour). A `dataBar` with `gradient: true` ignores both, as reactablefmtr
|
|
66
|
+
* does (`fill_gradient` drops `fill_color_ref`).
|
|
67
|
+
*/
|
|
68
|
+
interface ColorRefOpts<Row> {
|
|
69
|
+
readonly colorRef?: keyof Row & string;
|
|
70
|
+
readonly team?: keyof Row & string;
|
|
71
|
+
readonly league?: League;
|
|
72
|
+
readonly which?: Which;
|
|
73
|
+
readonly season?: SeasonInput;
|
|
74
|
+
readonly idSystem?: IdSystem;
|
|
75
|
+
readonly strict?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A logo, wordmark or headshot beside a value (reactablefmtr `img_ref`): `logo` and `wordmark` read the column's
|
|
79
|
+
* `team` (resolved in `league`); `headshot` reads the ESPN athlete id in `markKey`. `markHeight` is in pixels.
|
|
80
|
+
*/
|
|
81
|
+
interface MarkOpts<Row> {
|
|
82
|
+
readonly mark?: "logo" | "wordmark" | "headshot";
|
|
83
|
+
readonly markKey?: keyof Row & string;
|
|
84
|
+
readonly markHeight?: number;
|
|
85
|
+
}
|
|
86
|
+
/** The inline-SVG icons iconSet and iconAssign draw (no icon font). */
|
|
87
|
+
type IconName = "circle" | "square" | "diamond" | "star" | "triangle-up" | "triangle-down" | "arrow-up" | "arrow-down" | "arrow-right" | "check" | "xmark" | "minus" | "plus" | "heart";
|
|
88
|
+
/** Where text sits on a data bar (reactablefmtr `text_position`). */
|
|
89
|
+
type BarTextPosition = "inside-end" | "outside-end" | "inside-base" | "outside-base" | "center" | "above" | "none";
|
|
90
|
+
/** A point of a series: its first, last, minimum or maximum present value (the first of ties), or every point ("all"). */
|
|
91
|
+
type SeriesPoint = "first" | "last" | "min" | "max" | "all";
|
|
92
|
+
/**
|
|
93
|
+
* Points (or bars) to mark: a list of names, each drawn in red, or a colour per name, as reactablefmtr's
|
|
94
|
+
* `highlight_points(min = "red", max = "blue")`. Where two names fall on one point, the later of first, last, min,
|
|
95
|
+
* max wins; "all" colours every point the others do not.
|
|
96
|
+
*/
|
|
97
|
+
type SeriesHighlight = readonly SeriesPoint[] | Readonly<Partial<Record<SeriesPoint, string>>>;
|
|
98
|
+
/** A sparkline / sparkbar reference line (reactablefmtr `statline`): at the series' mean, median, minimum or maximum. */
|
|
99
|
+
type SeriesStat = "mean" | "median" | "min" | "max";
|
|
100
|
+
/** A sparkline / sparkbar shaded band (reactablefmtr `bandline`): the inner quartiles (R type 7) or the whole range. */
|
|
101
|
+
type SeriesBand = "innerquartiles" | "range";
|
|
102
|
+
/** The options `sparkline` and `sparkbar` share (reactablefmtr `react_sparkline` / `react_sparkbar`). */
|
|
103
|
+
interface SeriesChartOpts {
|
|
104
|
+
/** A dashed reference line across the chart, labelled at its right end. */
|
|
105
|
+
readonly statline?: SeriesStat;
|
|
106
|
+
/** The reference line's and its label's colour (reactablefmtr: red). */
|
|
107
|
+
readonly statlineColor: string;
|
|
108
|
+
/** The reference line label's CSS font size. */
|
|
109
|
+
readonly statlineLabelSize: string;
|
|
110
|
+
/** A shaded band across the chart (reactablefmtr `bandline`). */
|
|
111
|
+
readonly bandline?: SeriesBand;
|
|
112
|
+
/** The band's colour (reactablefmtr: red). */
|
|
113
|
+
readonly bandlineColor: string;
|
|
114
|
+
/** The band's opacity, 0 to 1. */
|
|
115
|
+
readonly bandlineOpacity: number;
|
|
116
|
+
/** Values to print by their point or bar ("all" prints every one); empty prints none. */
|
|
117
|
+
readonly labels: readonly SeriesPoint[];
|
|
118
|
+
/** The value labels' CSS font size. */
|
|
119
|
+
readonly labelSize: string;
|
|
120
|
+
/** Decimal places of the value labels and the reference line label. */
|
|
121
|
+
readonly decimals: number;
|
|
122
|
+
/** The value at the bottom of every cell's chart; default: each series' own minimum (sparkbar: the lower of 0 and it). */
|
|
123
|
+
readonly minValue?: number;
|
|
124
|
+
/** The value at the top of every cell's chart; default: each series' own maximum (sparkbar: the higher of 0 and it). */
|
|
125
|
+
readonly maxValue?: number;
|
|
126
|
+
/**
|
|
127
|
+
* The chart's height in px (reactablefmtr `height`). Default (undefined): 22, grown to 28 or 30 when labels sit
|
|
128
|
+
* above the points, as in reactablefmtr; any number given is used as is, 22 included.
|
|
129
|
+
*/
|
|
130
|
+
readonly chartHeight?: number;
|
|
131
|
+
/** The chart's width in px (`width` is the column's CSS width, as on every kind). */
|
|
132
|
+
readonly chartWidth: number;
|
|
133
|
+
}
|
|
134
|
+
type ColumnSpec<Row> = (ColumnBase<Row> & {
|
|
135
|
+
readonly kind: "text";
|
|
136
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
137
|
+
readonly kind: "num";
|
|
138
|
+
readonly digits?: number;
|
|
139
|
+
readonly big?: boolean;
|
|
140
|
+
readonly prefix?: string;
|
|
141
|
+
readonly suffix?: string;
|
|
142
|
+
readonly forceSign?: boolean;
|
|
143
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
144
|
+
readonly kind: "int";
|
|
145
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
146
|
+
readonly kind: "pct";
|
|
147
|
+
readonly digits: number;
|
|
148
|
+
readonly scale: boolean;
|
|
149
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
150
|
+
readonly kind: "rank";
|
|
151
|
+
readonly superscript: boolean;
|
|
152
|
+
readonly suffixSize: string;
|
|
153
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
154
|
+
readonly kind: "delta";
|
|
155
|
+
readonly to: NumericKey<Row>;
|
|
156
|
+
readonly percent: boolean;
|
|
157
|
+
readonly decimals: number;
|
|
158
|
+
readonly arrows: boolean;
|
|
159
|
+
readonly color: boolean;
|
|
160
|
+
readonly colorPositive: string;
|
|
161
|
+
readonly colorNegative: string;
|
|
162
|
+
readonly colorNeutral?: string;
|
|
163
|
+
readonly forceSign: boolean;
|
|
164
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
165
|
+
readonly kind: "tally";
|
|
166
|
+
readonly keys: readonly NumericKey<Row>[];
|
|
167
|
+
readonly separator: string;
|
|
168
|
+
readonly share: boolean;
|
|
169
|
+
readonly shareOf: number;
|
|
170
|
+
readonly shareDecimals: number;
|
|
171
|
+
readonly shareLabel: string;
|
|
172
|
+
readonly sharePrefix: string;
|
|
173
|
+
readonly shareSuffix: string;
|
|
174
|
+
}) | (ColumnBase<Row> & TeamOpts & {
|
|
175
|
+
readonly kind: "logo";
|
|
176
|
+
readonly height: number;
|
|
177
|
+
readonly variant?: Variant;
|
|
178
|
+
readonly includeName: boolean;
|
|
179
|
+
}) | (ColumnBase<Row> & TeamOpts & {
|
|
180
|
+
readonly kind: "wordmark";
|
|
181
|
+
readonly height: number;
|
|
182
|
+
readonly variant?: Variant;
|
|
183
|
+
}) | (ColumnBase<Row> & {
|
|
184
|
+
readonly kind: "headshot";
|
|
185
|
+
readonly league: EspnHeadshotLeague;
|
|
186
|
+
readonly idSystem: HeadshotIdSystem;
|
|
187
|
+
readonly height: number;
|
|
188
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & ColorRefOpts<Row> & {
|
|
189
|
+
/** `colorRef` / `team` (reactablefmtr `pill_buttons(color_ref)`): the pill takes the row's colour, not the scale's. */
|
|
190
|
+
readonly kind: "colorPills";
|
|
191
|
+
readonly palette: readonly string[];
|
|
192
|
+
readonly domain?: readonly [number, number];
|
|
193
|
+
readonly fillType: "continuous" | "rank";
|
|
194
|
+
readonly rankOrder: "asc" | "desc";
|
|
195
|
+
readonly digits?: number;
|
|
196
|
+
readonly formatType: FormatType;
|
|
197
|
+
readonly scalePercent: boolean;
|
|
198
|
+
readonly suffix: string;
|
|
199
|
+
readonly reverse: boolean;
|
|
200
|
+
readonly outlineColor?: string;
|
|
201
|
+
readonly outlineWidth: number;
|
|
202
|
+
readonly pillHeight: number;
|
|
203
|
+
readonly textColor?: string;
|
|
204
|
+
readonly naColor?: string;
|
|
205
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & ColorRefOpts<Row> & {
|
|
206
|
+
/** reactablefmtr `color_tiles` / `color_scales`: fills the cell on a scale (`colorRef` / `team`: the row's colour). */
|
|
207
|
+
readonly kind: "colorRanks";
|
|
208
|
+
readonly palette: readonly string[];
|
|
209
|
+
readonly domain?: readonly [number, number];
|
|
210
|
+
readonly reverse: boolean;
|
|
211
|
+
/** grDevices::colorRamp `bias` (default 1): the palette stops sit at `(i / (n - 1)) ^ bias`; above 1 spreads the high end. */
|
|
212
|
+
readonly bias?: number;
|
|
213
|
+
/** reactablefmtr `span`: `true` takes the domain from every numeric column of the rows, a list from those columns. */
|
|
214
|
+
readonly span?: boolean | readonly (keyof Row & string)[];
|
|
215
|
+
/** reactablefmtr `show_text` (default true): false keeps the colour and hides the value. */
|
|
216
|
+
readonly showText?: boolean;
|
|
217
|
+
/** reactablefmtr `even_breaks`: the palette's colours as equal-count buckets (dplyr::ntile), not a ramp. */
|
|
218
|
+
readonly evenBreaks?: boolean;
|
|
219
|
+
}) | (ColumnBase<Row> & {
|
|
220
|
+
readonly kind: "colorResults";
|
|
221
|
+
readonly winColor: string;
|
|
222
|
+
readonly lossColor: string;
|
|
223
|
+
readonly tieColor?: string;
|
|
224
|
+
readonly winTextColor: string;
|
|
225
|
+
readonly lossTextColor: string;
|
|
226
|
+
readonly tieTextColor: string;
|
|
227
|
+
readonly tieValue: unknown;
|
|
228
|
+
readonly resultType: "wl" | "binary";
|
|
229
|
+
}) | (ColumnBase<Row, NumericKey<Row>> & {
|
|
230
|
+
readonly kind: "percentileBar";
|
|
231
|
+
readonly domain: readonly [number, number];
|
|
232
|
+
readonly scale: "auto" | "none" | number;
|
|
233
|
+
readonly palette: readonly string[];
|
|
234
|
+
readonly reverse: boolean;
|
|
235
|
+
readonly trackColor: string;
|
|
236
|
+
readonly trackHeight: number;
|
|
237
|
+
readonly markerSize: number;
|
|
238
|
+
readonly textColor: string;
|
|
239
|
+
readonly fontSize?: number;
|
|
240
|
+
readonly ringColor?: string;
|
|
241
|
+
readonly ringWidth: number;
|
|
242
|
+
readonly fullTrack: boolean;
|
|
243
|
+
readonly naLabel?: string;
|
|
244
|
+
readonly naTrackColor?: string;
|
|
245
|
+
readonly naTextColor: string;
|
|
246
|
+
readonly decimals: number;
|
|
247
|
+
}) | (ColumnBase<Row> & {
|
|
248
|
+
readonly kind: "indicatorBox";
|
|
249
|
+
readonly truthy: readonly unknown[];
|
|
250
|
+
readonly fill: string;
|
|
251
|
+
readonly neutral: string;
|
|
252
|
+
readonly size: number;
|
|
253
|
+
readonly showOnly?: "filled" | "neutral";
|
|
254
|
+
}) | (ColumnBase<Row> & {
|
|
255
|
+
readonly kind: "highlight";
|
|
256
|
+
/** The cells to mark; ignored when `extreme` is set. */
|
|
257
|
+
readonly when?: Predicate<Row>;
|
|
258
|
+
/**
|
|
259
|
+
* reactablefmtr `highlight_min` / `highlight_max` / `highlight_min_max`: mark the column's minimum, maximum or
|
|
260
|
+
* both (every tie), in bold red (min) or green (max) unless `textColor` is given.
|
|
261
|
+
*/
|
|
262
|
+
readonly extreme?: "min" | "max" | "both";
|
|
263
|
+
readonly fill?: string;
|
|
264
|
+
readonly textColor?: string;
|
|
265
|
+
readonly bold: boolean;
|
|
266
|
+
}) | (ColumnBase<Row> & {
|
|
267
|
+
readonly kind: "highlightNa";
|
|
268
|
+
readonly fill?: string;
|
|
269
|
+
readonly textColor?: string;
|
|
270
|
+
readonly bold: boolean;
|
|
271
|
+
readonly italic: boolean;
|
|
272
|
+
readonly missingText?: string;
|
|
273
|
+
readonly naStrings: readonly string[];
|
|
274
|
+
readonly ignoreCase: boolean;
|
|
275
|
+
}) | (ColumnBase<Row> & TeamOpts & {
|
|
276
|
+
readonly kind: "mergeStackTeamColor";
|
|
277
|
+
readonly stack: keyof Row & string;
|
|
278
|
+
readonly team: keyof Row & string;
|
|
279
|
+
readonly fontSizeTop: number;
|
|
280
|
+
readonly fontSizeBottom: number;
|
|
281
|
+
readonly color: string;
|
|
282
|
+
readonly background?: string;
|
|
283
|
+
}) | (ColumnBase<Row> & TeamOpts & {
|
|
284
|
+
readonly kind: "teamColorBar";
|
|
285
|
+
readonly which: Which;
|
|
286
|
+
readonly naColor: string;
|
|
287
|
+
readonly barWidth: number;
|
|
288
|
+
}) | (ColumnBase<Row> & TeamOpts & {
|
|
289
|
+
readonly kind: "teamColorBg";
|
|
290
|
+
readonly which: Which;
|
|
291
|
+
readonly alpha: number;
|
|
292
|
+
readonly naColor: string;
|
|
293
|
+
}) | (ColumnBase<Row> & {
|
|
294
|
+
readonly kind: "image";
|
|
295
|
+
readonly height: string;
|
|
296
|
+
readonly alt?: keyof Row & string;
|
|
297
|
+
})
|
|
298
|
+
/**
|
|
299
|
+
* reactablefmtr `data_bars`: a horizontal bar per cell, its length `|value| / max|value|` (or scaled between
|
|
300
|
+
* `minValue` and `maxValue`). `align` ("left" | "right") is the side the bar grows from. One `fill` colour paints
|
|
301
|
+
* every bar; several are a ramp over the column's range (or, with `gradient`, a left-to-right gradient). A column
|
|
302
|
+
* with negatives (or `posNeg: true`) draws diverging bars around a centre line, `fill[0]` left and `fill[1]` right
|
|
303
|
+
* when two colours are given.
|
|
304
|
+
*/
|
|
305
|
+
| (ColumnBase<Row, NumericKey<Row>> & ColorRefOpts<Row> & MarkOpts<Row> & {
|
|
306
|
+
readonly kind: "dataBar";
|
|
307
|
+
readonly fill: readonly string[];
|
|
308
|
+
/** The track behind each bar (reactablefmtr `background`). */
|
|
309
|
+
readonly background: string;
|
|
310
|
+
readonly bias: number;
|
|
311
|
+
readonly minValue?: number;
|
|
312
|
+
readonly maxValue?: number;
|
|
313
|
+
readonly textPosition: BarTextPosition;
|
|
314
|
+
/** Text colour; default: black or white by contrast for text on the bar, the table's ink otherwise. */
|
|
315
|
+
readonly textColor?: string;
|
|
316
|
+
readonly numberFormat?: NumberFormat;
|
|
317
|
+
/** Bar thickness in px (default 18, or 5 for `textPosition: "above"`). */
|
|
318
|
+
readonly barHeight?: number;
|
|
319
|
+
readonly roundEdges: boolean;
|
|
320
|
+
/** Paint `fill` (2+ colours) as a left-to-right gradient; overrides `colorRef` / `team`, as reactablefmtr does. */
|
|
321
|
+
readonly gradient: boolean;
|
|
322
|
+
/** Diverging bars; default: when the column has a negative value. */
|
|
323
|
+
readonly posNeg?: boolean;
|
|
324
|
+
})
|
|
325
|
+
/**
|
|
326
|
+
* reactablefmtr `icon_sets`: the value with an icon, icons and colours each assigned by equal-count buckets of the
|
|
327
|
+
* column (dplyr::ntile): with three colours the bottom third gets `colors[0]`.
|
|
328
|
+
*/
|
|
329
|
+
| (ColumnBase<Row, NumericKey<Row>> & {
|
|
330
|
+
readonly kind: "iconSet";
|
|
331
|
+
readonly icons: readonly IconName[];
|
|
332
|
+
readonly colors: readonly string[];
|
|
333
|
+
readonly opacity: number;
|
|
334
|
+
readonly iconPosition: "left" | "right" | "above" | "below" | "over";
|
|
335
|
+
/** Icon size in px. */
|
|
336
|
+
readonly iconSize: number;
|
|
337
|
+
/** A column naming each row's icon (an `IconName`), instead of the buckets. */
|
|
338
|
+
readonly iconRef?: keyof Row & string;
|
|
339
|
+
/** A column holding each row's icon colour (hex or CSS colour name, else blank), instead of the buckets. */
|
|
340
|
+
readonly iconColorRef?: keyof Row & string;
|
|
341
|
+
readonly numberFormat?: NumberFormat;
|
|
342
|
+
})
|
|
343
|
+
/**
|
|
344
|
+
* reactablefmtr `icon_assign`: the value as a row of icons, one per unit up to the column's maximum, filled up to
|
|
345
|
+
* the (rounded) value; `buckets` shows the value's bucket out of `buckets` instead.
|
|
346
|
+
*/
|
|
347
|
+
| (ColumnBase<Row, NumericKey<Row>> & {
|
|
348
|
+
readonly kind: "iconAssign";
|
|
349
|
+
readonly icon: IconName;
|
|
350
|
+
readonly fill: string;
|
|
351
|
+
readonly empty: string;
|
|
352
|
+
readonly fillOpacity: number;
|
|
353
|
+
readonly emptyOpacity: number;
|
|
354
|
+
readonly iconSize: number;
|
|
355
|
+
readonly buckets?: number;
|
|
356
|
+
/** One icon per `seqBy` units (reactablefmtr `seq_by`). */
|
|
357
|
+
readonly seqBy: number;
|
|
358
|
+
readonly showValues: "none" | "left" | "right" | "above" | "below";
|
|
359
|
+
readonly numberFormat?: NumberFormat;
|
|
360
|
+
})
|
|
361
|
+
/**
|
|
362
|
+
* reactablefmtr `merge_column`: the cell's value with a second column's value beside it (`position`), each with its
|
|
363
|
+
* own size, colour, weight and style; optionally a logo, wordmark or headshot first.
|
|
364
|
+
*/
|
|
365
|
+
| (ColumnBase<Row> & MarkOpts<Row> & {
|
|
366
|
+
readonly kind: "mergeStack";
|
|
367
|
+
readonly stack: keyof Row & string;
|
|
368
|
+
readonly position: "right" | "left" | "above" | "below";
|
|
369
|
+
readonly size: number;
|
|
370
|
+
readonly color?: string;
|
|
371
|
+
readonly weight: "normal" | "bold";
|
|
372
|
+
readonly style: "normal" | "italic";
|
|
373
|
+
readonly stackSize: number;
|
|
374
|
+
readonly stackColor: string;
|
|
375
|
+
readonly stackWeight: "normal" | "bold";
|
|
376
|
+
readonly stackStyle: "normal" | "italic";
|
|
377
|
+
/** Extra space between the two values in px (reactablefmtr `spacing`; 3px always). */
|
|
378
|
+
readonly spacing: number;
|
|
379
|
+
/** The team column a logo or wordmark mark reads, resolved in `league`. */
|
|
380
|
+
readonly team?: keyof Row & string;
|
|
381
|
+
readonly league?: League;
|
|
382
|
+
readonly season?: SeasonInput;
|
|
383
|
+
readonly idSystem?: IdSystem;
|
|
384
|
+
readonly strict?: boolean;
|
|
385
|
+
})
|
|
386
|
+
/**
|
|
387
|
+
* reactablefmtr `bubble_grid`: a circle (or square) per cell, `maxSize * |value| / max|value|` px across, coloured on
|
|
388
|
+
* a ramp of the column's range (or the row's `colorRef` / `team` colour), with the value inside.
|
|
389
|
+
*/
|
|
390
|
+
| (ColumnBase<Row, NumericKey<Row>> & ColorRefOpts<Row> & {
|
|
391
|
+
readonly kind: "bubble";
|
|
392
|
+
readonly shape: "circles" | "squares";
|
|
393
|
+
readonly colors: readonly string[];
|
|
394
|
+
readonly bias: number;
|
|
395
|
+
readonly opacity: number;
|
|
396
|
+
readonly minValue?: number;
|
|
397
|
+
readonly maxValue?: number;
|
|
398
|
+
/** The largest bubble's size in px (reactablefmtr: 100). */
|
|
399
|
+
readonly maxSize: number;
|
|
400
|
+
readonly showText: boolean;
|
|
401
|
+
readonly textColor?: string;
|
|
402
|
+
readonly numberFormat?: NumberFormat;
|
|
403
|
+
})
|
|
404
|
+
/**
|
|
405
|
+
* reactablefmtr `react_sparkline`: each cell's array of numbers as a line, an inline `<svg role="img">` whose
|
|
406
|
+
* `aria-label` (and `<title>`) gives the count, minimum, maximum and last value. A gap breaks the line; a point with
|
|
407
|
+
* gaps on both sides draws as a dot. `colorRef` / `team` colours the line (and area) per row, a team colour checked
|
|
408
|
+
* for 3:1 contrast against the table background. Drawn without dataui: straight segments, no per-point tooltips.
|
|
409
|
+
*/
|
|
410
|
+
| (ColumnBase<Row, SeriesKey<Row>> & ColorRefOpts<Row> & SeriesChartOpts & {
|
|
411
|
+
readonly kind: "sparkline";
|
|
412
|
+
/** The line's colour when the row has no `colorRef` / team colour (reactablefmtr: slategray). */
|
|
413
|
+
readonly lineColor: string;
|
|
414
|
+
/** The line's stroke width in px. */
|
|
415
|
+
readonly lineWidth: number;
|
|
416
|
+
/** Fill the area under the line. */
|
|
417
|
+
readonly showArea: boolean;
|
|
418
|
+
/** The area's colour; default: the line's. */
|
|
419
|
+
readonly areaColor?: string;
|
|
420
|
+
/** The area's opacity, 0 to 1. */
|
|
421
|
+
readonly areaOpacity: number;
|
|
422
|
+
/** Points to mark with a dot (reactablefmtr `highlight_points`). */
|
|
423
|
+
readonly highlightPoints?: SeriesHighlight;
|
|
424
|
+
/** The radius of a highlighted point in px. */
|
|
425
|
+
readonly pointSize: number;
|
|
426
|
+
})
|
|
427
|
+
/**
|
|
428
|
+
* reactablefmtr `react_sparkbar`: each cell's array of numbers as a small bar chart (inline SVG, labelled as
|
|
429
|
+
* `sparkline` is). Bars stand on zero, so positive values rise from it and negative ones hang below it.
|
|
430
|
+
*/
|
|
431
|
+
| (ColumnBase<Row, SeriesKey<Row>> & ColorRefOpts<Row> & SeriesChartOpts & {
|
|
432
|
+
readonly kind: "sparkbar";
|
|
433
|
+
/** The bars' colour when the row has no `colorRef` / team colour (reactablefmtr: slategray). */
|
|
434
|
+
readonly fillColor: string;
|
|
435
|
+
/** The bars' opacity, 0 to 1. */
|
|
436
|
+
readonly fillOpacity: number;
|
|
437
|
+
/** Bars to recolour, as `sparkline`'s `highlightPoints`. */
|
|
438
|
+
readonly highlightBars?: SeriesHighlight;
|
|
439
|
+
})
|
|
440
|
+
/**
|
|
441
|
+
* reactablefmtr `gauge_chart`: each cell's number as a half-circle gauge (inline SVG) with the value inside. As in
|
|
442
|
+
* reactablefmtr the absolute value fills the gauge (-5 fills as 5); the printed value and the `aria-label` keep the
|
|
443
|
+
* sign, and the label says so. A missing or non-finite value is blank; text passes through.
|
|
444
|
+
*/
|
|
445
|
+
| (ColumnBase<Row, NumericKey<Row>> & ColorRefOpts<Row> & {
|
|
446
|
+
readonly kind: "gauge";
|
|
447
|
+
/** One colour, or several to ramp through from the column's smallest value to its largest. */
|
|
448
|
+
readonly fill: readonly string[];
|
|
449
|
+
/** The unfilled track. */
|
|
450
|
+
readonly background: string;
|
|
451
|
+
/** The value of an empty gauge, at least 0 (the gauge measures the absolute value); default 0. */
|
|
452
|
+
readonly minValue?: number;
|
|
453
|
+
/** The value of a full gauge; default: the column's largest absolute value. */
|
|
454
|
+
readonly maxValue?: number;
|
|
455
|
+
/** Print the scale's two ends under the gauge. */
|
|
456
|
+
readonly showMinMax: boolean;
|
|
457
|
+
/** How the value and the ends print (reactablefmtr `number_fmt`). */
|
|
458
|
+
readonly numberFormat?: NumberFormat;
|
|
459
|
+
/** The gauge's scale: 1 is 50px wide (reactablefmtr `size = 1`), 2 is 100px. */
|
|
460
|
+
readonly size: number;
|
|
461
|
+
/** The value's colour; default: the cell's text colour. */
|
|
462
|
+
readonly textColor?: string;
|
|
463
|
+
/** Print the value in bold. */
|
|
464
|
+
readonly boldText: boolean;
|
|
465
|
+
/** The value's CSS font size; default: the cell's. */
|
|
466
|
+
readonly textSize?: string;
|
|
467
|
+
/** grDevices::colorRamp `bias` for a several-colour `fill`. */
|
|
468
|
+
readonly bias: number;
|
|
469
|
+
/** The fill's opacity, 0 to 1. */
|
|
470
|
+
readonly opacity: number;
|
|
471
|
+
});
|
|
472
|
+
type ColumnKind = ColumnSpec<never>["kind"];
|
|
473
|
+
interface TextStyle {
|
|
474
|
+
readonly color?: string;
|
|
475
|
+
readonly size?: string;
|
|
476
|
+
readonly weight?: number | string;
|
|
477
|
+
readonly font?: string;
|
|
478
|
+
readonly transform?: "none" | "uppercase";
|
|
479
|
+
readonly style?: "normal" | "italic";
|
|
480
|
+
}
|
|
481
|
+
type Decoration<Row> = {
|
|
482
|
+
readonly type: "title";
|
|
483
|
+
readonly text: string;
|
|
484
|
+
} | {
|
|
485
|
+
readonly type: "subtitle";
|
|
486
|
+
readonly text: string;
|
|
487
|
+
} | {
|
|
488
|
+
readonly type: "titleHeader";
|
|
489
|
+
readonly title: string;
|
|
490
|
+
readonly subtitle?: string;
|
|
491
|
+
readonly kicker?: string;
|
|
492
|
+
readonly date?: string;
|
|
493
|
+
readonly kickerStyle?: TextStyle;
|
|
494
|
+
readonly titleStyle?: TextStyle;
|
|
495
|
+
readonly subtitleStyle?: TextStyle;
|
|
496
|
+
readonly dateStyle?: TextStyle;
|
|
497
|
+
} | {
|
|
498
|
+
readonly type: "sourceNote";
|
|
499
|
+
readonly html: string;
|
|
500
|
+
readonly unsafe?: boolean;
|
|
501
|
+
} | {
|
|
502
|
+
readonly type: "caption538";
|
|
503
|
+
readonly top?: string;
|
|
504
|
+
readonly bottom?: string;
|
|
505
|
+
readonly ruleColor?: string;
|
|
506
|
+
readonly ruleWidth: number;
|
|
507
|
+
readonly size: number;
|
|
508
|
+
readonly align: Align;
|
|
509
|
+
} | {
|
|
510
|
+
readonly type: "groupBy";
|
|
511
|
+
readonly key: keyof Row & string;
|
|
512
|
+
} | {
|
|
513
|
+
readonly type: "groupStripes";
|
|
514
|
+
readonly color: string;
|
|
515
|
+
readonly start: 1 | 2;
|
|
516
|
+
} | {
|
|
517
|
+
readonly type: "rowAccent";
|
|
518
|
+
readonly key: keyof Row & string;
|
|
519
|
+
readonly palette?: Readonly<Record<string, string>> | readonly string[];
|
|
520
|
+
readonly rows?: RowSelector<Row>;
|
|
521
|
+
readonly width: number;
|
|
522
|
+
readonly side: "left" | "right";
|
|
523
|
+
readonly hide: boolean;
|
|
524
|
+
readonly naColor: string;
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "boldRows";
|
|
527
|
+
readonly rows: RowSelector<Row>;
|
|
528
|
+
readonly textColor: string;
|
|
529
|
+
readonly highlightColor?: string;
|
|
530
|
+
} | {
|
|
531
|
+
readonly type: "spotlight";
|
|
532
|
+
readonly rows: RowSelector<Row>;
|
|
533
|
+
readonly columns?: readonly (keyof Row & string)[];
|
|
534
|
+
readonly fill?: string;
|
|
535
|
+
readonly textColor?: string;
|
|
536
|
+
readonly bold: boolean;
|
|
537
|
+
readonly accentColor?: string;
|
|
538
|
+
readonly accentWidth: number;
|
|
539
|
+
readonly dimColor: string | "auto" | null;
|
|
540
|
+
}
|
|
541
|
+
/** `after` = rows above each line (Python gt_cutline, _cells.py:840-841): 3 draws between the 3rd and 4th rows, 0 above the first. */
|
|
542
|
+
| {
|
|
543
|
+
readonly type: "cutline";
|
|
544
|
+
readonly after: readonly number[];
|
|
545
|
+
readonly label?: readonly (string | null)[];
|
|
546
|
+
readonly color: string;
|
|
547
|
+
readonly weight: number;
|
|
548
|
+
readonly style: "dashed" | "solid" | "dotted";
|
|
549
|
+
readonly labelColor?: string;
|
|
550
|
+
readonly labelSize: number;
|
|
551
|
+
readonly labelPosition: "above" | "below";
|
|
552
|
+
readonly gap: readonly number[];
|
|
553
|
+
} | {
|
|
554
|
+
readonly type: "borderGrid";
|
|
555
|
+
readonly color: string;
|
|
556
|
+
readonly weight: number;
|
|
557
|
+
readonly includeLabels: boolean;
|
|
558
|
+
} | {
|
|
559
|
+
readonly type: "borderBars";
|
|
560
|
+
readonly side: "top" | "bottom";
|
|
561
|
+
readonly colors: readonly string[];
|
|
562
|
+
readonly barHeight: number;
|
|
563
|
+
readonly barWidth: string;
|
|
564
|
+
readonly barAlign: Align;
|
|
565
|
+
readonly img?: string;
|
|
566
|
+
readonly imgWidth: number;
|
|
567
|
+
readonly imgHeight: number;
|
|
568
|
+
readonly imgPadding: number;
|
|
569
|
+
readonly imgAlign: "left" | "right";
|
|
570
|
+
readonly text?: string;
|
|
571
|
+
readonly textWeight: string;
|
|
572
|
+
readonly textColor: string;
|
|
573
|
+
readonly textSize: number;
|
|
574
|
+
readonly textAlign: Align;
|
|
575
|
+
readonly textPadding: number;
|
|
576
|
+
} | {
|
|
577
|
+
readonly type: "legendContinuous";
|
|
578
|
+
readonly columns?: readonly (keyof Row & string)[];
|
|
579
|
+
readonly palette?: readonly string[];
|
|
580
|
+
readonly domain?: readonly [number, number];
|
|
581
|
+
readonly reverse?: boolean;
|
|
582
|
+
readonly nBins: number;
|
|
583
|
+
readonly labels?: readonly string[];
|
|
584
|
+
readonly digits: number;
|
|
585
|
+
readonly title?: string;
|
|
586
|
+
readonly titlePosition: "top" | "left";
|
|
587
|
+
readonly location: "top" | "bottom";
|
|
588
|
+
readonly swatchWidth: number;
|
|
589
|
+
readonly swatchHeight: number;
|
|
590
|
+
} | {
|
|
591
|
+
readonly type: "legendDiscrete";
|
|
592
|
+
readonly key: Readonly<Record<string, string>> | "recorded";
|
|
593
|
+
readonly heading?: string;
|
|
594
|
+
readonly subtitle?: string;
|
|
595
|
+
readonly location: "top" | "bottom";
|
|
596
|
+
readonly shape: "square" | "circle";
|
|
597
|
+
readonly swatchSize: number;
|
|
598
|
+
readonly border: boolean;
|
|
599
|
+
readonly borderColor?: string;
|
|
600
|
+
readonly gap: number;
|
|
601
|
+
readonly direction: "horizontal" | "vertical";
|
|
602
|
+
readonly align: Align;
|
|
603
|
+
} | {
|
|
604
|
+
readonly type: "significance";
|
|
605
|
+
readonly pairs: readonly {
|
|
606
|
+
readonly estimate: keyof Row & string;
|
|
607
|
+
readonly p: keyof Row & string;
|
|
608
|
+
}[];
|
|
609
|
+
readonly levels: readonly number[];
|
|
610
|
+
readonly symbols: readonly string[];
|
|
611
|
+
readonly superscript: boolean;
|
|
612
|
+
readonly note: boolean;
|
|
613
|
+
readonly hideP: boolean;
|
|
614
|
+
} | {
|
|
615
|
+
readonly type: "outliers";
|
|
616
|
+
readonly columns: readonly (keyof Row & string)[];
|
|
617
|
+
readonly method: "iqr" | "sd" | "bounds";
|
|
618
|
+
readonly threshold?: number;
|
|
619
|
+
readonly bounds?: readonly [number | null, number | null];
|
|
620
|
+
readonly side: "both" | "high" | "low";
|
|
621
|
+
readonly fill?: string;
|
|
622
|
+
readonly color?: string;
|
|
623
|
+
readonly bold: boolean;
|
|
624
|
+
readonly symbol?: string;
|
|
625
|
+
readonly note?: string | boolean;
|
|
626
|
+
} | {
|
|
627
|
+
readonly type: "scaleNote";
|
|
628
|
+
readonly columns: readonly (keyof Row & string)[];
|
|
629
|
+
readonly divisor: number;
|
|
630
|
+
readonly note?: string;
|
|
631
|
+
readonly where: "sourceNote" | "label" | "both";
|
|
632
|
+
readonly labelSuffix?: string;
|
|
633
|
+
readonly decimals: number;
|
|
634
|
+
} | {
|
|
635
|
+
readonly type: "socialTag";
|
|
636
|
+
readonly accounts: Readonly<Record<string, string>>;
|
|
637
|
+
readonly caption?: string;
|
|
638
|
+
readonly stack: boolean;
|
|
639
|
+
readonly separator: string;
|
|
640
|
+
readonly align: Align;
|
|
641
|
+
readonly iconColor?: string;
|
|
642
|
+
readonly iconHeight: string;
|
|
643
|
+
} | {
|
|
644
|
+
readonly type: "watermark";
|
|
645
|
+
readonly text?: string;
|
|
646
|
+
readonly image?: string;
|
|
647
|
+
readonly opacity: number;
|
|
648
|
+
readonly size: string;
|
|
649
|
+
readonly position: string;
|
|
650
|
+
readonly color: string;
|
|
651
|
+
readonly angle: number;
|
|
652
|
+
readonly font: string;
|
|
653
|
+
} | {
|
|
654
|
+
readonly type: "wrapLabels";
|
|
655
|
+
readonly columns?: readonly (keyof Row & string)[];
|
|
656
|
+
readonly width: number;
|
|
657
|
+
readonly balance: boolean;
|
|
658
|
+
} | {
|
|
659
|
+
readonly type: "marginalia";
|
|
660
|
+
readonly columns: readonly (keyof Row & string)[];
|
|
661
|
+
readonly width?: number | string;
|
|
662
|
+
readonly label: string;
|
|
663
|
+
readonly italic: boolean;
|
|
664
|
+
readonly color?: string;
|
|
665
|
+
readonly size: string;
|
|
666
|
+
readonly rule: boolean;
|
|
667
|
+
readonly ruleColor?: string;
|
|
668
|
+
readonly align: Align;
|
|
669
|
+
} | {
|
|
670
|
+
readonly type: "snake";
|
|
671
|
+
readonly nCols: number;
|
|
672
|
+
readonly rowsPerCol?: number;
|
|
673
|
+
readonly gap: number;
|
|
674
|
+
readonly fill: string;
|
|
675
|
+
readonly cleanGaps: boolean;
|
|
676
|
+
} | {
|
|
677
|
+
readonly type: "tiers";
|
|
678
|
+
readonly levels: readonly string[];
|
|
679
|
+
readonly colors?: readonly string[];
|
|
680
|
+
readonly tierKey: keyof Row & string;
|
|
681
|
+
readonly imageColumns: readonly (keyof Row & string)[];
|
|
682
|
+
readonly imgHeight: string;
|
|
683
|
+
readonly style: "light" | "dark";
|
|
684
|
+
} | {
|
|
685
|
+
readonly type: "font";
|
|
686
|
+
readonly family: string;
|
|
687
|
+
readonly google: boolean;
|
|
688
|
+
readonly weight?: number | string;
|
|
689
|
+
readonly style?: "normal" | "italic";
|
|
690
|
+
} | LegendIconDecoration;
|
|
691
|
+
/** A `legendIcon` shape, drawn as inline SVG (reactablefmtr draws Font Awesome icons; sdvtables loads no icon font). */
|
|
692
|
+
type LegendIconShape = "circle" | "square" | "diamond" | "double-diamond" | "triangle-up" | "triangle-down" | "medal" | "battery-quarter" | "battery-half" | "battery-three-quarters" | "battery-full";
|
|
693
|
+
/**
|
|
694
|
+
* reactablefmtr `add_icon_legend`: a row of icons with labels above or below the table. Either a preset `iconSet`
|
|
695
|
+
* (reactablefmtr's "ski rating", "medals" or "batteries", with its colours and labels) or your own `icons`, one
|
|
696
|
+
* colour and one label each. Pass `iconSet` or `icons`, not both. reactablefmtr's `centered` argument is not ported
|
|
697
|
+
* (`align` places the row left or right).
|
|
698
|
+
*/
|
|
699
|
+
interface LegendIconDecoration {
|
|
700
|
+
readonly type: "legendIcon";
|
|
701
|
+
/** reactablefmtr's preset `icon_set`; its labels can be renamed with `labels` (same count). */
|
|
702
|
+
readonly iconSet?: "ski rating" | "medals" | "batteries";
|
|
703
|
+
/** Custom shapes, used when `iconSet` is absent. */
|
|
704
|
+
readonly icons?: readonly LegendIconShape[];
|
|
705
|
+
/** One CSS colour per custom icon (recycled when shorter). */
|
|
706
|
+
readonly colors?: readonly string[];
|
|
707
|
+
/** One label per icon; required with `icons` when `showLabels` is true (otherwise each shape's name is its accessible name). */
|
|
708
|
+
readonly labels?: readonly string[];
|
|
709
|
+
/** Write each label beside its icon; false keeps the label as the icon's accessible name only. */
|
|
710
|
+
readonly showLabels: boolean;
|
|
711
|
+
/** Bold line above the icons. */
|
|
712
|
+
readonly title?: string;
|
|
713
|
+
/** Small muted line below the icons. */
|
|
714
|
+
readonly footer?: string;
|
|
715
|
+
readonly align: "left" | "right";
|
|
716
|
+
/** reactablefmtr appends the legend after the table: "bottom". */
|
|
717
|
+
readonly location: "top" | "bottom";
|
|
718
|
+
/** Icon height in px (reactablefmtr: font-size 16px). */
|
|
719
|
+
readonly iconSize: number;
|
|
720
|
+
}
|
|
721
|
+
type DecorationType = Decoration<never>["type"];
|
|
722
|
+
interface ThemeRef {
|
|
723
|
+
readonly name: string;
|
|
724
|
+
readonly density: Density;
|
|
725
|
+
/** Theme options; `mode` picks `"light"` (default) or `"dark"` for registry themes. Other keys are theme-specific. */
|
|
726
|
+
readonly options?: Readonly<Record<string, string>> & {
|
|
727
|
+
readonly mode?: "light" | "dark";
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
interface TableSpec<Row> {
|
|
731
|
+
readonly id?: string;
|
|
732
|
+
readonly columns: readonly ColumnSpec<Row>[];
|
|
733
|
+
readonly decorations: readonly Decoration<Row>[];
|
|
734
|
+
readonly theme: ThemeRef;
|
|
735
|
+
/**
|
|
736
|
+
* Phase 5, read by the engine and its renderers (a static `renderHTML(spec, rows)` ignores it): `pageSize` is
|
|
737
|
+
* `createTable`'s default page size; `hotkeys: false` turns off the j/k/h/l/s and `/` keys (Task 10), leaving the
|
|
738
|
+
* grid's arrow keys, Enter and Space.
|
|
739
|
+
*/
|
|
740
|
+
readonly interactive?: {
|
|
741
|
+
readonly pageSize?: number;
|
|
742
|
+
readonly hotkeys?: boolean;
|
|
743
|
+
};
|
|
744
|
+
/** J31: the column whose value is a row's link id (`String(row[rowKey])`); absent → the row's index in the input rows. */
|
|
745
|
+
readonly rowKey?: keyof Row & string;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export type { Align as A, BarTextPosition as B, ColumnSpec as C, Density as D, FormatType as F, IconName as I, LegendIconDecoration as L, MarkOpts as M, NumericKey as N, Predicate as P, RowSelector as R, SeriesKey as S, TableSpec as T, ThemeRef as a, ColumnBase as b, Decoration as c, ColorRefOpts as d, ColumnKind as e, DecorationType as f, LegendIconShape as g, NumberFormat as h, PredicateOp as i, SeriesBand as j, SeriesChartOpts as k, SeriesHighlight as l, SeriesPoint as m, SeriesStat as n, StringKey as o, TeamOpts as p, TextStyle as q };
|