@elaraai/east-ui 1.0.40 → 1.0.42
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/dist/src/collections/calendar/index.d.ts +275 -62
- package/dist/src/collections/calendar/index.d.ts.map +1 -1
- package/dist/src/collections/calendar/index.js +168 -51
- package/dist/src/collections/calendar/index.js.map +1 -1
- package/dist/src/collections/calendar/types.d.ts +228 -22
- package/dist/src/collections/calendar/types.d.ts.map +1 -1
- package/dist/src/collections/calendar/types.js +132 -18
- package/dist/src/collections/calendar/types.js.map +1 -1
- package/dist/src/collections/deck/index.d.ts +2229 -0
- package/dist/src/collections/deck/index.d.ts.map +1 -0
- package/dist/src/collections/deck/index.js +461 -0
- package/dist/src/collections/deck/index.js.map +1 -0
- package/dist/src/collections/deck/types.d.ts +327 -0
- package/dist/src/collections/deck/types.d.ts.map +1 -0
- package/dist/src/collections/deck/types.js +206 -0
- package/dist/src/collections/deck/types.js.map +1 -0
- package/dist/src/collections/index.d.ts +2 -0
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js +2 -0
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/value-tree/index.d.ts +380 -0
- package/dist/src/collections/value-tree/index.d.ts.map +1 -0
- package/dist/src/collections/value-tree/index.js +688 -0
- package/dist/src/collections/value-tree/index.js.map +1 -0
- package/dist/src/collections/value-tree/materialize.d.ts +65 -0
- package/dist/src/collections/value-tree/materialize.d.ts.map +1 -0
- package/dist/src/collections/value-tree/materialize.js +238 -0
- package/dist/src/collections/value-tree/materialize.js.map +1 -0
- package/dist/src/collections/value-tree/types.d.ts +324 -0
- package/dist/src/collections/value-tree/types.d.ts.map +1 -0
- package/dist/src/collections/value-tree/types.js +168 -0
- package/dist/src/collections/value-tree/types.js.map +1 -0
- package/dist/src/component.d.ts +1047 -61
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +97 -3
- package/dist/src/component.js.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +4 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +3 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/splitter/index.d.ts +1 -0
- package/dist/src/layout/splitter/index.d.ts.map +1 -1
- package/dist/src/layout/splitter/index.js +2 -1
- package/dist/src/layout/splitter/index.js.map +1 -1
- package/dist/src/layout/splitter/types.d.ts +9 -0
- package/dist/src/layout/splitter/types.d.ts.map +1 -1
- package/dist/src/layout/splitter/types.js +4 -0
- package/dist/src/layout/splitter/types.js.map +1 -1
- package/dist/src/navigation/app/index.d.ts +135 -0
- package/dist/src/navigation/app/index.d.ts.map +1 -0
- package/dist/src/navigation/app/index.js +191 -0
- package/dist/src/navigation/app/index.js.map +1 -0
- package/dist/src/navigation/index.d.ts +1 -0
- package/dist/src/navigation/index.d.ts.map +1 -1
- package/dist/src/navigation/index.js +1 -0
- package/dist/src/navigation/index.js.map +1 -1
- package/dist/src/navigation/pages/types.d.ts +15 -1
- package/dist/src/navigation/pages/types.d.ts.map +1 -1
- package/dist/src/navigation/pages/types.js.map +1 -1
- package/dist/src/platform/slice/impl.js +2 -2
- package/dist/src/platform/slice/impl.js.map +1 -1
- package/dist/src/runtime/collections/calendar.d.ts +10 -5
- package/dist/src/runtime/collections/calendar.d.ts.map +1 -1
- package/dist/src/runtime/collections/calendar.js +10 -5
- package/dist/src/runtime/collections/calendar.js.map +1 -1
- package/dist/src/runtime/collections/deck.d.ts +1066 -0
- package/dist/src/runtime/collections/deck.d.ts.map +1 -0
- package/dist/src/runtime/collections/deck.js +54 -0
- package/dist/src/runtime/collections/deck.js.map +1 -0
- package/dist/src/runtime/collections/index.d.ts +2 -0
- package/dist/src/runtime/collections/index.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.js +2 -0
- package/dist/src/runtime/collections/index.js.map +1 -1
- package/dist/src/runtime/collections/value-tree.d.ts +202 -0
- package/dist/src/runtime/collections/value-tree.d.ts.map +1 -0
- package/dist/src/runtime/collections/value-tree.js +49 -0
- package/dist/src/runtime/collections/value-tree.js.map +1 -0
- package/dist/src/runtime/navigation/app.d.ts +50 -0
- package/dist/src/runtime/navigation/app.d.ts.map +1 -0
- package/dist/src/runtime/navigation/app.js +51 -0
- package/dist/src/runtime/navigation/app.js.map +1 -0
- package/dist/src/runtime/navigation/index.d.ts +1 -0
- package/dist/src/runtime/navigation/index.d.ts.map +1 -1
- package/dist/src/runtime/navigation/index.js +1 -0
- package/dist/src/runtime/navigation/index.js.map +1 -1
- package/dist/test/collections/calendar.examples.d.ts +2 -0
- package/dist/test/collections/calendar.examples.d.ts.map +1 -1
- package/dist/test/collections/calendar.examples.js +74 -42
- package/dist/test/collections/calendar.examples.js.map +1 -1
- package/dist/test/collections/deck.examples.d.ts +8 -0
- package/dist/test/collections/deck.examples.d.ts.map +1 -0
- package/dist/test/collections/deck.examples.js +169 -0
- package/dist/test/collections/deck.examples.js.map +1 -0
- package/dist/test/collections/planner.examples.js +2 -2
- package/dist/test/collections/value-tree.examples.d.ts +10 -0
- package/dist/test/collections/value-tree.examples.d.ts.map +1 -0
- package/dist/test/collections/value-tree.examples.js +263 -0
- package/dist/test/collections/value-tree.examples.js.map +1 -0
- package/dist/test/display/image.examples.js +1 -1
- package/dist/test/display/image.examples.js.map +1 -1
- package/dist/test/layout/aligned-stack.examples.js +4 -4
- package/dist/test/layout/aligned-stack.examples.js.map +1 -1
- package/dist/test/layout/dock.examples.js +6 -6
- package/dist/test/layout/dock.examples.js.map +1 -1
- package/dist/test/layout/splitter.examples.d.ts +1 -0
- package/dist/test/layout/splitter.examples.d.ts.map +1 -1
- package/dist/test/layout/splitter.examples.js +11 -0
- package/dist/test/layout/splitter.examples.js.map +1 -1
- package/dist/test/navigation/app.examples.d.ts +22 -0
- package/dist/test/navigation/app.examples.d.ts.map +1 -0
- package/dist/test/navigation/app.examples.js +116 -0
- package/dist/test/navigation/app.examples.js.map +1 -0
- package/dist/test/navigation/nav-list.examples.js +2 -2
- package/dist/test/navigation/nav-list.examples.js.map +1 -1
- package/dist/test/overlays/drawer.examples.js +2 -2
- package/dist/test/overlays/drawer.examples.js.map +1 -1
- package/package.json +3 -3
|
@@ -3,26 +3,141 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* `Calendar` — a day-of-week × week
|
|
7
|
-
* demand, OT exposure). **Visualisation only**: clicking drills into
|
|
8
|
-
* but the Calendar is not part of the Planner family — no events, no
|
|
6
|
+
* `Calendar` — a day-of-week × week heatmap coloured by intensity (forecast,
|
|
7
|
+
* demand, OT exposure). **Visualisation only**: clicking selects/drills into
|
|
8
|
+
* a day, but the Calendar is not part of the Planner family — no events, no
|
|
9
9
|
* committed/proposed state, no drag & drop. Takes one flat table with a
|
|
10
|
-
* chart-style field encoding; the component owns the week (columns are
|
|
11
|
-
*
|
|
10
|
+
* chart-style field encoding; the component owns the week (columns are always
|
|
11
|
+
* Mon–Sun). Optional chrome — the weekly totals rail, the per-weekday
|
|
12
|
+
* aggregate row, and the selection footer — is composed with the
|
|
13
|
+
* `Calendar.*` sub-factories.
|
|
12
14
|
*
|
|
13
15
|
* @packageDocumentation
|
|
14
16
|
*/
|
|
15
|
-
import { type ExprType, type SubtypeExprOrValue, type TypeOf, ArrayType, FloatType, type FunctionType, type NullType, StringType, StructType } from "@elaraai/east";
|
|
17
|
+
import { type ExprType, type SubtypeExprOrValue, type TypeOf, ArrayType, BooleanType, FloatType, type FunctionType, IntegerType, type NullType, StringType, StructType } from "@elaraai/east";
|
|
16
18
|
import { UIComponentType } from "../../component.js";
|
|
17
19
|
import { DensityType } from "../../style.js";
|
|
18
20
|
import type { DensityLiteral } from "../../style.js";
|
|
19
21
|
import type { PlotGutter } from "../../shared/plot-gutter.js";
|
|
20
|
-
import { CalendarCellRefType } from "./types.js";
|
|
21
|
-
export { CalendarRootType, CalendarCellType, CalendarCellRefType, } from "./types.js";
|
|
22
|
+
import { CalendarCellRefType, CalendarAggregateType, type CalendarAggregateLiteral, CalendarScaleType, CalendarTotalsType, CalendarAggregateRowType, CalendarFooterType } from "./types.js";
|
|
23
|
+
export { CalendarRootType, CalendarCellType, CalendarCellRefType, CalendarAggregateType, type CalendarAggregateLiteral, CalendarScaleType, CalendarTotalsType, CalendarAggregateRowType, CalendarLegendType, CalendarFooterType, } from "./types.js";
|
|
22
24
|
/**
|
|
23
25
|
* The struct element type of a `SubtypeExprOrValue<ArrayType<StructType>>`.
|
|
24
26
|
*/
|
|
25
27
|
export type RowElement<T extends SubtypeExprOrValue<ArrayType<StructType>>> = TypeOf<T> extends ArrayType<infer S> ? (S extends StructType ? S : never) : never;
|
|
28
|
+
/**
|
|
29
|
+
* Options for {@link Calendar.scale}.
|
|
30
|
+
*
|
|
31
|
+
* @property ramp - Optional low→high CSS colour list (absent = the default teal ramp)
|
|
32
|
+
* @property steps - Number of intensity buckets (default the ramp length, else 8)
|
|
33
|
+
*/
|
|
34
|
+
export interface CalendarScaleOptions {
|
|
35
|
+
/** Optional low→high CSS colour list (absent = the default teal ramp). */
|
|
36
|
+
ramp?: SubtypeExprOrValue<ArrayType<StringType>>;
|
|
37
|
+
/** Number of intensity buckets (default the ramp length, else 8). */
|
|
38
|
+
steps?: SubtypeExprOrValue<IntegerType>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Builds a heatmap scale — the low→high colour ramp and bucket count that map
|
|
42
|
+
* a cell value to its fill. Pass the result as `config.scale`.
|
|
43
|
+
*
|
|
44
|
+
* @param options - The scale options ({@link CalendarScaleOptions})
|
|
45
|
+
* @returns An East `CalendarScaleType` value
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* Calendar.scale({ steps: 6 })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function calendarScale(options?: CalendarScaleOptions): SubtypeExprOrValue<CalendarScaleType>;
|
|
53
|
+
/**
|
|
54
|
+
* Options for {@link Calendar.totals}.
|
|
55
|
+
*
|
|
56
|
+
* @property aggregate - The reduction over each week's cells (default `"sum"`)
|
|
57
|
+
* @property label - The rail's column header (default `"Σ wk"`)
|
|
58
|
+
* @property bar - Whether to draw the proportion bar (default `true`)
|
|
59
|
+
*/
|
|
60
|
+
export interface CalendarTotalsOptions {
|
|
61
|
+
/** The reduction over each week's cells (default `"sum"`). */
|
|
62
|
+
aggregate?: SubtypeExprOrValue<CalendarAggregateType> | CalendarAggregateLiteral;
|
|
63
|
+
/** The rail's column header (default `"Σ wk"`). */
|
|
64
|
+
label?: SubtypeExprOrValue<StringType>;
|
|
65
|
+
/** Whether to draw the proportion bar (default `true`). */
|
|
66
|
+
bar?: SubtypeExprOrValue<BooleanType>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Builds the weekly totals rail — a trailing column reducing each week row,
|
|
70
|
+
* with an optional proportion bar. Pass the result as `config.totals`.
|
|
71
|
+
* The aggregate vocabulary (`sum` / `mean` / `min` / `max` / `count`) matches
|
|
72
|
+
* the Table component.
|
|
73
|
+
*
|
|
74
|
+
* @param options - The totals options ({@link CalendarTotalsOptions})
|
|
75
|
+
* @returns An East `CalendarTotalsType` value
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* Calendar.totals({ aggregate: "sum", label: "Σ wk" })
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
declare function calendarTotals(options?: CalendarTotalsOptions): SubtypeExprOrValue<CalendarTotalsType>;
|
|
83
|
+
/**
|
|
84
|
+
* Options for {@link Calendar.aggregateRow}.
|
|
85
|
+
*
|
|
86
|
+
* @property aggregate - The reduction over each weekday's cells (default `"mean"`)
|
|
87
|
+
* @property label - The row's label (default `"mean"`)
|
|
88
|
+
*/
|
|
89
|
+
export interface CalendarAggregateRowOptions {
|
|
90
|
+
/** The reduction over each weekday's cells (default `"mean"`). */
|
|
91
|
+
aggregate?: SubtypeExprOrValue<CalendarAggregateType> | CalendarAggregateLiteral;
|
|
92
|
+
/** The row's label (default `"mean"`). */
|
|
93
|
+
label?: SubtypeExprOrValue<StringType>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Builds the per-weekday aggregate row — a trailing row reducing each weekday
|
|
97
|
+
* column, pinned under the grid. Pass the result as `config.aggregateRow`.
|
|
98
|
+
*
|
|
99
|
+
* @param options - The aggregate-row options ({@link CalendarAggregateRowOptions})
|
|
100
|
+
* @returns An East `CalendarAggregateRowType` value
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* Calendar.aggregateRow({ aggregate: "mean", label: "mean" })
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
declare function calendarAggregateRow(options?: CalendarAggregateRowOptions): SubtypeExprOrValue<CalendarAggregateRowType>;
|
|
108
|
+
/**
|
|
109
|
+
* Options for {@link Calendar.footer}.
|
|
110
|
+
*
|
|
111
|
+
* @property valueLabel - Label for the cell value (default `"value"`)
|
|
112
|
+
* @property compareLabel - Label for the compare baseline (default `"prev"`)
|
|
113
|
+
* @property legend - Low→high gradient legend; `true` for the default captions
|
|
114
|
+
*/
|
|
115
|
+
export interface CalendarFooterOptions {
|
|
116
|
+
/** Label for the cell value (default `"value"`). */
|
|
117
|
+
valueLabel?: SubtypeExprOrValue<StringType>;
|
|
118
|
+
/** Label for the compare baseline (default `"prev"`). */
|
|
119
|
+
compareLabel?: SubtypeExprOrValue<StringType>;
|
|
120
|
+
/** Low→high gradient legend; `true` for the default `low` / `high` captions. */
|
|
121
|
+
legend?: {
|
|
122
|
+
low?: SubtypeExprOrValue<StringType>;
|
|
123
|
+
high?: SubtypeExprOrValue<StringType>;
|
|
124
|
+
} | boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Builds the selection footer — the strip shown once a cell is selected,
|
|
128
|
+
* printing the cell value (labelled `valueLabel`), its `compare` baseline
|
|
129
|
+
* (labelled `compareLabel`) and a computed delta chip, plus an optional
|
|
130
|
+
* low→high gradient legend pinned right. Pass the result as `config.footer`.
|
|
131
|
+
*
|
|
132
|
+
* @param options - The footer options ({@link CalendarFooterOptions})
|
|
133
|
+
* @returns An East `CalendarFooterType` value
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* Calendar.footer({ valueLabel: "predicted", compareLabel: "last yr", legend: true })
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare function calendarFooter(options?: CalendarFooterOptions): SubtypeExprOrValue<CalendarFooterType>;
|
|
26
141
|
/**
|
|
27
142
|
* Fields the `cell` mapper returns — one (week, day) cell, before defaults.
|
|
28
143
|
*
|
|
@@ -34,8 +149,8 @@ export type RowElement<T extends SubtypeExprOrValue<ArrayType<StructType>>> = Ty
|
|
|
34
149
|
* @property day - The day column — `"Mon"` … `"Sun"`, exact match
|
|
35
150
|
* @property value - The intensity (drives fill; printed via `text`)
|
|
36
151
|
* @property text - Optional cell text (defaults to `East.print(value)`)
|
|
37
|
-
* @property
|
|
38
|
-
* @property
|
|
152
|
+
* @property compare - Optional baseline for the footer delta (e.g. last year)
|
|
153
|
+
* @property summary - Optional extra selection-footer text for this day
|
|
39
154
|
*/
|
|
40
155
|
export interface CalendarCellFields {
|
|
41
156
|
/** The row's week label (rows appear in first-appearance order). */
|
|
@@ -46,33 +161,45 @@ export interface CalendarCellFields {
|
|
|
46
161
|
value: SubtypeExprOrValue<FloatType>;
|
|
47
162
|
/** Optional cell text (defaults to `East.print(value)`). */
|
|
48
163
|
text?: SubtypeExprOrValue<StringType>;
|
|
49
|
-
/** Optional
|
|
164
|
+
/** Optional baseline for the footer delta (e.g. last year). */
|
|
165
|
+
compare?: SubtypeExprOrValue<FloatType>;
|
|
166
|
+
/** Optional extra selection-footer text for this day. */
|
|
50
167
|
summary?: SubtypeExprOrValue<StringType>;
|
|
51
|
-
/** Optional signed change (renders as a pos/neg chip). */
|
|
52
|
-
delta?: SubtypeExprOrValue<FloatType>;
|
|
53
168
|
}
|
|
54
169
|
/**
|
|
55
170
|
* Configuration for {@link createCalendar}.
|
|
56
171
|
*
|
|
57
172
|
* @typeParam R - The day-row struct
|
|
58
173
|
* @property cell - Cell row mapper (omit when rows are already resolved)
|
|
59
|
-
* @property
|
|
174
|
+
* @property values - Print the value inside each cell (default `true`)
|
|
175
|
+
* @property scale - Heatmap scale ({@link Calendar.scale})
|
|
60
176
|
* @property domain - Optional explicit intensity domain (default: observed min/max)
|
|
61
|
-
* @property
|
|
177
|
+
* @property totals - Weekly totals rail ({@link Calendar.totals})
|
|
178
|
+
* @property aggregateRow - Per-weekday aggregate row ({@link Calendar.aggregateRow})
|
|
179
|
+
* @property footer - Selection footer ({@link Calendar.footer})
|
|
180
|
+
* @property actionLabel - Optional footer drill label
|
|
62
181
|
* @property onAction - Optional drill callback (receives the selected cell)
|
|
63
182
|
* @property onSelect - Optional cell-click callback
|
|
64
183
|
*/
|
|
65
184
|
export interface CalendarConfig<R extends StructType> {
|
|
66
185
|
/** Cell row mapper; omit when `data` is already `ArrayType(Calendar.Types.Cell)`. */
|
|
67
186
|
cell?: (day: ExprType<R>) => CalendarCellFields;
|
|
68
|
-
/**
|
|
69
|
-
|
|
187
|
+
/** Print the value inside each cell (default `true`). */
|
|
188
|
+
values?: SubtypeExprOrValue<BooleanType>;
|
|
189
|
+
/** Heatmap scale ({@link Calendar.scale}). */
|
|
190
|
+
scale?: SubtypeExprOrValue<CalendarScaleType>;
|
|
70
191
|
/** Optional explicit intensity domain (default: observed min/max). */
|
|
71
192
|
domain?: {
|
|
72
193
|
min: SubtypeExprOrValue<FloatType>;
|
|
73
194
|
max: SubtypeExprOrValue<FloatType>;
|
|
74
195
|
};
|
|
75
|
-
/**
|
|
196
|
+
/** Weekly totals rail ({@link Calendar.totals}). */
|
|
197
|
+
totals?: SubtypeExprOrValue<CalendarTotalsType>;
|
|
198
|
+
/** Per-weekday aggregate row ({@link Calendar.aggregateRow}). */
|
|
199
|
+
aggregateRow?: SubtypeExprOrValue<CalendarAggregateRowType>;
|
|
200
|
+
/** Selection footer ({@link Calendar.footer}). */
|
|
201
|
+
footer?: SubtypeExprOrValue<CalendarFooterType>;
|
|
202
|
+
/** Optional footer drill label. */
|
|
76
203
|
actionLabel?: SubtypeExprOrValue<StringType>;
|
|
77
204
|
/** Optional drill callback (receives the selected cell). */
|
|
78
205
|
onAction?: SubtypeExprOrValue<FunctionType<[CalendarCellRefType], NullType>>;
|
|
@@ -88,7 +215,7 @@ export interface CalendarConfig<R extends StructType> {
|
|
|
88
215
|
plotGutter?: PlotGutter;
|
|
89
216
|
}
|
|
90
217
|
/**
|
|
91
|
-
* Creates a Calendar — a day-of-week × week intensity
|
|
218
|
+
* Creates a Calendar — a day-of-week × week intensity heatmap.
|
|
92
219
|
*
|
|
93
220
|
* @typeParam R - The day-table input
|
|
94
221
|
* @param data - The day rows (one element per week × day cell; sparse is fine)
|
|
@@ -105,6 +232,8 @@ export interface CalendarConfig<R extends StructType> {
|
|
|
105
232
|
* [{ week: "W37", day: "Mon", demand: 102.0 }],
|
|
106
233
|
* {
|
|
107
234
|
* cell: d => ({ week: d.week, day: d.day, value: d.demand }),
|
|
235
|
+
* totals: Calendar.totals(),
|
|
236
|
+
* footer: Calendar.footer({ legend: true }),
|
|
108
237
|
* },
|
|
109
238
|
* ),
|
|
110
239
|
* );
|
|
@@ -115,13 +244,16 @@ declare function createCalendar<T extends SubtypeExprOrValue<ArrayType<StructTyp
|
|
|
115
244
|
* Calendar component namespace.
|
|
116
245
|
*
|
|
117
246
|
* @remarks
|
|
118
|
-
* `Calendar.Root(data, config)` builds the
|
|
119
|
-
*
|
|
120
|
-
*
|
|
247
|
+
* `Calendar.Root(data, config)` builds the heatmap from one flat day table.
|
|
248
|
+
* Compose the optional chrome with the sub-factories: `Calendar.scale` (the
|
|
249
|
+
* colour ramp), `Calendar.totals` (the weekly rail), `Calendar.aggregateRow`
|
|
250
|
+
* (the per-weekday row), and `Calendar.footer` (the selection footer + legend).
|
|
251
|
+
* Visualisation only — pair it with a `Slice.Range` in the surrounding chrome
|
|
252
|
+
* if the time window needs to narrow.
|
|
121
253
|
*/
|
|
122
254
|
export declare const Calendar: {
|
|
123
255
|
/**
|
|
124
|
-
* Creates a Calendar — a day-of-week × week intensity
|
|
256
|
+
* Creates a Calendar — a day-of-week × week intensity heatmap.
|
|
125
257
|
*
|
|
126
258
|
* @typeParam R - The day-table input
|
|
127
259
|
* @param data - The day rows (one element per week × day cell; sparse is fine)
|
|
@@ -129,56 +261,97 @@ export declare const Calendar: {
|
|
|
129
261
|
* @returns An East expression of `UIComponentType`
|
|
130
262
|
*
|
|
131
263
|
* @remarks
|
|
132
|
-
* Cells fill with
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
|
|
264
|
+
* Cells fill with the heatmap ramp normalised over the visible values (or
|
|
265
|
+
* the explicit `domain`); missing (week, day) combinations render the
|
|
266
|
+
* neutral hatched fill. Selecting a cell shows its details in the footer.
|
|
267
|
+
*/
|
|
268
|
+
readonly Root: typeof createCalendar;
|
|
269
|
+
/**
|
|
270
|
+
* Builds a heatmap scale — the low→high colour ramp and bucket count.
|
|
271
|
+
* Pass the result as `config.scale`.
|
|
136
272
|
*
|
|
137
|
-
* @
|
|
138
|
-
*
|
|
139
|
-
|
|
140
|
-
|
|
273
|
+
* @param options - The scale options ({@link CalendarScaleOptions})
|
|
274
|
+
* @returns An East `CalendarScaleType` value
|
|
275
|
+
*/
|
|
276
|
+
readonly scale: typeof calendarScale;
|
|
277
|
+
/**
|
|
278
|
+
* Builds the weekly totals rail (per-row aggregation) — a trailing column
|
|
279
|
+
* with an optional proportion bar. Pass the result as `config.totals`.
|
|
141
280
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* [{ week: "W37", day: "Mon", demand: 102.0 }],
|
|
145
|
-
* {
|
|
146
|
-
* title: "Forecasted demand · SE region",
|
|
147
|
-
* cell: d => ({ week: d.week, day: d.day, value: d.demand }),
|
|
148
|
-
* },
|
|
149
|
-
* ),
|
|
150
|
-
* );
|
|
151
|
-
* ```
|
|
281
|
+
* @param options - The totals options ({@link CalendarTotalsOptions})
|
|
282
|
+
* @returns An East `CalendarTotalsType` value
|
|
152
283
|
*/
|
|
153
|
-
readonly
|
|
284
|
+
readonly totals: typeof calendarTotals;
|
|
285
|
+
/**
|
|
286
|
+
* Builds the per-weekday aggregate row (per-column aggregation). Pass the
|
|
287
|
+
* result as `config.aggregateRow`.
|
|
288
|
+
*
|
|
289
|
+
* @param options - The aggregate-row options ({@link CalendarAggregateRowOptions})
|
|
290
|
+
* @returns An East `CalendarAggregateRowType` value
|
|
291
|
+
*/
|
|
292
|
+
readonly aggregateRow: typeof calendarAggregateRow;
|
|
293
|
+
/**
|
|
294
|
+
* Builds the selection footer (value / compare / delta + legend). Pass the
|
|
295
|
+
* result as `config.footer`.
|
|
296
|
+
*
|
|
297
|
+
* @param options - The footer options ({@link CalendarFooterOptions})
|
|
298
|
+
* @returns An East `CalendarFooterType` value
|
|
299
|
+
*/
|
|
300
|
+
readonly footer: typeof calendarFooter;
|
|
154
301
|
readonly Types: {
|
|
155
302
|
/**
|
|
156
303
|
* East StructType for the Calendar component.
|
|
157
304
|
*
|
|
158
305
|
* @remarks
|
|
159
306
|
* The resolved grid; see {@link CalendarRootType} for per-field docs.
|
|
160
|
-
*
|
|
161
|
-
* @property legend - Intensity caption
|
|
162
|
-
* @property cells - The resolved cells
|
|
163
|
-
* @property domain - Optional explicit intensity domain
|
|
164
|
-
* @property actionLabel - Optional footer-right drill label
|
|
165
|
-
* @property onAction - Optional drill callback
|
|
166
|
-
* @property onSelect - Optional cell-click callback
|
|
167
307
|
*/
|
|
168
308
|
readonly Calendar: StructType<{
|
|
169
|
-
readonly legend: StringType;
|
|
170
309
|
readonly cells: ArrayType<StructType<{
|
|
171
310
|
readonly week: StringType;
|
|
172
311
|
readonly day: StringType;
|
|
173
312
|
readonly value: FloatType;
|
|
174
313
|
readonly text: StringType;
|
|
314
|
+
readonly compare: import("@elaraai/east").OptionType<FloatType>;
|
|
175
315
|
readonly summary: import("@elaraai/east").OptionType<StringType>;
|
|
176
|
-
|
|
316
|
+
}>>;
|
|
317
|
+
readonly values: BooleanType;
|
|
318
|
+
readonly scale: import("@elaraai/east").OptionType<StructType<{
|
|
319
|
+
readonly ramp: import("@elaraai/east").OptionType<ArrayType<StringType>>;
|
|
320
|
+
readonly steps: IntegerType;
|
|
177
321
|
}>>;
|
|
178
322
|
readonly domain: import("@elaraai/east").OptionType<StructType<{
|
|
179
323
|
readonly min: FloatType;
|
|
180
324
|
readonly max: FloatType;
|
|
181
325
|
}>>;
|
|
326
|
+
readonly totals: import("@elaraai/east").OptionType<StructType<{
|
|
327
|
+
readonly aggregate: import("@elaraai/east").VariantType<{
|
|
328
|
+
readonly sum: NullType;
|
|
329
|
+
readonly mean: NullType;
|
|
330
|
+
readonly min: NullType;
|
|
331
|
+
readonly max: NullType;
|
|
332
|
+
readonly count: NullType;
|
|
333
|
+
}>;
|
|
334
|
+
readonly label: StringType;
|
|
335
|
+
readonly bar: BooleanType;
|
|
336
|
+
}>>;
|
|
337
|
+
readonly aggregateRow: import("@elaraai/east").OptionType<StructType<{
|
|
338
|
+
readonly aggregate: import("@elaraai/east").VariantType<{
|
|
339
|
+
readonly sum: NullType;
|
|
340
|
+
readonly mean: NullType;
|
|
341
|
+
readonly min: NullType;
|
|
342
|
+
readonly max: NullType;
|
|
343
|
+
readonly count: NullType;
|
|
344
|
+
}>;
|
|
345
|
+
readonly label: StringType;
|
|
346
|
+
}>>;
|
|
347
|
+
readonly footer: import("@elaraai/east").OptionType<StructType<{
|
|
348
|
+
readonly valueLabel: StringType;
|
|
349
|
+
readonly compareLabel: StringType;
|
|
350
|
+
readonly legend: import("@elaraai/east").OptionType<StructType<{
|
|
351
|
+
readonly low: StringType;
|
|
352
|
+
readonly high: StringType;
|
|
353
|
+
}>>;
|
|
354
|
+
}>>;
|
|
182
355
|
readonly actionLabel: import("@elaraai/east").OptionType<StringType>;
|
|
183
356
|
readonly onAction: import("@elaraai/east").OptionType<FunctionType<[StructType<{
|
|
184
357
|
readonly week: StringType;
|
|
@@ -202,32 +375,72 @@ export declare const Calendar: {
|
|
|
202
375
|
}>;
|
|
203
376
|
/**
|
|
204
377
|
* A resolved calendar cell.
|
|
205
|
-
*
|
|
206
|
-
* @property week - The row's week label
|
|
207
|
-
* @property day - The day column
|
|
208
|
-
* @property value - The intensity / printed value
|
|
209
|
-
* @property text - The cell text
|
|
210
|
-
* @property summary - Optional selection-footer text
|
|
211
|
-
* @property delta - Optional signed change
|
|
212
378
|
*/
|
|
213
379
|
readonly Cell: StructType<{
|
|
214
380
|
readonly week: StringType;
|
|
215
381
|
readonly day: StringType;
|
|
216
382
|
readonly value: FloatType;
|
|
217
383
|
readonly text: StringType;
|
|
384
|
+
readonly compare: import("@elaraai/east").OptionType<FloatType>;
|
|
218
385
|
readonly summary: import("@elaraai/east").OptionType<StringType>;
|
|
219
|
-
readonly delta: import("@elaraai/east").OptionType<FloatType>;
|
|
220
386
|
}>;
|
|
221
387
|
/**
|
|
222
388
|
* A cell reference — what `onSelect` / `onAction` receive.
|
|
223
|
-
*
|
|
224
|
-
* @property week - The row's week label
|
|
225
|
-
* @property day - The day column
|
|
226
389
|
*/
|
|
227
390
|
readonly CellRef: StructType<{
|
|
228
391
|
readonly week: StringType;
|
|
229
392
|
readonly day: StringType;
|
|
230
393
|
}>;
|
|
394
|
+
/** The aggregate reduction vocabulary (sum / mean / min / max / count). */
|
|
395
|
+
readonly Aggregate: import("@elaraai/east").VariantType<{
|
|
396
|
+
readonly sum: NullType;
|
|
397
|
+
readonly mean: NullType;
|
|
398
|
+
readonly min: NullType;
|
|
399
|
+
readonly max: NullType;
|
|
400
|
+
readonly count: NullType;
|
|
401
|
+
}>;
|
|
402
|
+
/** The heatmap scale (ramp / steps). */
|
|
403
|
+
readonly Scale: StructType<{
|
|
404
|
+
readonly ramp: import("@elaraai/east").OptionType<ArrayType<StringType>>;
|
|
405
|
+
readonly steps: IntegerType;
|
|
406
|
+
}>;
|
|
407
|
+
/** The weekly totals rail. */
|
|
408
|
+
readonly Totals: StructType<{
|
|
409
|
+
readonly aggregate: import("@elaraai/east").VariantType<{
|
|
410
|
+
readonly sum: NullType;
|
|
411
|
+
readonly mean: NullType;
|
|
412
|
+
readonly min: NullType;
|
|
413
|
+
readonly max: NullType;
|
|
414
|
+
readonly count: NullType;
|
|
415
|
+
}>;
|
|
416
|
+
readonly label: StringType;
|
|
417
|
+
readonly bar: BooleanType;
|
|
418
|
+
}>;
|
|
419
|
+
/** The per-weekday aggregate row. */
|
|
420
|
+
readonly AggregateRow: StructType<{
|
|
421
|
+
readonly aggregate: import("@elaraai/east").VariantType<{
|
|
422
|
+
readonly sum: NullType;
|
|
423
|
+
readonly mean: NullType;
|
|
424
|
+
readonly min: NullType;
|
|
425
|
+
readonly max: NullType;
|
|
426
|
+
readonly count: NullType;
|
|
427
|
+
}>;
|
|
428
|
+
readonly label: StringType;
|
|
429
|
+
}>;
|
|
430
|
+
/** The selection footer. */
|
|
431
|
+
readonly Footer: StructType<{
|
|
432
|
+
readonly valueLabel: StringType;
|
|
433
|
+
readonly compareLabel: StringType;
|
|
434
|
+
readonly legend: import("@elaraai/east").OptionType<StructType<{
|
|
435
|
+
readonly low: StringType;
|
|
436
|
+
readonly high: StringType;
|
|
437
|
+
}>>;
|
|
438
|
+
}>;
|
|
439
|
+
/** The heatmap legend. */
|
|
440
|
+
readonly Legend: StructType<{
|
|
441
|
+
readonly low: StringType;
|
|
442
|
+
readonly high: StringType;
|
|
443
|
+
}>;
|
|
231
444
|
};
|
|
232
445
|
};
|
|
233
446
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collections/calendar/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collections/calendar/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,MAAM,EAMX,SAAS,EACT,WAAW,EACX,SAAS,EACT,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,QAAQ,EACb,UAAU,EACV,UAAU,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAGH,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EAExB,kBAAkB,EACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,kBAAkB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IACtE,MAAM,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAetF;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,0EAA0E;IA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