@arcfusionz/arc-analytic-ui 0.0.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/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/AnomalyCard/AnomalyCard.chart.d.ts +64 -0
- package/dist/components/AnomalyCard/AnomalyCard.chart.js +341 -0
- package/dist/components/AnomalyCard/AnomalyCard.d.ts +169 -0
- package/dist/components/AnomalyCard/AnomalyCard.js +1019 -0
- package/dist/components/AnomalyCard/AnomalyCard.model.d.ts +508 -0
- package/dist/components/AnomalyCard/AnomalyCard.model.js +553 -0
- package/dist/components/AnomalyCard/index.d.ts +4 -0
- package/dist/components/AnomalyCard/index.js +4 -0
- package/dist/components/ChartCard/ChartCard.chart.d.ts +72 -0
- package/dist/components/ChartCard/ChartCard.chart.js +1333 -0
- package/dist/components/ChartCard/ChartCard.d.ts +206 -0
- package/dist/components/ChartCard/ChartCard.js +718 -0
- package/dist/components/ChartCard/ChartCard.model.d.ts +452 -0
- package/dist/components/ChartCard/ChartCard.model.js +1223 -0
- package/dist/components/ChartCard/index.d.ts +4 -0
- package/dist/components/ChartCard/index.js +4 -0
- package/dist/components/ComparisonCard/ComparisonCard.chart.d.ts +80 -0
- package/dist/components/ComparisonCard/ComparisonCard.chart.js +337 -0
- package/dist/components/ComparisonCard/ComparisonCard.d.ts +200 -0
- package/dist/components/ComparisonCard/ComparisonCard.js +1325 -0
- package/dist/components/ComparisonCard/ComparisonCard.model.d.ts +309 -0
- package/dist/components/ComparisonCard/ComparisonCard.model.js +263 -0
- package/dist/components/ComparisonCard/index.d.ts +4 -0
- package/dist/components/ComparisonCard/index.js +4 -0
- package/dist/components/ForecastCard/ForecastCard.chart.d.ts +82 -0
- package/dist/components/ForecastCard/ForecastCard.chart.js +416 -0
- package/dist/components/ForecastCard/ForecastCard.d.ts +148 -0
- package/dist/components/ForecastCard/ForecastCard.js +1029 -0
- package/dist/components/ForecastCard/ForecastCard.model.d.ts +497 -0
- package/dist/components/ForecastCard/ForecastCard.model.js +554 -0
- package/dist/components/ForecastCard/index.d.ts +4 -0
- package/dist/components/ForecastCard/index.js +4 -0
- package/dist/components/HighlightCard/HighlightCard.chart.d.ts +122 -0
- package/dist/components/HighlightCard/HighlightCard.chart.js +660 -0
- package/dist/components/HighlightCard/HighlightCard.d.ts +202 -0
- package/dist/components/HighlightCard/HighlightCard.js +1286 -0
- package/dist/components/HighlightCard/HighlightCard.model.d.ts +692 -0
- package/dist/components/HighlightCard/HighlightCard.model.js +875 -0
- package/dist/components/HighlightCard/index.d.ts +4 -0
- package/dist/components/HighlightCard/index.js +4 -0
- package/dist/components/InsightCard/InsightCard.chart.d.ts +91 -0
- package/dist/components/InsightCard/InsightCard.chart.js +471 -0
- package/dist/components/InsightCard/InsightCard.d.ts +161 -0
- package/dist/components/InsightCard/InsightCard.js +961 -0
- package/dist/components/InsightCard/InsightCard.model.d.ts +405 -0
- package/dist/components/InsightCard/InsightCard.model.js +421 -0
- package/dist/components/InsightCard/index.d.ts +4 -0
- package/dist/components/InsightCard/index.js +4 -0
- package/dist/components/MetricCard/MetricCard.chart.d.ts +79 -0
- package/dist/components/MetricCard/MetricCard.chart.js +435 -0
- package/dist/components/MetricCard/MetricCard.d.ts +227 -0
- package/dist/components/MetricCard/MetricCard.js +1293 -0
- package/dist/components/MetricCard/MetricCard.model.d.ts +521 -0
- package/dist/components/MetricCard/MetricCard.model.js +627 -0
- package/dist/components/MetricCard/index.d.ts +4 -0
- package/dist/components/MetricCard/index.js +4 -0
- package/dist/components/ProfileCard/ProfileCard.chart.d.ts +64 -0
- package/dist/components/ProfileCard/ProfileCard.chart.js +427 -0
- package/dist/components/ProfileCard/ProfileCard.d.ts +140 -0
- package/dist/components/ProfileCard/ProfileCard.js +735 -0
- package/dist/components/ProfileCard/ProfileCard.model.d.ts +279 -0
- package/dist/components/ProfileCard/ProfileCard.model.js +244 -0
- package/dist/components/ProfileCard/index.d.ts +4 -0
- package/dist/components/ProfileCard/index.js +4 -0
- package/dist/components/ProgressCard/ProgressCard.chart.d.ts +73 -0
- package/dist/components/ProgressCard/ProgressCard.chart.js +373 -0
- package/dist/components/ProgressCard/ProgressCard.d.ts +137 -0
- package/dist/components/ProgressCard/ProgressCard.js +908 -0
- package/dist/components/ProgressCard/ProgressCard.model.d.ts +385 -0
- package/dist/components/ProgressCard/ProgressCard.model.js +389 -0
- package/dist/components/ProgressCard/index.d.ts +4 -0
- package/dist/components/ProgressCard/index.js +4 -0
- package/dist/components/ReportCard/ReportCard.chart.d.ts +45 -0
- package/dist/components/ReportCard/ReportCard.chart.js +231 -0
- package/dist/components/ReportCard/ReportCard.d.ts +153 -0
- package/dist/components/ReportCard/ReportCard.js +1118 -0
- package/dist/components/ReportCard/ReportCard.model.d.ts +392 -0
- package/dist/components/ReportCard/ReportCard.model.js +399 -0
- package/dist/components/ReportCard/index.d.ts +4 -0
- package/dist/components/ReportCard/index.js +4 -0
- package/dist/components/SankeyCard/SankeyCard.chart.d.ts +75 -0
- package/dist/components/SankeyCard/SankeyCard.chart.js +249 -0
- package/dist/components/SankeyCard/SankeyCard.d.ts +185 -0
- package/dist/components/SankeyCard/SankeyCard.js +788 -0
- package/dist/components/SankeyCard/SankeyCard.model.d.ts +501 -0
- package/dist/components/SankeyCard/SankeyCard.model.js +789 -0
- package/dist/components/SankeyCard/index.d.ts +4 -0
- package/dist/components/SankeyCard/index.js +4 -0
- package/dist/components/StatusCard/StatusCard.chart.d.ts +60 -0
- package/dist/components/StatusCard/StatusCard.chart.js +188 -0
- package/dist/components/StatusCard/StatusCard.d.ts +176 -0
- package/dist/components/StatusCard/StatusCard.js +989 -0
- package/dist/components/StatusCard/StatusCard.model.d.ts +555 -0
- package/dist/components/StatusCard/StatusCard.model.js +776 -0
- package/dist/components/StatusCard/index.d.ts +4 -0
- package/dist/components/StatusCard/index.js +4 -0
- package/dist/components/TableCard/TableCard.chart.d.ts +53 -0
- package/dist/components/TableCard/TableCard.chart.js +192 -0
- package/dist/components/TableCard/TableCard.d.ts +140 -0
- package/dist/components/TableCard/TableCard.js +811 -0
- package/dist/components/TableCard/TableCard.model.d.ts +381 -0
- package/dist/components/TableCard/TableCard.model.js +475 -0
- package/dist/components/TableCard/index.d.ts +4 -0
- package/dist/components/TableCard/index.js +4 -0
- package/dist/components/TargetCard/TargetCard.chart.d.ts +52 -0
- package/dist/components/TargetCard/TargetCard.chart.js +273 -0
- package/dist/components/TargetCard/TargetCard.d.ts +143 -0
- package/dist/components/TargetCard/TargetCard.js +910 -0
- package/dist/components/TargetCard/TargetCard.model.d.ts +468 -0
- package/dist/components/TargetCard/TargetCard.model.js +581 -0
- package/dist/components/TargetCard/index.d.ts +4 -0
- package/dist/components/TargetCard/index.js +4 -0
- package/dist/components/TreeCard/TreeCard.chart.d.ts +80 -0
- package/dist/components/TreeCard/TreeCard.chart.js +178 -0
- package/dist/components/TreeCard/TreeCard.d.ts +182 -0
- package/dist/components/TreeCard/TreeCard.js +1187 -0
- package/dist/components/TreeCard/TreeCard.model.d.ts +330 -0
- package/dist/components/TreeCard/TreeCard.model.js +401 -0
- package/dist/components/TreeCard/index.d.ts +4 -0
- package/dist/components/TreeCard/index.js +4 -0
- package/dist/components/TrendCard/TrendCard.chart.d.ts +75 -0
- package/dist/components/TrendCard/TrendCard.chart.js +393 -0
- package/dist/components/TrendCard/TrendCard.d.ts +224 -0
- package/dist/components/TrendCard/TrendCard.js +1053 -0
- package/dist/components/TrendCard/TrendCard.model.d.ts +545 -0
- package/dist/components/TrendCard/TrendCard.model.js +623 -0
- package/dist/components/TrendCard/index.d.ts +4 -0
- package/dist/components/TrendCard/index.js +4 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +57 -0
- package/dist/lib/vega/ArcVegaChart.d.ts +24 -0
- package/dist/lib/vega/ArcVegaChart.js +42 -0
- package/dist/lib/vega/ArcVegaSurface.d.ts +13 -0
- package/dist/lib/vega/ArcVegaSurface.js +38 -0
- package/dist/lib/vega/axisTicks.js +156 -0
- package/dist/lib/vega/config.d.ts +29 -0
- package/dist/lib/vega/config.js +113 -0
- package/dist/lib/vega/embed.d.ts +29 -0
- package/dist/lib/vega/embed.js +29 -0
- package/dist/lib/vega/engine.d.ts +10 -0
- package/dist/lib/vega/engine.js +6 -0
- package/dist/lib/vega/formatters.d.ts +125 -0
- package/dist/lib/vega/formatters.js +277 -0
- package/dist/lib/vega/index.d.ts +11 -0
- package/dist/lib/vega/load.d.ts +13 -0
- package/dist/lib/vega/load.js +21 -0
- package/dist/lib/vega/time.d.ts +45 -0
- package/dist/lib/vega/time.js +105 -0
- package/dist/lib/vega/tokens.d.ts +73 -0
- package/dist/lib/vega/tokens.js +137 -0
- package/dist/lib/vega/tooltip.d.ts +45 -0
- package/dist/lib/vega/tooltip.js +124 -0
- package/dist/lib/vega/useArcVega.d.ts +43 -0
- package/dist/lib/vega/useArcVega.js +121 -0
- package/package.json +60 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { ArcTimeGranularity } from "../../lib/vega/formatters.js";
|
|
2
|
+
//#region src/components/ProgressCard/ProgressCard.model.d.ts
|
|
3
|
+
/** What the consumer's transport reports. */
|
|
4
|
+
type ProgressCardStatus = "loading" | "ready" | "error";
|
|
5
|
+
/**
|
|
6
|
+
* What the card actually shows, derived from `status`, the snapshots and
|
|
7
|
+
* `filtered`. Stamped on the root as `data-state`. `insufficient` is a run
|
|
8
|
+
* with fewer than two readings: there is a completion to show but no
|
|
9
|
+
* trajectory to draw and no rate to project from, so the plot degrades to the
|
|
10
|
+
* bar and says so rather than inventing a trend from one point.
|
|
11
|
+
*/
|
|
12
|
+
type ProgressCardState = "loading" | "refreshing" | "ready" | "insufficient" | "empty" | "no-match" | "error";
|
|
13
|
+
type ProgressCardSize = "sm" | "md" | "lg";
|
|
14
|
+
/**
|
|
15
|
+
* What the big number is: the finished share (default), the date the work is
|
|
16
|
+
* projected to finish, or how much is left. Stamped as `data-headline`.
|
|
17
|
+
*/
|
|
18
|
+
type ProgressHeadline = "percent" | "date" | "remaining";
|
|
19
|
+
/**
|
|
20
|
+
* The judgement the card reaches, stamped as `data-verdict`. `done` — every
|
|
21
|
+
* unit is finished. `on-time` — the current rate lands on or before the due
|
|
22
|
+
* date. `at-risk` — it lands after it but within `tolerance` days.
|
|
23
|
+
* `late` — beyond that. `stalled` — nothing has been finished across the
|
|
24
|
+
* rate window, so there is no rate to project with and the work is not
|
|
25
|
+
* moving. Without a `due` date there is no verdict short of `done` and
|
|
26
|
+
* `stalled`: a projection with nothing to measure it against is not a
|
|
27
|
+
* judgement.
|
|
28
|
+
*/
|
|
29
|
+
type ProgressVerdict = "done" | "on-time" | "at-risk" | "late" | "stalled";
|
|
30
|
+
/** How a reading reads once the deadline is applied. Stamped as `data-polarity`. */
|
|
31
|
+
type ProgressPolarity = "positive" | "negative" | "neutral";
|
|
32
|
+
/**
|
|
33
|
+
* What a stage means for completion, for the optional breakdown bar.
|
|
34
|
+
* `complete` is finished work, `active` is in flight (the default), `blocked`
|
|
35
|
+
* has stopped and needs someone, `remaining` is not started.
|
|
36
|
+
*/
|
|
37
|
+
type ProgressStageTone = "complete" | "active" | "blocked" | "remaining";
|
|
38
|
+
/**
|
|
39
|
+
* One reading of the run: how much was finished by `date`, and what the whole
|
|
40
|
+
* was at that moment.
|
|
41
|
+
*/
|
|
42
|
+
interface ProgressSnapshot {
|
|
43
|
+
/** When the reading was taken. Date-only ISO strings are midnight in the card's `timeZone`. */
|
|
44
|
+
date: Date | string | number;
|
|
45
|
+
/**
|
|
46
|
+
* Cumulative units finished by then — the running total, not the delta.
|
|
47
|
+
* `null` is a reading the transport missed: the line breaks at it rather
|
|
48
|
+
* than drawing through it.
|
|
49
|
+
*/
|
|
50
|
+
completed: number | null;
|
|
51
|
+
/**
|
|
52
|
+
* The whole as it stood at that moment. Defaults to the card's `total`, so
|
|
53
|
+
* a run whose scope never moved needs only `completed`. Passing it per
|
|
54
|
+
* snapshot is what makes a scope change visible instead of hidden — the
|
|
55
|
+
* reason this card is a burn-up.
|
|
56
|
+
*/
|
|
57
|
+
total?: number | null;
|
|
58
|
+
}
|
|
59
|
+
/** A snapshot placed on the run. */
|
|
60
|
+
interface ProgressPoint {
|
|
61
|
+
/** The reading's instant, in epoch milliseconds. */
|
|
62
|
+
t: number;
|
|
63
|
+
/** Units finished, or `null` for a missed reading. */
|
|
64
|
+
completed: number | null;
|
|
65
|
+
/** The whole at that instant. */
|
|
66
|
+
total: number;
|
|
67
|
+
}
|
|
68
|
+
/** Where the current rate lands. */
|
|
69
|
+
interface ProgressProjection {
|
|
70
|
+
/** The instant the run reaches its scope at the observed rate. */
|
|
71
|
+
date: number;
|
|
72
|
+
/** Whole days between the due date and that instant — negative is early, positive is late. */
|
|
73
|
+
daysLate: number;
|
|
74
|
+
/** The projection lands after the due date. */
|
|
75
|
+
late: boolean;
|
|
76
|
+
/** Formatted finish date, in the card's locale, zone and `updatedAtFormat`. */
|
|
77
|
+
dateText: string;
|
|
78
|
+
/** `2 days late` / `3 days early` / `on the due date`, or the bare date when there is no deadline. */
|
|
79
|
+
text: string;
|
|
80
|
+
/** Whether the rate came from the readings (`observed`) or from the consumer's own forecast (`explicit`). */
|
|
81
|
+
source: "observed" | "explicit";
|
|
82
|
+
}
|
|
83
|
+
/** The rate the work is being finished at. */
|
|
84
|
+
interface ProgressRate {
|
|
85
|
+
/** Units per day across the rate window. */
|
|
86
|
+
perDay: number;
|
|
87
|
+
/** Days the rate was measured over. */
|
|
88
|
+
days: number;
|
|
89
|
+
/** Units per day the deadline needs from now on — `remaining / days left`; `null` without a due date or once it has passed. */
|
|
90
|
+
requiredPerDay: number | null;
|
|
91
|
+
/** `12 tables/day`, in the card's grammar. */
|
|
92
|
+
text: string;
|
|
93
|
+
/** The required rate in the same grammar, or `null`. */
|
|
94
|
+
requiredText: string | null;
|
|
95
|
+
}
|
|
96
|
+
/** One stage of the optional breakdown bar. */
|
|
97
|
+
interface ProgressStageInput {
|
|
98
|
+
/** Identifies the stage; defaults to `label`. */
|
|
99
|
+
key?: string;
|
|
100
|
+
/** The stage's name — the legend row and the bar's accessible name. */
|
|
101
|
+
label: string;
|
|
102
|
+
/** Units in this stage. `null` keeps the row with no segment; a count cannot be negative, so a negative reads `—`. */
|
|
103
|
+
value: number | null;
|
|
104
|
+
/** What the stage means for completion. Default `active`. */
|
|
105
|
+
tone?: ProgressStageTone;
|
|
106
|
+
}
|
|
107
|
+
/** A stage placed on the breakdown bar. */
|
|
108
|
+
interface ProgressStage {
|
|
109
|
+
key: string;
|
|
110
|
+
label: string;
|
|
111
|
+
value: number;
|
|
112
|
+
missing: boolean;
|
|
113
|
+
tone: ProgressStageTone;
|
|
114
|
+
/** `value / total`, in `[0, 1]`. */
|
|
115
|
+
share: number;
|
|
116
|
+
/** The segment's width as a CSS percentage string. */
|
|
117
|
+
width: string;
|
|
118
|
+
valueText: string;
|
|
119
|
+
shareText: string;
|
|
120
|
+
/** The card synthesised this stage from the units the parts left unaccounted. */
|
|
121
|
+
implicit: boolean;
|
|
122
|
+
}
|
|
123
|
+
/** Everything the card derives from the snapshots and the deadline. */
|
|
124
|
+
interface ProgressRun {
|
|
125
|
+
/** Readings in chronological order. */
|
|
126
|
+
points: ProgressPoint[];
|
|
127
|
+
/** Readings that carry a count — what the line can actually draw. */
|
|
128
|
+
observed: ProgressPoint[];
|
|
129
|
+
/** First and last reading instants. */
|
|
130
|
+
start: number;
|
|
131
|
+
/** The as-of instant: the last reading that carries a count. */
|
|
132
|
+
asOf: number;
|
|
133
|
+
/** The deadline, or `null`. */
|
|
134
|
+
due: number | null;
|
|
135
|
+
/** The whole as it stands now. */
|
|
136
|
+
scope: number;
|
|
137
|
+
/** The whole when the run started — different from `scope` when the goalposts moved. */
|
|
138
|
+
openingScope: number;
|
|
139
|
+
openingScopeText: string;
|
|
140
|
+
/** The scope moved during the run, which a burn-down would have hidden. */
|
|
141
|
+
scopeChanged: boolean;
|
|
142
|
+
/** Units finished now. */
|
|
143
|
+
completed: number;
|
|
144
|
+
/** `scope − completed`. */
|
|
145
|
+
remaining: number;
|
|
146
|
+
/** `completed / scope`, in `[0, 1]`. */
|
|
147
|
+
completeRatio: number;
|
|
148
|
+
rate: ProgressRate | null;
|
|
149
|
+
projection: ProgressProjection | null;
|
|
150
|
+
verdict: ProgressVerdict | null;
|
|
151
|
+
polarity: ProgressPolarity;
|
|
152
|
+
/** The ideal line's two ends — `[start, 0]` to `[due, scope]`; `null` without a deadline. */
|
|
153
|
+
ideal: {
|
|
154
|
+
from: {
|
|
155
|
+
t: number;
|
|
156
|
+
y: number;
|
|
157
|
+
};
|
|
158
|
+
to: {
|
|
159
|
+
t: number;
|
|
160
|
+
y: number;
|
|
161
|
+
};
|
|
162
|
+
} | null;
|
|
163
|
+
/** The plot's x domain, spanning the readings, the deadline and the projection. */
|
|
164
|
+
bounds: {
|
|
165
|
+
min: number;
|
|
166
|
+
max: number;
|
|
167
|
+
};
|
|
168
|
+
scopeText: string;
|
|
169
|
+
completedText: string;
|
|
170
|
+
remainingText: string;
|
|
171
|
+
percentText: string;
|
|
172
|
+
dueText: string | null;
|
|
173
|
+
asOfText: string;
|
|
174
|
+
done: boolean;
|
|
175
|
+
/** Fewer than two readings carry a count, so there is no trajectory and no rate. */
|
|
176
|
+
insufficient: boolean;
|
|
177
|
+
/** Nothing was finished between the last two readings, so the run is not moving and no projection is honest. */
|
|
178
|
+
stalled: boolean;
|
|
179
|
+
/** The stage breakdown, when the consumer passed one. */
|
|
180
|
+
stages: ProgressStage[];
|
|
181
|
+
}
|
|
182
|
+
/** A row of the details table. */
|
|
183
|
+
interface ProgressDetailRow {
|
|
184
|
+
key: string;
|
|
185
|
+
label: string;
|
|
186
|
+
value: string;
|
|
187
|
+
/** Share of the whole, where the row has one. */
|
|
188
|
+
share?: string;
|
|
189
|
+
/** The stage this row draws, so the table can wear its swatch. */
|
|
190
|
+
stage?: ProgressStage;
|
|
191
|
+
/** A summary row, set in the medium weight. */
|
|
192
|
+
summary?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/** Every string the card renders or announces, so a product can localise it. Sentences are functions. */
|
|
195
|
+
interface ProgressCardLabels {
|
|
196
|
+
/** After the finished share — `68% complete`. */
|
|
197
|
+
complete: string;
|
|
198
|
+
/** The line under a percent headline — `164 of 240`. */
|
|
199
|
+
countLine: (value: string, total: string) => string;
|
|
200
|
+
/** The line under a count or date headline — `68% complete`. Takes the resolved labels so overriding `complete` reaches it. */
|
|
201
|
+
percentLine: (percent: string, labels: ProgressCardLabels) => string;
|
|
202
|
+
/** The headline's own words when it counts what is left — `76 left`. */
|
|
203
|
+
remainingHeadline: (value: string) => string;
|
|
204
|
+
/** Names the projected finish — `Finishes Sep 18`. */
|
|
205
|
+
finishes: (date: string) => string;
|
|
206
|
+
/**
|
|
207
|
+
* The projection against the deadline — `2 days late`. Takes the count, not
|
|
208
|
+
* a pre-built phrase, so the noun and its plural belong to the label: a
|
|
209
|
+
* language with different plural rules (or none) writes the whole thing.
|
|
210
|
+
*/
|
|
211
|
+
daysLate: (days: number) => string;
|
|
212
|
+
/** … and the other way — `3 days early`. */
|
|
213
|
+
daysEarly: (days: number) => string;
|
|
214
|
+
/** The projection landing exactly on the due date. */
|
|
215
|
+
onDueDate: string;
|
|
216
|
+
/** The verdict chip's words. */
|
|
217
|
+
verdicts: Record<ProgressVerdict, string>;
|
|
218
|
+
/** The rate, in the card's own units — `12 tables/day` becomes `12/day` without a unit. */
|
|
219
|
+
perDay: (value: string) => string;
|
|
220
|
+
/** The rate the deadline still needs — `needs 19/day`. */
|
|
221
|
+
needsPerDay: (value: string) => string;
|
|
222
|
+
/** Mark names for the plot's legend, tooltip and table. */
|
|
223
|
+
markNames: {
|
|
224
|
+
completed: string;
|
|
225
|
+
scope: string;
|
|
226
|
+
ideal: string;
|
|
227
|
+
projection: string;
|
|
228
|
+
due: string;
|
|
229
|
+
};
|
|
230
|
+
/** The work in flight, on the breakdown bar. */
|
|
231
|
+
active: string;
|
|
232
|
+
blocked: string;
|
|
233
|
+
remaining: string;
|
|
234
|
+
total: string;
|
|
235
|
+
scope: string;
|
|
236
|
+
/** The note under the plot when the scope moved during the run. */
|
|
237
|
+
scopeMoved: (from: string, to: string) => string;
|
|
238
|
+
/** Table columns and rows. */
|
|
239
|
+
tableItem: string;
|
|
240
|
+
tableValue: string;
|
|
241
|
+
tableShare: string;
|
|
242
|
+
tableDate: string;
|
|
243
|
+
tableCompleted: string;
|
|
244
|
+
/** The caption in the plot's place when there is only one reading. */
|
|
245
|
+
needsHistory: string;
|
|
246
|
+
noData: string;
|
|
247
|
+
noMatch: string;
|
|
248
|
+
clearFilters: string;
|
|
249
|
+
error: string;
|
|
250
|
+
retry: string;
|
|
251
|
+
stale: string;
|
|
252
|
+
asOf: string;
|
|
253
|
+
showTable: (name: string) => string;
|
|
254
|
+
hideTable: (name: string) => string;
|
|
255
|
+
about: (name: string) => string;
|
|
256
|
+
loading: (name: string) => string;
|
|
257
|
+
tableCaption: (name: string) => string;
|
|
258
|
+
/** Accessible name of the headline group whose tooltip explains the projection. */
|
|
259
|
+
progressGroup: (name: string) => string;
|
|
260
|
+
/** Accessible name of the composed breakdown bar — it is one image, so the whole thing is named. */
|
|
261
|
+
stageBar: (name: string, parts: string) => string;
|
|
262
|
+
/** Accessible name of the AI mark beside the insight sentence. */
|
|
263
|
+
insightMark: string;
|
|
264
|
+
/** Compact label/value rows explaining the headline. */
|
|
265
|
+
explanation: (run: ProgressRun, labels: ProgressCardLabels) => readonly (readonly [label: string, value: string])[];
|
|
266
|
+
/** The plot's own accessible label. */
|
|
267
|
+
chartDescription: (name: string, run: ProgressRun, labels: ProgressCardLabels) => string;
|
|
268
|
+
/** The whole card's accessible description — Cesal's alt-text formula. */
|
|
269
|
+
description: (input: ProgressDescriptionInput) => string;
|
|
270
|
+
}
|
|
271
|
+
interface ProgressDescriptionInput {
|
|
272
|
+
name: string;
|
|
273
|
+
state: ProgressCardState;
|
|
274
|
+
run: ProgressRun | null;
|
|
275
|
+
labels: ProgressCardLabels;
|
|
276
|
+
}
|
|
277
|
+
declare const DEFAULT_PROGRESS_LABELS: ProgressCardLabels;
|
|
278
|
+
/** Merges consumer overrides over the English defaults. */
|
|
279
|
+
declare function resolveProgressLabels(overrides?: Partial<ProgressCardLabels>): ProgressCardLabels;
|
|
280
|
+
interface ProgressTextFormatters {
|
|
281
|
+
formatValue: (value: number | null | undefined) => string;
|
|
282
|
+
formatShare: (ratio: number) => string;
|
|
283
|
+
formatDay: (ms: number) => string;
|
|
284
|
+
/**
|
|
285
|
+
* A per-day rate. Keeps the card's own grammar, except that `integer`
|
|
286
|
+
* becomes `number:1` — a rate is a derived quantity, and a run finishing
|
|
287
|
+
* 7.8 units a day would otherwise round to "8", while anything under one a
|
|
288
|
+
* day would round to "0" and read as stalled when it is not.
|
|
289
|
+
*/
|
|
290
|
+
formatRate: (value: number) => string;
|
|
291
|
+
}
|
|
292
|
+
interface CreateProgressFormattersInput {
|
|
293
|
+
/** `arcNumber` grammar for counts — `integer` by default, since a run counts things. */
|
|
294
|
+
format?: string;
|
|
295
|
+
locale?: string;
|
|
296
|
+
timeZone?: string;
|
|
297
|
+
/** Takes precedence over `format` everywhere a count is rendered. */
|
|
298
|
+
formatValue?: (value: number) => string;
|
|
299
|
+
/** Fraction digits for every share. Default 0. */
|
|
300
|
+
percentDigits?: number;
|
|
301
|
+
/** How dates are written. Default `day`. */
|
|
302
|
+
dateGranularity?: ArcTimeGranularity;
|
|
303
|
+
/** Takes precedence over `dateGranularity` everywhere a date is rendered. */
|
|
304
|
+
formatDateValue?: (date: Date) => string;
|
|
305
|
+
}
|
|
306
|
+
declare function createProgressFormatters({ format, locale, timeZone, formatValue, percentDigits, dateGranularity, formatDateValue }?: CreateProgressFormattersInput): ProgressTextFormatters;
|
|
307
|
+
/**
|
|
308
|
+
* Whole calendar days from `from` to `to` in `timeZone` — counted between
|
|
309
|
+
* calendar dates, so a daylight-saving change never shifts the count and
|
|
310
|
+
* "2 days late" means two dates on the wall calendar.
|
|
311
|
+
*/
|
|
312
|
+
declare function dayDiff(from: number, to: number, timeZone?: string): number;
|
|
313
|
+
interface DeriveProgressStateInput {
|
|
314
|
+
status: ProgressCardStatus;
|
|
315
|
+
/** At least one reading carries a count. */
|
|
316
|
+
hasValues: boolean;
|
|
317
|
+
/** There is a whole to divide. */
|
|
318
|
+
hasData: boolean;
|
|
319
|
+
/** At least two readings carry a count, so a trajectory exists. */
|
|
320
|
+
hasTrend: boolean;
|
|
321
|
+
filtered: boolean;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The state machine: the transport's `status` first, then what the data says.
|
|
325
|
+
* A refresh over existing readings keeps the previous render under the veil
|
|
326
|
+
* rather than swapping to a skeleton, so a dashboard never jumps. One reading
|
|
327
|
+
* is `insufficient`, not `ready`: a completion with no history.
|
|
328
|
+
*/
|
|
329
|
+
declare function deriveProgressState({ status, hasValues, hasData, hasTrend, filtered }: DeriveProgressStateInput): ProgressCardState;
|
|
330
|
+
/** Places the optional breakdown stages over the run's scope. */
|
|
331
|
+
declare function deriveProgressStages(input: readonly ProgressStageInput[], scope: number, formatters: ProgressTextFormatters, labels: ProgressCardLabels): ProgressStage[];
|
|
332
|
+
interface DeriveProgressRunInput {
|
|
333
|
+
snapshots: readonly ProgressSnapshot[];
|
|
334
|
+
/** The whole, for snapshots that do not carry their own. */
|
|
335
|
+
total?: number | null;
|
|
336
|
+
/** The deadline. */
|
|
337
|
+
due?: Date | string | number | null;
|
|
338
|
+
/**
|
|
339
|
+
* Days of recent history the rate is measured over. Omit to use the whole
|
|
340
|
+
* run (`completed / elapsed`), which is steadier and matches TargetCard's
|
|
341
|
+
* linear run rate; pass a window when a recent change of pace is the point.
|
|
342
|
+
*/
|
|
343
|
+
rateWindow?: number;
|
|
344
|
+
/** The consumer's own forecast finish, replacing the observed rate's. */
|
|
345
|
+
projected?: Date | string | number | null;
|
|
346
|
+
/** Days past the due date that still count as `at-risk` rather than `late`. Default 2. */
|
|
347
|
+
tolerance?: number;
|
|
348
|
+
/** The optional breakdown stages. */
|
|
349
|
+
stages?: readonly ProgressStageInput[];
|
|
350
|
+
formatters: ProgressTextFormatters;
|
|
351
|
+
labels: ProgressCardLabels;
|
|
352
|
+
timeZone?: string;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Normalises the snapshots into a burn-up run: readings in order, the scope as
|
|
356
|
+
* it stood at each of them, the rate the work is actually being finished at,
|
|
357
|
+
* where that rate crosses the scope, and the verdict against the deadline.
|
|
358
|
+
* Returns `null` when there is nothing to divide — no reading carries a count
|
|
359
|
+
* and no `total` was declared.
|
|
360
|
+
*/
|
|
361
|
+
declare function deriveProgressRun({ snapshots, total: declaredTotal, due: dueInput, rateWindow, projected, tolerance, stages: stageInput, formatters, labels, timeZone }: DeriveProgressRunInput): ProgressRun | null;
|
|
362
|
+
/** The headline's big text and the line beneath it, per `headline`. */
|
|
363
|
+
declare function buildProgressHeadline(run: ProgressRun, headline: ProgressHeadline, labels: ProgressCardLabels): {
|
|
364
|
+
big: string;
|
|
365
|
+
sub: string;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* The table twin: every reading in order, labelled by its own date, with the
|
|
369
|
+
* count finished by then and the share it made of the scope as it stood — so
|
|
370
|
+
* a reader who cannot use the plot reads the same trajectory — then the run's
|
|
371
|
+
* own figures beneath.
|
|
372
|
+
*/
|
|
373
|
+
declare function buildProgressReadingRows(run: ProgressRun, formatters: ProgressTextFormatters, labels: ProgressCardLabels): ProgressDetailRow[];
|
|
374
|
+
/** The stage rows for the details table, when the consumer passed a breakdown. */
|
|
375
|
+
declare function buildProgressStageRows(run: ProgressRun, labels: ProgressCardLabels): ProgressDetailRow[];
|
|
376
|
+
/** The headline group's explanation rows. */
|
|
377
|
+
declare function buildProgressExplanation(run: ProgressRun, labels: ProgressCardLabels): readonly (readonly [label: string, value: string])[];
|
|
378
|
+
/** The plot's own accessible label. */
|
|
379
|
+
declare function buildProgressChartDescription(name: string, run: ProgressRun, labels: ProgressCardLabels): string;
|
|
380
|
+
/** The whole card's accessible description. */
|
|
381
|
+
declare function buildProgressDescription(input: ProgressDescriptionInput): string;
|
|
382
|
+
/** The composed breakdown bar is one image, so its parts are named in one string. */
|
|
383
|
+
declare function buildStageBarLabel(name: string, run: ProgressRun, labels: ProgressCardLabels): string;
|
|
384
|
+
//#endregion
|
|
385
|
+
export { CreateProgressFormattersInput, DEFAULT_PROGRESS_LABELS, DeriveProgressRunInput, DeriveProgressStateInput, ProgressCardLabels, ProgressCardSize, ProgressCardState, ProgressCardStatus, ProgressDescriptionInput, ProgressDetailRow, ProgressHeadline, ProgressPoint, ProgressPolarity, ProgressProjection, ProgressRate, ProgressRun, ProgressSnapshot, ProgressStage, ProgressStageInput, ProgressStageTone, ProgressTextFormatters, ProgressVerdict, buildProgressChartDescription, buildProgressDescription, buildProgressExplanation, buildProgressHeadline, buildProgressReadingRows, buildProgressStageRows, buildStageBarLabel, createProgressFormatters, dayDiff, deriveProgressRun, deriveProgressStages, deriveProgressState, resolveProgressLabels };
|