@action-state-group/capsule-viewer 0.4.0 → 0.5.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.
@@ -0,0 +1,170 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ import { ChartRefusal, checkChart, } from "./chart-spec.js";
3
+ const isObj = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
4
+ const refuse = (reason, message, pointer) => {
5
+ throw new ChartRefusal(reason, message, pointer);
6
+ };
7
+ const ID = /^[a-z][a-z0-9_]{0,31}$/u;
8
+ /** True for an entry of the `charts` setting that is a view, not a chart spec. */
9
+ export const isView = (value) => isObj(value) && Object.hasOwn(value, "view");
10
+ /** A chart's one key channel besides x. */
11
+ const keyChannel = (chart) => chart.keys.find((k) => k !== "x");
12
+ function onlyKeys(value, allowed, at) {
13
+ for (const key of Object.keys(value))
14
+ if (!allowed.includes(key))
15
+ refuse("view-unsupported-member", `${at}/${key} is not in the accepted subset`, `${at}/${key}`);
16
+ }
17
+ /** `{id, chart}`: an id the page draws as code, and a chart spec. */
18
+ function readEntry(value, at, seen) {
19
+ if (!isObj(value))
20
+ return refuse("view-unsupported-member", `${at} must be an object`, at);
21
+ onlyKeys(value, ["id", "chart"], at);
22
+ const { id, chart } = value;
23
+ if (typeof id !== "string" || !ID.test(id))
24
+ refuse("view-unsupported-member", `${at}/id must match ${ID.source}`, `${at}/id`);
25
+ if (seen.has(id))
26
+ refuse("view-unsupported-member", `${at}/id ${String(id)} is repeated`, at);
27
+ seen.add(id);
28
+ if (chart === undefined)
29
+ refuse("view-unsupported-member", `${at}/chart is missing`, `${at}/chart`);
30
+ return { id: id, spec: chart };
31
+ }
32
+ const list = (value, at, min) => {
33
+ if (!Array.isArray(value) || value.length < min)
34
+ refuse("view-unsupported-member", `${at} must be a list of at least ${String(min)}`, at);
35
+ return value;
36
+ };
37
+ // Days in a month of the proleptic Gregorian calendar, by arithmetic.
38
+ const monthDays = (year, month) => month === 2
39
+ ? (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
40
+ ? 29
41
+ : 28
42
+ : [4, 6, 9, 11].includes(month)
43
+ ? 30
44
+ : 31;
45
+ function wholeMonths(window) {
46
+ const [ty, tm, td] = window.to.split("-").map(Number);
47
+ return window.from.endsWith("-01") && td === monthDays(ty, tm);
48
+ }
49
+ /** Each day of a checked chart and whether it was not run: from its units, which an empty category domain leaves intact. */
50
+ function daysOf(chart) {
51
+ return new Map((chart.units ?? []).map((u) => [u.unit, u.notRun]));
52
+ }
53
+ /** The distinct records dated on a day that did not run: counted by the chart, shown in no cell. */
54
+ function unplacedOf(parts) {
55
+ const seqs = new Set();
56
+ for (const { chart } of parts)
57
+ for (const g of chart.groups)
58
+ if (g.notRun)
59
+ for (const row of g.rows)
60
+ seqs.add(row.seq);
61
+ return seqs.size;
62
+ }
63
+ /** A chart that fits a view's grid: one UTC day per x unit, a count, a plan that can say "not run". */
64
+ function checkFit(id, chart, extraKeys, extraWhat) {
65
+ const x = chart.channels.x;
66
+ if (chart.temporal !== "x" ||
67
+ x === undefined ||
68
+ x.timeUnit !== "utcyearmonthdate")
69
+ refuse("view-chart-shape", `${id}: x must be a temporal field in the unit utcyearmonthdate, so each group is one UTC day`);
70
+ if (chart.channels[chart.aggregate]?.aggregate !== "count")
71
+ refuse("view-chart-shape", `${id}: the aggregate must be count`);
72
+ if (!extraKeys(chart.keys.filter((k) => k !== "x").length))
73
+ refuse("view-chart-shape", `${id}: ${extraWhat} besides x, or the chart fits no grid`);
74
+ if (!chart.runs || chart.window === undefined)
75
+ refuse("view-runs-unsealed", `${id}: the plan does not say which days ran (it needs exactly one window node and the chart's runs), so a day nothing ran would read 0`);
76
+ }
77
+ /**
78
+ * Checks across the charts of one view: one set of days not run and (when
79
+ * `disjoint`) no row counted by two charts. One window needs no check of its
80
+ * own: a view needs a plan with exactly one window node, and `checkChart`
81
+ * holds every chart's window to it.
82
+ */
83
+ function checkTogether(parts, disjoint) {
84
+ const first = parts[0];
85
+ const window = first.chart.window;
86
+ const days = daysOf(first.chart);
87
+ const owner = new Map();
88
+ for (const { id, chart } of parts) {
89
+ const mine = daysOf(chart);
90
+ for (const [day, notRun] of days)
91
+ if (mine.get(day) !== notRun)
92
+ refuse("view-runs-mismatch", `${id} and ${first.id} disagree on whether ${day} ran`);
93
+ if (!disjoint)
94
+ continue;
95
+ for (const g of chart.groups)
96
+ for (const row of g.rows) {
97
+ const was = owner.get(row.seq);
98
+ if (was !== undefined && was !== id)
99
+ refuse("view-overlap", `record seq ${String(row.seq)} is counted by both ${was} and ${id}`);
100
+ owner.set(row.seq, id);
101
+ }
102
+ }
103
+ return window;
104
+ }
105
+ /**
106
+ * Read a view entry and check every chart in it against the dataset. Throws
107
+ * a {@link ChartRefusal}: a `view-*` reason for the view's own rules, the
108
+ * chart's own reason (with the chart's id in the message) when a chart in it
109
+ * fails its check.
110
+ */
111
+ export function checkView(value, dataset) {
112
+ if (!isObj(value))
113
+ return refuse("view-unsupported-member", "a view must be an object", "");
114
+ const kind = value.view;
115
+ const checkOne = (id, spec, at) => {
116
+ try {
117
+ return { id, chart: checkChart(spec, dataset) };
118
+ }
119
+ catch (err) {
120
+ if (err instanceof ChartRefusal)
121
+ // The chart's pointer is relative to the chart; make it the entry's.
122
+ throw new ChartRefusal(err.reason, `${id}: ${err.message.slice(err.reason.length + 2)}`, err.pointer === undefined ? at : `${at}${err.pointer}`);
123
+ throw err;
124
+ }
125
+ };
126
+ const seen = new Set();
127
+ if (kind === "calendar") {
128
+ onlyKeys(value, ["view", "lanes"], "");
129
+ const lanes = list(value.lanes, "/lanes", 1).map((raw, i) => readEntry(raw, `/lanes/${String(i)}`, seen));
130
+ const checked = lanes.map((l, i) => checkOne(l.id, l.spec, `/lanes/${String(i)}/chart`));
131
+ for (const lane of checked)
132
+ checkFit(lane.id, lane.chart, (n) => n <= 1, "at most one key channel");
133
+ const window = checkTogether(checked, false);
134
+ if (!wholeMonths(window))
135
+ refuse("view-window-not-months", `a calendar's window runs from a month's first day to a month's last day; ${window.from} to ${window.to} does not`);
136
+ return {
137
+ view: "calendar",
138
+ window,
139
+ unplaced: unplacedOf(checked),
140
+ lanes: checked,
141
+ };
142
+ }
143
+ if (kind === "by-period") {
144
+ onlyKeys(value, ["view", "count", "columns"], "");
145
+ const count = readEntry(value.count, "/count", seen);
146
+ const columns = (value.columns === undefined ? [] : list(value.columns, "/columns", 0)).map((raw, i) => readEntry(raw, `/columns/${String(i)}`, seen));
147
+ const all = [count, ...columns].map((e, i) => checkOne(e.id, e.spec, i === 0 ? "/count/chart" : `/columns/${String(i - 1)}/chart`));
148
+ for (const part of all)
149
+ checkFit(part.id, part.chart, (n) => n === 1, "exactly one key channel, the requirement,");
150
+ const field = all[0].chart.channels[all[0].chart.keys.find((k) => k !== "x")].field;
151
+ for (const part of all) {
152
+ const mine = part.chart.channels[part.chart.keys.find((k) => k !== "x")];
153
+ if (mine.field !== field)
154
+ refuse("view-chart-shape", `${part.id} groups by ${String(mine.field)}, not ${String(field)}`);
155
+ }
156
+ const types = new Set(all.flatMap((p) => p.chart.groups.map((g) => typeof g.key[keyChannel(p.chart)])));
157
+ if (types.size > 1)
158
+ refuse("view-chart-shape", `the charts' ${String(field)} values are of more than one type (${[...types].sort().join(", ")}), so a row would join unlike values`);
159
+ const window = checkTogether(all, true);
160
+ return {
161
+ view: "by-period",
162
+ window,
163
+ unplaced: unplacedOf(all),
164
+ count: all[0],
165
+ columns: all.slice(1),
166
+ };
167
+ }
168
+ return refuse("view-unsupported-member", 'view must be "calendar" or "by-period"', "/view");
169
+ }
170
+ //# sourceMappingURL=report-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-view.js","sourceRoot":"","sources":["../src/report-view.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EACL,YAAY,EACZ,UAAU,GAIX,MAAM,iBAAiB,CAAC;AAYzB,MAAM,KAAK,GAAG,CAAC,KAAc,EAAgB,EAAE,CAC7C,KAAK,KAAK,I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AAG,CAAC;YACzB,KAAK,EAAE,GAAG,CAAC,CAAC,CAAE;YACd,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;SACtB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CACX,yBAAyB,EACzB,wCAAwC,EACxC,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -19,7 +19,7 @@ const unreleased = typeof __CAPSULE_VIEWER_UNRELEASED__ === "boolean" &&
19
19
  __CAPSULE_VIEWER_UNRELEASED__;
20
20
  export const VIEWER_BUILD = {
21
21
  viewer: "@action-state-group/capsule-viewer",
22
- viewerVersion: "0.4.0",
22
+ viewerVersion: "0.5.0",
23
23
  verifier: "@action-state-group/agent-action-capsule",
24
24
  verifierVersion: "0.10.0",
25
25
  cllVersion: "0.3.0",
@@ -309,6 +309,18 @@
309
309
  "chart.evidence.records": "The records this value counts, each a link to its entry in this bundle's records",
310
310
  "chart.evidence.none": "Nothing counted: no record in this report's data falls here",
311
311
  "chart.refused": "This chart was not drawn: its spec does not match the report's data ({reason}).",
312
+ "calendar.weekday.1": "Mon",
313
+ "calendar.weekday.2": "Tue",
314
+ "calendar.weekday.3": "Wed",
315
+ "calendar.weekday.4": "Thu",
316
+ "calendar.weekday.5": "Fri",
317
+ "calendar.weekday.6": "Sat",
318
+ "calendar.weekday.7": "Sun",
319
+ "period.week": "Week of {date}",
320
+ "period.not_run_days.one": "{n} day not run",
321
+ "period.not_run_days.other": "{n} days not run",
322
+ "view.unplaced.one": "{n} record is dated on a day that did not run, so it is in no cell",
323
+ "view.unplaced.other": "{n} records are dated on days that did not run, so they are in no cell",
312
324
  "evidence.uncited.one": "{n} counted with no claim: this page's own reading, with no evidence to show",
313
325
  "evidence.uncited.other": "{n} counted with no claim: this page's own reading, with no evidence to show",
314
326
  "evidence.label.unsupported": "Unsupported: no record its claims cite is disclosed in this bundle",
@@ -408,6 +408,18 @@
408
408
  "chart.evidence.records": "The records this value counts, each a link to its entry in this bundle's records",
409
409
  "chart.evidence.none": "Nothing counted: no record in this report's data falls here",
410
410
  "chart.refused": "This chart was not drawn: its spec does not match the report's data ({reason}).",
411
+ "calendar.weekday.1": "Mon",
412
+ "calendar.weekday.2": "Tue",
413
+ "calendar.weekday.3": "Wed",
414
+ "calendar.weekday.4": "Thu",
415
+ "calendar.weekday.5": "Fri",
416
+ "calendar.weekday.6": "Sat",
417
+ "calendar.weekday.7": "Sun",
418
+ "period.week": "Week of {date}",
419
+ "period.not_run_days.one": "{n} day not run",
420
+ "period.not_run_days.other": "{n} days not run",
421
+ "view.unplaced.one": "{n} record is dated on a day that did not run, so it is in no cell",
422
+ "view.unplaced.other": "{n} records are dated on days that did not run, so they are in no cell",
411
423
  "evidence.uncited.one": "{n} counted with no claim: this page's own reading, with no evidence to show",
412
424
  "evidence.uncited.other": "{n} counted with no claim: this page's own reading, with no evidence to show",
413
425
  "evidence.label.unsupported": "Unsupported: no record its claims cite is disclosed in this bundle",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@action-state-group/capsule-viewer",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "capsule-viewer page emitter and presentation builder, under the Agent Action Capsule presentation contract",
5
5
  "license": "Apache-2.0 AND BSD-3-Clause",
6
6
  "type": "module",