derive-dashboards 0.10.0 → 0.11.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/body.mjs +5 -1
  3. package/dist/charts/data/words.d.mts +5 -0
  4. package/dist/charts/data/words.mjs +1 -0
  5. package/dist/charts/kinds/columns-data.mjs +4 -1
  6. package/dist/charts/kinds/grid-layout.mjs +84 -8
  7. package/dist/charts/kinds/grid-legend.mjs +27 -4
  8. package/dist/charts/kinds/grid-marks.mjs +56 -4
  9. package/dist/charts/kinds/grid.mjs +2 -1
  10. package/dist/charts/scale/value.mjs +15 -8
  11. package/dist/charts/scene/types.d.mts +1 -1
  12. package/dist/core/document/display-entries.mjs +9 -2
  13. package/dist/core/document/display.d.mts +4 -0
  14. package/dist/core/document/display.mjs +8 -0
  15. package/dist/core/engine/version.d.mts +1 -1
  16. package/dist/core/engine/version.mjs +1 -1
  17. package/dist/core/error/codes.d.mts +2 -0
  18. package/dist/core/error/codes.mjs +2 -0
  19. package/dist/core/index.d.mts +2 -2
  20. package/dist/core/index.mjs +2 -2
  21. package/dist/core/model/member.d.mts +6 -0
  22. package/dist/core/model/member.mjs +11 -1
  23. package/dist/core/model/types.d.mts +6 -0
  24. package/dist/core/model/validate/known-members.mjs +1 -0
  25. package/dist/core/model/validate/members.mjs +12 -1
  26. package/dist/core/query/closure.mjs +3 -1
  27. package/dist/core/result/columns.mjs +15 -2
  28. package/dist/core/result/types.d.mts +2 -0
  29. package/dist/core/schema/answer-parts.mjs +1 -0
  30. package/dist/core/schema/answers.d.mts +14 -0
  31. package/dist/core/schema/answers.mjs +4 -2
  32. package/dist/core/types/api.d.mts +7 -1
  33. package/dist/core/types/api.mjs +1 -1
  34. package/dist/endpoints/index.d.mts +5 -4
  35. package/dist/endpoints/meta.mjs +30 -12
  36. package/dist/endpoints/query.mjs +11 -5
  37. package/dist/endpoints/values.mjs +37 -23
  38. package/dist/execute.mjs +22 -1
  39. package/dist/labels.mjs +68 -0
  40. package/dist/listing.mjs +13 -0
  41. package/dist/react/Canvas.mjs +28 -2
  42. package/dist/react/builder/base.mjs +11 -6
  43. package/dist/react/builder/display.mjs +15 -2
  44. package/dist/react/builder/state.mjs +3 -3
  45. package/dist/react/builder/words.mjs +8 -0
  46. package/dist/react/dates-shown.mjs +27 -9
  47. package/dist/react/filters/bar.d.mts +1 -1
  48. package/dist/react/filters/bar.mjs +17 -7
  49. package/dist/react/filters/chip.mjs +5 -3
  50. package/dist/react/filters/context.mjs +2 -2
  51. package/dist/react/filters/dates-said.mjs +29 -11
  52. package/dist/react/filters/hooks.d.mts +8 -0
  53. package/dist/react/filters/hooks.mjs +39 -2
  54. package/dist/react/filters/menu.mjs +8 -18
  55. package/dist/react/filters/phone.mjs +3 -3
  56. package/dist/react/filters/values.mjs +47 -28
  57. package/dist/react/filters/words.mjs +2 -2
  58. package/dist/react/format.d.mts +1 -1
  59. package/dist/react/format.mjs +8 -2
  60. package/dist/react/renderers/moved.mjs +160 -0
  61. package/dist/react/renderers/number-before.mjs +2 -157
  62. package/dist/react/renderers/table-cells.mjs +97 -11
  63. package/dist/react/renderers/table-head.mjs +7 -1
  64. package/dist/react/renderers/table-measure.mjs +147 -25
  65. package/dist/react/renderers/table-over.mjs +72 -0
  66. package/dist/react/renderers/table-scale.mjs +54 -1
  67. package/dist/react/renderers/table-trend.mjs +55 -0
  68. package/dist/react/renderers/table.d.mts +5 -1
  69. package/dist/react/renderers/table.mjs +29 -6
  70. package/dist/react/theme-unlayered.css +1 -1
  71. package/dist/react/theme.css +1 -1
  72. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # derive-dashboards
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d4605fe: A filter's value list says there is more whenever a row was left out, also where a value has two names. The query closure finds a dimension's name field through the one `shownAsMember` rule.
8
+
9
+ ## 0.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 380c1a9: Group and filter by an id, shown by its name. A string dimension may name another it is `shownAs`: rows group and filter by the id, so two rows that share a name never merge, and the name is shown wherever the value is.
14
+
15
+ - An answer's dimension column carries `labels`, each id's name, read in one query under the same viewer, policy and lock as the answer. `formatCell` and the built-in renderers show them.
16
+ - A filter control on a labelled field lists ids with their names, searches by name, and shows names in its chips; the picks stay ids. `/dashboards/control-values` takes `keys` (read these values back, with their labels) and answers `labels`; `/meta` marks the field `labelled`.
17
+ - A `shownAs` that names no plain string dimension of the source is refused (`SHOWN_AS_UNKNOWN`).
18
+ - `/query/records` takes `order`: page a source's rows by any of its dimensions (the key breaks ties), so a host lists a long page of rows by name or date with a cursor, never an offset.
19
+ - 49296cb: A table says more than its numbers, and a heatmap shows its best cell.
20
+
21
+ A table's widget may ask for four more things in its value columns (`display`):
22
+
23
+ - `trend`: a small chart of each row's time buckets before its number, columns for a count and a line for a rate. It needs a query over time that also asks for its whole (`time.grain` and `time.whole`); the table then has one row for each group over the whole range, and none for a bucket.
24
+ - `parts`: two values, one a part of the other (accepted, of shown), as one bar: as long as the whole beside the column's largest, with the part filled inside it. The two colours are keyed in the two columns' headers.
25
+ - `dots`: each value as a dot on a scale its column shares, with a tick where the total row stands. For a rate or an average: how each row compares with all of them.
26
+ - `change`: how each value moved against the comparison period, written after it ("↑ 0.9 pts"), in the colour of better or worse where the measure says which is which. It needs `time.compare`.
27
+
28
+ The builder offers `trend` and `change` only where the query has what they need, and a table over time that ticks its first small chart asks for its whole.
29
+
30
+ A heatmap outlines the one cell that holds its best value (the highest, or the lowest of a measure that is better lower) and keys it after its legend. A heatmap of few rows draws its cells as tiles, taller and set apart; one of many rows is as it was. For a chart of your own, `Words.best` names the key in your language.
31
+
32
+ Known gaps: a table's small chart is hidden from a screen reader, and a heatmap by two fields has no totals of its rows and columns.
33
+ - 3b1748d: The top of a dashboard says what a reader needs and no more.
34
+
35
+ - The date control names dates that are counted back from now, before the dates: "Previous 13 weeks", then "Aug 17 to Nov 15". It said the dates alone, so a reader could not tell whether they move with today. Dates need no name before them, so the control's own ("Period") is said to a screen reader only, and a small arrow after the dates says they open a calendar.
36
+ - The Filter button says "Filter". It read "+ Filter +5 F": how many filters wait in its menu, and the key that opens it, are now in its name for a screen reader and its title for a pointer.
37
+ - "Your view · Reset" is "Reset". Its title says whose the picks are ("Only you see these filters"); "From a link" is still written beside it while the picks are a link's.
38
+ - The choice that leaves every widget its own dates is called "Dashboard default" (it was "Each widget's own").
39
+
40
+ For a bar of your own: `FilterBarProps.period` is the dashboard's dates in words when they are counted back from now, beside `span`. `messages.filterBar.yourView` and `widgetDates` have new English.
41
+
42
+ ### Patch Changes
43
+
44
+ - ea23912: - A column that averages days too small for a float (0, 0 and −5e−324) stands on the side of zero its average is on.
45
+ - A value axis with room for only its fewest round numbers ends on its top tick: 28,001 to 34,001 reads 30K to 36K, not 30K to 34K with 34,001 above the last line.
46
+ - aa6b424: A grid's legend writes the key of its outlined cell ("Highest") only beside the row names, so a narrower grid never shows a key a wider one left out.
47
+ - bc03e8b: Names shown for an id follow the same rules as the name field itself.
48
+
49
+ - A query that reads a dimension `shownAs` another reads that one too: a viewer who may not read the names, or for whom they are sensitive, is refused, on `/query/run` and `/meta/values` alike.
50
+ - An id with two names keeps a name, and no other id loses its own.
51
+ - A filter lists a named field's values in the order of their names, each once.
52
+ - `shownAs` with its own `values` list is refused (`SHOWN_AS_VALUES`).
53
+ - The records body type takes `draft` again.
54
+
3
55
  ## 0.10.0
4
56
 
5
57
  ### Minor Changes
package/dist/body.mjs CHANGED
@@ -61,6 +61,8 @@ const bodies = {
61
61
  dashboardId: id,
62
62
  controlId: id,
63
63
  search: z.string().max(200).exactOptional(),
64
+ /** Only these values: what a chosen pick shows, with its labels. */
65
+ keys: z.array(z.string().max(500)).max(200).readonly().exactOptional(),
64
66
  limit: page.limit,
65
67
  draft: z.literal(true).exactOptional()
66
68
  }),
@@ -73,7 +75,9 @@ const bodies = {
73
75
  queryBatch: strict({ queries: z.array(wireQuerySchema).min(1).max(50) }),
74
76
  queryRecords: strict({
75
77
  query: wireQuerySchema,
76
- ...page
78
+ ...page,
79
+ /** The order to page in, by the source's dimensions; the source's key breaks every tie. */
80
+ order: z.array(z.tuple([z.string().min(1).max(200), z.enum(["asc", "desc"])]).readonly()).min(1).max(4).readonly().exactOptional()
77
81
  }),
78
82
  list: strict({}),
79
83
  newDashboard: strict({
@@ -30,6 +30,11 @@ export type Words = {
30
30
  * each bar: 90th percentile". English when left out.
31
31
  */
32
32
  against?: (what: string) => string;
33
+ /**
34
+ * Under a heatmap, names the one cell it outlines: the highest value, or the lowest of a
35
+ * measure that is better lower. English when left out.
36
+ */
37
+ best?: (which: "highest" | "lowest") => string;
33
38
  funnel: {
34
39
  /** Between two steps: the share of the step above that went on, written as a percent. */
35
40
  continues: (percent: string) => string;
@@ -9,6 +9,7 @@ const ENGLISH = {
9
9
  averaged: (count) => `drawn as an average of ${String(count)}`,
10
10
  merged: (count, grain, approximate) => "Each column is the average of " + (approximate ? "about " : "") + String(count) + " " + grain + (count === 1 ? "" : "s"),
11
11
  against: (what) => `The line on each bar: ${what}`,
12
+ best: (which) => which === "highest" ? "Highest" : "Lowest",
12
13
  funnel: {
13
14
  continues: (percent) => `${percent} continue`,
14
15
  largestDrop: "largest drop",
@@ -77,15 +77,18 @@ function valuedIn(series, slot) {
77
77
  */
78
78
  function meanIn(values, slot, of) {
79
79
  let mean = 0;
80
+ let sum = 0;
80
81
  let count = 0;
81
82
  for (let i = slot.from; i < slot.to; i++) {
82
83
  const value = values[i] ?? null;
83
84
  if (value === null) continue;
84
85
  count += 1;
86
+ sum += value;
85
87
  mean += value / count - mean / count;
86
88
  }
87
89
  if (count === 0) return null;
88
- return of === void 0 ? mean : mean * (count / of);
90
+ const kept = mean === 0 && Number.isFinite(sum) ? sum : mean;
91
+ return of === void 0 ? kept : kept * (count / of);
89
92
  }
90
93
  /**
91
94
  * The series as their columns are drawn: one value a column, the average of the column's
@@ -1,4 +1,5 @@
1
1
  import { keyOf, pairKey } from "../data/rows.mjs";
2
+ import { wordsOf } from "../data/words.mjs";
2
3
  import { shapesFor } from "../marks/budget.mjs";
3
4
  import { widest } from "../text/measure.mjs";
4
5
  import { LINE, MARK, SPACE, TEXT } from "../theme.mjs";
@@ -7,8 +8,39 @@ import { namesWidth, rowFrame, rowPlot } from "./row-chart.mjs";
7
8
  // src/kinds/grid-layout.ts
8
9
  /** The room the column names take over the cells: a line of them, and the grid's own gap under it. */
9
10
  const HEAD = LINE.tick + 6;
10
- /** A row is this tall at most. */
11
- const TALLEST = 30;
11
+ /**
12
+ * A row is this tall at most: the rows of a grid share a height, so a grid of few rows draws
13
+ * them as tiles and a grid of many keeps them close.
14
+ */
15
+ const TALLEST = {
16
+ few: 52,
17
+ many: 30,
18
+ shared: 208
19
+ };
20
+ /** The tallest a row may be in a grid of so many rows. */
21
+ const tallestFor = (rows) => Math.min(TALLEST.few, Math.max(TALLEST.many, TALLEST.shared / Math.max(1, rows)));
22
+ /**
23
+ * A cell as large as a tile is set apart from its neighbours by more than a hair, and rounded
24
+ * as a tile is: both sides of it are at least `least`.
25
+ */
26
+ const TILE = {
27
+ least: 36,
28
+ gap: 3,
29
+ radius: 5
30
+ };
31
+ /** How cells are parted and rounded: as tiles where both their sides have the room, else by a hair. */
32
+ const partingOf = (rowHeight, step) => Math.min(rowHeight, step) >= TILE.least ? {
33
+ gap: TILE.gap,
34
+ radius: TILE.radius
35
+ } : {
36
+ gap: MARK.hair,
37
+ radius: MARK.round
38
+ };
39
+ /** The outlined square that keys the best cell in the legend, and the room before it. */
40
+ const BEST_KEY = {
41
+ size: 9,
42
+ lead: 14
43
+ };
12
44
  /** The legend's ramp: how wide and how tall it is, and how many steps of shade it is made of. */
13
45
  const RAMP = {
14
46
  width: 96,
@@ -57,6 +89,22 @@ function endsWritten(ends, measure) {
57
89
  * the height it is given.
58
90
  */
59
91
  function legendFit(options, data, env, ends = colorsOf(data, options.range, options.diverging).ends) {
92
+ const fit = rampFit(options, data, env, ends);
93
+ if (fit === void 0) return void 0;
94
+ const { needs, beside, ...legend } = fit;
95
+ const which = bestOf(data, options.measure)?.which;
96
+ const word = which === void 0 ? void 0 : wordsOf(env).best(which);
97
+ const key = word === void 0 ? 0 : BEST_KEY.lead + BEST_KEY.size + SPACE.value + env.measure(word, TEXT.tick);
98
+ const edge = needs > beside;
99
+ const best = legend.named && !edge && needs + key <= beside ? word : void 0;
100
+ return {
101
+ ...legend,
102
+ best,
103
+ edge
104
+ };
105
+ }
106
+ /** The legend's numbers, ramp and name, and the width they need. */
107
+ function rampFit(options, data, env, ends) {
60
108
  const { label } = options.measure;
61
109
  const words = endsWritten(ends, options.measure);
62
110
  if (words === void 0) return void 0;
@@ -72,7 +120,31 @@ function legendFit(options, data, env, ends = colorsOf(data, options.range, opti
72
120
  ends,
73
121
  words,
74
122
  named,
75
- edge: (named ? numbers + wide(label) : numbers) > beside
123
+ needs: named ? numbers + wide(label) : numbers,
124
+ beside
125
+ };
126
+ }
127
+ /**
128
+ * The one cell that holds the best value, by the keys of its row and its column: the highest,
129
+ * or the lowest of a measure that is better lower. None when two cells share it (a grid whose
130
+ * every first month is 100% has no one best), and none for a grid of one cell.
131
+ */
132
+ function bestOf(data, measure) {
133
+ const which = measure.better === "down" ? "lowest" : "highest";
134
+ const sign = which === "lowest" ? -1 : 1;
135
+ const cells = data.rows.flatMap((row, r) => data.columns.flatMap((column, c) => {
136
+ const value = data.values[r]?.[c] ?? null;
137
+ return value === null ? [] : [{
138
+ key: pairKey(keyOf(row), keyOf(column)),
139
+ value
140
+ }];
141
+ }));
142
+ const top = cells.reduce((most, cell) => Math.max(most, sign * cell.value), Number.NEGATIVE_INFINITY);
143
+ const best = cells.filter((cell) => sign * cell.value === top);
144
+ const [only] = best;
145
+ return cells.length < 2 || best.length !== 1 || only === void 0 ? void 0 : {
146
+ key: only.key,
147
+ which
76
148
  };
77
149
  }
78
150
  /**
@@ -84,7 +156,7 @@ const rowRule = (options, data, env, legend = legendFit(options, data, env)) =>
84
156
  header: options,
85
157
  above: HEAD + (options.columnTitle === void 0 ? 0 : LINE.tick),
86
158
  below: legend === void 0 ? 0 : LEGEND,
87
- most: TALLEST,
159
+ most: tallestFor(data.rows.length),
88
160
  cap: capOf(data, env)
89
161
  });
90
162
  /**
@@ -104,15 +176,19 @@ function layoutOf(data, options, env, ends) {
104
176
  from: x,
105
177
  to: x + width
106
178
  };
179
+ const step = width / Math.max(1, data.columns.length);
107
180
  const placed = {
108
181
  frame,
109
182
  sizes,
110
- step: width / Math.max(1, data.columns.length),
183
+ step,
184
+ ...partingOf(frame.rowHeight, step),
111
185
  plot: rowPlot(frame, across, frame.shown)
112
186
  };
113
187
  const filled = cellsOf(data, placed);
188
+ const best = bestOf(data, options.measure)?.key;
114
189
  return {
115
190
  ...placed,
191
+ best: best === void 0 ? void 0 : filled.find((cell) => cell.key === best),
116
192
  kept: data.rows.slice(0, frame.shown),
117
193
  across,
118
194
  filled,
@@ -126,8 +202,8 @@ function layoutOf(data, options, env, ends) {
126
202
  const boxAt = (at, layout) => ({
127
203
  x: layout.plot.x + at.column * layout.step,
128
204
  y: layout.plot.y + at.row * layout.frame.rowHeight,
129
- width: Math.max(MARK.least, layout.step - MARK.hair),
130
- height: Math.max(MARK.least, layout.frame.rowHeight - MARK.hair)
205
+ width: Math.max(MARK.least, layout.step - layout.gap),
206
+ height: Math.max(MARK.least, layout.frame.rowHeight - layout.gap)
131
207
  });
132
208
  /** Every place of the rows drawn, with the value the data has there, if any. */
133
209
  const placesOf = (data, shown) => data.rows.slice(0, shown).flatMap((named, row) => data.columns.map((across, column) => ({
@@ -149,4 +225,4 @@ const emptyOf = (data, layout) => placesOf(data, layout.frame.shown).flatMap(({
149
225
  ...place,
150
226
  box: boxAt(place, layout)
151
227
  }] : []);
152
- export { RAMP, layoutOf, rowRule };
228
+ export { BEST_KEY, RAMP, layoutOf, rowRule };
@@ -1,8 +1,8 @@
1
- import { RULE } from "../scene/paint.mjs";
1
+ import { INK, RULE } from "../scene/paint.mjs";
2
2
  import { pathRound } from "../scene/markup.mjs";
3
3
  import { LINE, MARK, SPACE, TEXT } from "../theme.mjs";
4
- import { RAMP } from "./grid-layout.mjs";
5
- import { fillOf } from "./grid-marks.mjs";
4
+ import { BEST_KEY, RAMP } from "./grid-layout.mjs";
5
+ import { OUTLINE, fillOf, roundedPath } from "./grid-marks.mjs";
6
6
  // src/kinds/grid-legend.ts
7
7
  /**
8
8
  * The legend under the rows, the top of its room at `y`; nothing when there is none, or when the
@@ -49,12 +49,35 @@ function legendNodes(at, y) {
49
49
  stroke: RULE,
50
50
  strokeWidth: MARK.hair
51
51
  };
52
+ const named = after(most, end);
52
53
  return [
53
54
  text(least, start),
54
55
  ...steps,
55
56
  frame,
56
57
  text(most, end),
57
- ...legend.named ? [text(measure.label, after(most, end))] : []
58
+ ...legend.named ? [text(measure.label, named)] : [],
59
+ ...legend.best === void 0 || layout.best === void 0 ? [] : bestKey(legend.best, {
60
+ x: after(measure.label, named) - SPACE.value,
61
+ middle,
62
+ text
63
+ })
58
64
  ];
59
65
  }
66
+ /** The key of the outlined cell, after the legend's name: a small outlined square, then its word. */
67
+ function bestKey(word, at) {
68
+ const x = at.x + BEST_KEY.lead;
69
+ const box = {
70
+ x,
71
+ y: at.middle - BEST_KEY.size / 2,
72
+ width: BEST_KEY.size,
73
+ height: BEST_KEY.size
74
+ };
75
+ return [{
76
+ kind: "path",
77
+ part: "legend",
78
+ d: roundedPath(box, MARK.round),
79
+ stroke: INK,
80
+ strokeWidth: OUTLINE
81
+ }, at.text(word, x + BEST_KEY.size + SPACE.value)];
82
+ }
60
83
  export { legendNodes };
@@ -1,5 +1,6 @@
1
1
  import { keyOf } from "../data/rows.mjs";
2
- import { MUTED, SURFACE } from "../scene/paint.mjs";
2
+ import { INK, MUTED, SURFACE } from "../scene/paint.mjs";
3
+ import { pathRound } from "../scene/markup.mjs";
3
4
  import { fitOrNone, fitted, wholeOf } from "../text/measure.mjs";
4
5
  import { LINE, MARK, SPACE, TEXT } from "../theme.mjs";
5
6
  import { rowName } from "./row-marks.mjs";
@@ -135,7 +136,7 @@ const emptyNodes = (layout) => layout.empty.map(({ key, box }) => ({
135
136
  y: box.y + MARK.hair / 2,
136
137
  width: Math.max(0, box.width - MARK.hair),
137
138
  height: Math.max(0, box.height - MARK.hair),
138
- radius: MARK.round,
139
+ radius: layout.radius,
139
140
  fill: SURFACE,
140
141
  stroke: MUTED,
141
142
  strokeWidth: MARK.hair
@@ -173,7 +174,7 @@ function cellNodes(cell, at) {
173
174
  part: "cell",
174
175
  key: cell.key,
175
176
  ...box,
176
- radius: MARK.round,
177
+ radius: at.layout.radius,
177
178
  ...fillOf(cell, at)
178
179
  }, ...write === void 0 ? [] : [{
179
180
  kind: "text",
@@ -186,4 +187,55 @@ function cellNodes(cell, at) {
186
187
  baseline: "middle"
187
188
  }]];
188
189
  }
189
- export { cellNodes, colorOf, emptyNodes, fillOf, heads, sides, strengthOf };
190
+ /** How thick the best cell's outline is. */
191
+ const OUTLINE = 1.5;
192
+ /** How far short of a corner a curve's handles stop, as a share of the radius: a quarter of a circle, near enough. */
193
+ const HANDLE = .4477;
194
+ /**
195
+ * A box with rounded corners as a path of lines and curves: an outline has no fill, which a
196
+ * rectangle must have. Every point it names is inside the box.
197
+ */
198
+ function roundedPath(box, radius) {
199
+ const r = Math.max(0, Math.min(radius, box.width / 2, box.height / 2));
200
+ const k = r * HANDLE;
201
+ const [left, top, right, bottom] = [
202
+ box.x,
203
+ box.y,
204
+ box.x + box.width,
205
+ box.y + box.height
206
+ ];
207
+ const at = (x, y) => `${pathRound(x)},${pathRound(y)}`;
208
+ return [
209
+ `M${at(left + r, top)}L${at(right - r, top)}`,
210
+ `C${at(right - k, top)} ${at(right, top + k)} ${at(right, top + r)}L${at(right, bottom - r)}`,
211
+ `C${at(right, bottom - k)} ${at(right - k, bottom)} ${at(right - r, bottom)}L${at(left + r, bottom)}`,
212
+ `C${at(left + k, bottom)} ${at(left, bottom - k)} ${at(left, bottom - r)}L${at(left, top + r)}`,
213
+ `C${at(left, top + k)} ${at(left + k, top)} ${at(left + r, top)}Z`
214
+ ].join("");
215
+ }
216
+ /**
217
+ * The outline of the one cell that holds the best value (`bestOf`), in ink, just inside the
218
+ * cell's own edge so it never runs past the picture: the cell a reader looks for is found
219
+ * without reading every number. It is no mark of the cell's own, so it has no key: a pointer
220
+ * finds the cell, not its outline. Nothing when no one cell is best, or it is not among the
221
+ * rows drawn.
222
+ */
223
+ function bestNodes(at) {
224
+ const { best, radius } = at.layout;
225
+ if (best === void 0) return [];
226
+ const { box } = best;
227
+ const inset = OUTLINE / 2;
228
+ return [{
229
+ kind: "path",
230
+ part: "best",
231
+ d: roundedPath({
232
+ x: box.x + inset,
233
+ y: box.y + inset,
234
+ width: Math.max(0, box.width - OUTLINE),
235
+ height: Math.max(0, box.height - OUTLINE)
236
+ }, radius - inset),
237
+ stroke: INK,
238
+ strokeWidth: OUTLINE
239
+ }];
240
+ }
241
+ export { OUTLINE, bestNodes, cellNodes, colorOf, emptyNodes, fillOf, heads, roundedPath, sides, strengthOf };
@@ -6,7 +6,7 @@ import { rowsMore } from "./row-marks.mjs";
6
6
  import { cleaned, colorsOf } from "./grid-data.mjs";
7
7
  import { layoutOf, rowRule } from "./grid-layout.mjs";
8
8
  import { legendNodes } from "./grid-legend.mjs";
9
- import { cellNodes, emptyNodes, heads, sides } from "./grid-marks.mjs";
9
+ import { bestNodes, cellNodes, emptyNodes, heads, sides } from "./grid-marks.mjs";
10
10
  import { fitTimeGrid } from "./grid-time.mjs";
11
11
  import { describeGrid, matrixOf, stopsOf } from "./grid-words.mjs";
12
12
  import { hasRoom, sizingOf, wantsOf } from "./row-chart.mjs";
@@ -77,6 +77,7 @@ function gridChart(given, options, env) {
77
77
  ...sides(options, at),
78
78
  ...emptyNodes(layout),
79
79
  ...layout.filled.flatMap((cell) => cellNodes(cell, at)),
80
+ ...bestNodes(at),
80
81
  ...rowsMore(left, {
81
82
  frame,
82
83
  env
@@ -101,19 +101,26 @@ function ownEnds(low, high, count) {
101
101
  for (let ask = 1; ask <= count + SPARE; ask++) {
102
102
  const ticks = stepped(low, high, ask);
103
103
  if (ticks.length < 2) continue;
104
- first ??= {
105
- min: low,
106
- max: high,
107
- ticks
108
- };
109
- const fit = [ticks, everyOther(ticks)].map((some) => toppedOff(some, high)).find((some) => {
104
+ const topped = [ticks, everyOther(ticks)].map((some) => toppedOff(some, high));
105
+ const keeps = (some) => {
110
106
  const top = some.at(-1) ?? high;
111
107
  const zeroBack = !holdsZero(low, high) && holdsZero(low, top);
112
- return some.length >= 2 && some.length <= count + 1 && !zeroBack && !stretched({
108
+ return some.length >= 2 && !zeroBack && !stretched({
113
109
  min: low,
114
110
  max: top
115
111
  }, low, high);
116
- });
112
+ };
113
+ const top = topped[0] ?? ticks;
114
+ first ??= keeps(top) ? {
115
+ min: low,
116
+ max: Math.max(high, top.at(-1) ?? high),
117
+ ticks: top
118
+ } : {
119
+ min: low,
120
+ max: high,
121
+ ticks
122
+ };
123
+ const fit = topped.find((some) => keeps(some) && some.length <= count + 1);
117
124
  if (fit !== void 0) return {
118
125
  min: low,
119
126
  max: Math.max(high, fit.at(-1) ?? high),
@@ -24,7 +24,7 @@ export type Box = {
24
24
  * the two move as one when labels are spread apart): it is an `end-label`, not a `name` and a
25
25
  * `value`.
26
26
  */
27
- export type Part = "header" | "legend" | "more" | "grid" | "tick" | "zero" | "axis-name" | "column" | "reference" | "event" | "guide" | "series" | "line" | "wash" | "before" | "dot" | "end" | "from" | "to" | "link" | "leader" | "bar" | "lost" | "against" | "join" | "band" | "edge" | "settled" | "open" | "cell" | "name" | "value" | "size" | "change" | "share" | "rate" | "leak" | "end-label";
27
+ export type Part = "header" | "legend" | "more" | "grid" | "tick" | "zero" | "axis-name" | "column" | "reference" | "event" | "guide" | "series" | "line" | "wash" | "before" | "dot" | "end" | "from" | "to" | "link" | "leader" | "bar" | "lost" | "against" | "join" | "band" | "edge" | "settled" | "open" | "cell" | "best" | "name" | "value" | "size" | "change" | "share" | "rate" | "leak" | "end-label";
28
28
  type Shared = {
29
29
  /** What the mark is of, as the data names it: a row's, a series' or a cell's key. Every mark of one thing carries it (a row's name and its bar), and so does its hover stop. */
30
30
  key?: string;
@@ -3,7 +3,14 @@ import { entryAliases, entryNamed } from "../query/to-wire.mjs";
3
3
  /** The options of each kind that name values of the widget's query. */
4
4
  const NAMES_VALUES = {
5
5
  number: ["value", "secondary"],
6
- table: ["bars", "heat"],
6
+ table: [
7
+ "bars",
8
+ "heat",
9
+ "dots",
10
+ "parts",
11
+ "trend",
12
+ "change"
13
+ ],
7
14
  bar: ["against"]
8
15
  };
9
16
  /** The options of a kind that name values; none for a host's own kind. */
@@ -41,7 +48,7 @@ function valuesOf(widget) {
41
48
  }
42
49
  /**
43
50
  * What a widget's display names that its query does not have: each option that names a value
44
- * (a number's `value` and `secondary`, a table's `bars` and `heat`) with a name that is no
51
+ * (a number's `value` and `secondary`, a table's `bars`, `heat`, `dots`, `parts`, `trend` and `change`) with a name that is no
45
52
  * measure or calc of the widget's main query, at the option's path. None for a kind with no
46
53
  * such option, a widget with no main query, or a display that is not an object.
47
54
  */
@@ -24,6 +24,10 @@ export declare const DISPLAY_OPTIONS: {
24
24
  readonly table: {
25
25
  readonly bars: "texts";
26
26
  readonly heat: "texts";
27
+ readonly dots: "texts";
28
+ readonly parts: "texts";
29
+ readonly trend: "texts";
30
+ readonly change: "texts";
27
31
  readonly compact: "boolean";
28
32
  readonly comparisons: "comparisons";
29
33
  readonly full: "boolean";
@@ -25,6 +25,10 @@ const DISPLAY_OPTIONS = {
25
25
  ...SHARED,
26
26
  bars: "texts",
27
27
  heat: "texts",
28
+ dots: "texts",
29
+ parts: "texts",
30
+ trend: "texts",
31
+ change: "texts",
28
32
  compact: "boolean",
29
33
  comparisons: "comparisons",
30
34
  full: "boolean"
@@ -62,6 +66,10 @@ const DISPLAY_HELP = {
62
66
  full: "Write amounts in full: a number tile's large value, and a table's column of amounts that are all a thousand or more, are otherwise rounded to whole units.",
63
67
  bars: "Query entries drawn with a bar in each cell, as long as the value is beside the column's largest.",
64
68
  heat: "Query entries whose cells are shaded by their value, darker for more.",
69
+ dots: "Query entries drawn as a dot on a scale their column shares, with a tick where the total row stands: how each row compares with all of them. For a rate or an average, which is no length.",
70
+ parts: "Two query entries, one a part of the other (accepted, of shown): the whole's column draws a bar as long as its value beside the column's largest, with the part filled inside it.",
71
+ change: "Query entries whose change from the comparison period is written after their value: which way, and how far (points for a rate, a percent of where it was for an amount). The query needs time.compare, and over time buckets time.whole too.",
72
+ trend: "Query entries drawn with a small chart of their time buckets beside each row's value. The query needs a time grain and time.whole: the table then has one row for each group over the whole range, not one for each bucket.",
65
73
  comparisons: "For a value of the first grouping column, name the drill field for its comparison table and optionally the field to expand each group by.",
66
74
  compact: "Draw a table's rows closer together.",
67
75
  colors: "A colour per series, by the series' label: any CSS colour.",
@@ -5,4 +5,4 @@
5
5
  * older code, or in an older shape, is never read. `test/engine-version.test.ts` checks it
6
6
  * against the files and prints the new value when they change.
7
7
  */
8
- export declare const ENGINE_VERSION = "19f3d940fdf90e87";
8
+ export declare const ENGINE_VERSION = "0184cbc78d9b6863";
@@ -6,5 +6,5 @@
6
6
  * older code, or in an older shape, is never read. `test/engine-version.test.ts` checks it
7
7
  * against the files and prints the new value when they change.
8
8
  */
9
- const ENGINE_VERSION = "19f3d940fdf90e87";
9
+ const ENGINE_VERSION = "0184cbc78d9b6863";
10
10
  export { ENGINE_VERSION };
@@ -56,6 +56,8 @@ export declare const MODEL_ISSUES: {
56
56
  readonly REF_JOIN_TO_MANY: "A dimension reference goes through a join to many rows.";
57
57
  readonly REF_JOIN_UNKNOWN: "A dimension reference names a join that does not exist.";
58
58
  readonly SHARED_DIMENSIONS_RESERVED: "The model declares shared dimensions, which are reserved.";
59
+ readonly SHOWN_AS_UNKNOWN: "A dimension's shownAs names no string dimension of its source, or one shown as another itself.";
60
+ readonly SHOWN_AS_VALUES: "A dimension shown as another also declares its own list of values.";
59
61
  readonly SOURCES_EMPTY: "The model has no source.";
60
62
  readonly TABLE_EMPTY: "A source's table name is empty.";
61
63
  readonly TABLE_AND_SQL: "A source gives both a table and sql; it reads one of them.";
@@ -59,6 +59,8 @@ const MODEL_ISSUES = {
59
59
  REF_JOIN_TO_MANY: "A dimension reference goes through a join to many rows.",
60
60
  REF_JOIN_UNKNOWN: "A dimension reference names a join that does not exist.",
61
61
  SHARED_DIMENSIONS_RESERVED: "The model declares shared dimensions, which are reserved.",
62
+ SHOWN_AS_UNKNOWN: "A dimension's shownAs names no string dimension of its source, or one shown as another itself.",
63
+ SHOWN_AS_VALUES: "A dimension shown as another also declares its own list of values.",
62
64
  SOURCES_EMPTY: "The model has no source.",
63
65
  TABLE_EMPTY: "A source's table name is empty.",
64
66
  TABLE_AND_SQL: "A source gives both a table and sql; it reads one of them.",
@@ -6,7 +6,7 @@ import { describeQueries } from "./model/catalog/queries.mjs";
6
6
  import { missingTenantKey, policyBinding, tenantValues } from "./model/defaults.mjs";
7
7
  import { DimensionId, JoinedDimensionId, MeasureId, MemberId, ModelError, OwnDimensionId, SourceNameOf, defineModel } from "./model/define.mjs";
8
8
  import { DimensionHints, Noun, NumberFormat, RecordsHint, Tone } from "./model/hints.mjs";
9
- import { MemberRef, ResolvedDimension, parseMemberId, recordDimensions, resolveDimension, sourceOf } from "./model/member.mjs";
9
+ import { MemberRef, ResolvedDimension, parseMemberId, recordDimensions, resolveDimension, shownAsMember, sourceOf } from "./model/member.mjs";
10
10
  import { ColumnRole, Mark, Receipt, RecordColumn, Result, ResultCell, ResultColumn, ResultRows, TimeAxis, TimeBucket } from "./result/types.mjs";
11
11
  import { cellDigits, decimalPlaces, formatExact, movePoint, parseExact } from "./exact/text.mjs";
12
12
  import { Exact } from "./exact/decimal.mjs";
@@ -75,4 +75,4 @@ import { CanFn, Channel, Principal, Resource, TenantKeysOf, Verb, Viewer, Viewer
75
75
  import { canonical } from "./value/canonical.mjs";
76
76
  import { fold } from "./value/casefold.mjs";
77
77
  import { Reading, StoredValue, Unread } from "./value/stored.mjs";
78
- export { type AccessParts, type Alias, type AnswerDrill, type ApiError, type AssertionContext, type Author, type Awaitable, BASE_ERROR_CODES, type Better, type BoundFilter, type BoundPolicy, type BoundPolicyFilter, type BoundRule, type ByQuery, CATALOG, CONTRACT_VERSION, type CalcAlias, type CalcEntry, type Calendar, type CanFn, type Catalog, type CatalogIssueCode, type Cell, type Change, type Channel, type ClosedRow, type Closure, type CodeDashboard, type Column, type ColumnRole, type ColumnType, type Command, type CommandBody, type CommandId, type ComparisonFields, type ComposeCtx, type ComposeDelta, type ComposedQuery, type ComposedTile, type CompositionPolicy, type ConnectionId, type Control, type ControlId, type CoreApi, type CoreContract, type CustomSource, type Cuts, DISPLAY_OPTIONS, DRILL_REASONS, type Dash, type DashAdapter, type DashEndpoint, type DashHook, type DashOptions, type DashPlugin, type DashboardHead, type DashboardListResponse, type DashboardReader, type DashboardResponse, type DashboardStore, type DashboardSummary, type DatePart, type DateRange, type DbSchema, type DimensionAlias, type DimensionCut, type DimensionDef, type DimensionHints, type DimensionId, type DimensionName, type Display, type DisplayKind, type DisplayOf, type DisplayOptionName, type Doc, type DocumentRefusalCode, type DocumentSlice, type Draft, type DraftResponse, type DraftTarget, type Drill, type DrillAbilities, type DrillAnswer, type DrillBody, type DrillCan, type DrillComparisonView, type DrillCrumb, type DrillExplanationView, type DrillField, type DrillGroupedView, type DrillItem, type DrillItemsView, type DrillOperand, type DrillOrigin, type DrillReason, type DrillSemantics, type DrillState, type DrillStep, type DrillSummary, type DrillView, type EncodeOptions, type EndpointAccess, type EndpointContext, type EndpointsByPath, type EntryId, type Exact, type ExactSum, type Explanation, type ExplicitRange, type Expr, type ExprCondition, type ExprFunction, type Field, type FieldType, type Format, type Formula, type FormulaNode, type FormulaRef, GRID_COLUMNS, type Gap, type Grain, type GroupedRead, type HeadersLike, type HookContext, type HostCell, type HostRows, type IanaZone, type IntrospectingConnection, type IsoInstant, type Issue, type IssueCode, type ItemColumn, type ItemLinks, type ItemLinksFor, type JoinDef, type JoinName, type JoinedDimensionId, LIBRARY_WIDGET_KINDS, type LayoutItem, type Leaf, type LibraryWidgetKind, type LinearTerm, type LockEntry, MAX_DRILL_ROWS, MAX_DRILL_STEPS, MICROS_PER_DAY, MINUS, MIN_SECRET_BYTES, type Mark, type MeasureAlias, type MeasureDef, type MeasureId, type MeasureName, type MemberId, type MemberMeta, type MemberRef, type MetaJoin, type MetaMember, type MetaResponse, type Micros, type Model, ModelError, type ModelIssueCode, type Moment, type NaiveRule, type NegativeOp, type NodeId, type Noun, type NullOp, type NumberFormat, type NumberShape, type NumberWriter, type Numeric, type Offer, type Op, type Operands, type OptionType, type Outcome, type OverlapPart, type OwnDimensionId, type PageRequest, type Param, type Picks, type PinnedExecution, type Placement, type PluginEndpoints, type PluginErrorCodes, type PolicyBinding, type PolicyFilter, type PolicyName, type PolicyRule, type PositiveOp, type Preview, type Primitive, type Principal, type PublishResponse, type Published, type QueryAnswer, type QueryConnection, type QueryCtx, type QueryLine, QueryReferenceError, type QueryRefusalCode, type RawError, type RawLevels, type RawResult, type ReadContext, type ReadField, type ReadFilter, type ReadMeasure, type ReadSession, type Reading, type Receipt, type RecordColumn, type RecordPage, type Recorded, type RecordsHint, type RecordsRead, type RecordsResponse, type RefOf, type Refusal, type Relationship, type RelativeRange, type Replayed, type RequiredEntry, type ResolvedDimension, type ResolvedRange, type Resource, type Result, type ResultCell, type ResultColumn, type ResultRows, type ResultWarningCode, type Row, type RowPolicy, type RunOptions, type RuntimeErrorCode, SHARED_OPTIONS, START_REFUSALS, type SchemaDriver, type Scope, type ScopeCoverage, type SealedAnswer, type SecondaryStorage, type Selection, type SemanticProvider, type ServerCall, type ServerCallInput, type ServerCalls, type SharedDisplay, type SourceDef, type SourceName, type SourceNameOf, type Span, type Sql, StartError, type StartIssue, type StartRefusalCode, type StoreDialect, type StoredFilter, type StoredFormulaNode, type StoredLockEntry, type StoredQuery, type StoredValue, type StoredVersion, TABLES, TITLE_MOST, type Tab, type TabId, type TableCheck, type TableDef, type TableName, type Tenant, type TenantBinding, type TenantKey, type TenantKeysOf, type TileAnswer, type TileInput, type TileLine, type TileRef, type TileRequest, type TileResult, type TilesRequest, type TimeAxis, type TimeBucket, type TimeStorage, type Token, type Tone, type TypedFilter, type TypedQuery, type UniqueIds, type Unit, type UnpublishedDraft, type Unread, VIEW_PREFIX, type ValidateResponse, type ValueLeaf, type ValuesResponse, type VariableLeaf, type Verb, type VersionEntry, type ViewState, type Viewer, type ViewerFor, type ViewerLeaf, type ViewerMatch, type ViewerRef, type WeekStart, type Where, type Widget, type WidgetId, type WidgetPart, type WireFilter, type WireQuery, addsUp, answerStatus, bindPolicy, bindQueryViewer, bindViewer, bucketLabel, bucketWithin, canonical, cellDigits, changeOf, changedWidget, checkCatalog, closeGaps, closeGapsCommands, commandWidget, comparisonsByQuery, composeTile, controlFieldIssues, controlFieldOffers, createDashEndpoint, createTable, currencyOf, dashboardKeyIssues, dateMillis, decimalPlaces, defineDashboard, defineErrorCodes, defineModel, describeQueries, didYouMean, diffDocs, displayOf, displayOptionsOf, documentDisplayIssues, documentLock, durationUnits, editedDisplayIssues, effectiveFilter, emptyDoc, encodeView, entriesNamed, entryAliases, entryNamed, fold, formatExact, formatTextTime, formulaRefs, freeSpot, isBound, isDateOnly, isDateRange, isMark, isRunning, isStarting, isValuePick, itemLink, lastIncludedMillisecond, layoutGaps, layoutWidgetIssues, linkTemplateIssues, lockChanged, markShifted, markedRows, markedWhole, memberLabel, missingTenantKey, movePoint, namedPolicy, namesValues, numberWriters, parseExact, parseMemberId, parseTextTime, pickProblem, placeItem, placementOf, policyBinding, principalTenant, queryClosure, readingOrder, recordColumns, recordDimensions, reduce, reduceAll, refuseStart, refusedDisplayOptions, replay, requestInstant, resolveDimension, resultColumns, roleOf, rowValue, schemaChecks, shareOf, sharedDisplay, signOf, smallestFor, sourceOf, stepCommands, sumLinear, tenantValues, textMillis, tileInputs, toWire, unreadWarnings, validateModel, viaJoins, viewFor, viewLayout, wallClock, wholeAnswer, widgetDiff, widgetKindIssues, withTime, withView };
78
+ export { type AccessParts, type Alias, type AnswerDrill, type ApiError, type AssertionContext, type Author, type Awaitable, BASE_ERROR_CODES, type Better, type BoundFilter, type BoundPolicy, type BoundPolicyFilter, type BoundRule, type ByQuery, CATALOG, CONTRACT_VERSION, type CalcAlias, type CalcEntry, type Calendar, type CanFn, type Catalog, type CatalogIssueCode, type Cell, type Change, type Channel, type ClosedRow, type Closure, type CodeDashboard, type Column, type ColumnRole, type ColumnType, type Command, type CommandBody, type CommandId, type ComparisonFields, type ComposeCtx, type ComposeDelta, type ComposedQuery, type ComposedTile, type CompositionPolicy, type ConnectionId, type Control, type ControlId, type CoreApi, type CoreContract, type CustomSource, type Cuts, DISPLAY_OPTIONS, DRILL_REASONS, type Dash, type DashAdapter, type DashEndpoint, type DashHook, type DashOptions, type DashPlugin, type DashboardHead, type DashboardListResponse, type DashboardReader, type DashboardResponse, type DashboardStore, type DashboardSummary, type DatePart, type DateRange, type DbSchema, type DimensionAlias, type DimensionCut, type DimensionDef, type DimensionHints, type DimensionId, type DimensionName, type Display, type DisplayKind, type DisplayOf, type DisplayOptionName, type Doc, type DocumentRefusalCode, type DocumentSlice, type Draft, type DraftResponse, type DraftTarget, type Drill, type DrillAbilities, type DrillAnswer, type DrillBody, type DrillCan, type DrillComparisonView, type DrillCrumb, type DrillExplanationView, type DrillField, type DrillGroupedView, type DrillItem, type DrillItemsView, type DrillOperand, type DrillOrigin, type DrillReason, type DrillSemantics, type DrillState, type DrillStep, type DrillSummary, type DrillView, type EncodeOptions, type EndpointAccess, type EndpointContext, type EndpointsByPath, type EntryId, type Exact, type ExactSum, type Explanation, type ExplicitRange, type Expr, type ExprCondition, type ExprFunction, type Field, type FieldType, type Format, type Formula, type FormulaNode, type FormulaRef, GRID_COLUMNS, type Gap, type Grain, type GroupedRead, type HeadersLike, type HookContext, type HostCell, type HostRows, type IanaZone, type IntrospectingConnection, type IsoInstant, type Issue, type IssueCode, type ItemColumn, type ItemLinks, type ItemLinksFor, type JoinDef, type JoinName, type JoinedDimensionId, LIBRARY_WIDGET_KINDS, type LayoutItem, type Leaf, type LibraryWidgetKind, type LinearTerm, type LockEntry, MAX_DRILL_ROWS, MAX_DRILL_STEPS, MICROS_PER_DAY, MINUS, MIN_SECRET_BYTES, type Mark, type MeasureAlias, type MeasureDef, type MeasureId, type MeasureName, type MemberId, type MemberMeta, type MemberRef, type MetaJoin, type MetaMember, type MetaResponse, type Micros, type Model, ModelError, type ModelIssueCode, type Moment, type NaiveRule, type NegativeOp, type NodeId, type Noun, type NullOp, type NumberFormat, type NumberShape, type NumberWriter, type Numeric, type Offer, type Op, type Operands, type OptionType, type Outcome, type OverlapPart, type OwnDimensionId, type PageRequest, type Param, type Picks, type PinnedExecution, type Placement, type PluginEndpoints, type PluginErrorCodes, type PolicyBinding, type PolicyFilter, type PolicyName, type PolicyRule, type PositiveOp, type Preview, type Primitive, type Principal, type PublishResponse, type Published, type QueryAnswer, type QueryConnection, type QueryCtx, type QueryLine, QueryReferenceError, type QueryRefusalCode, type RawError, type RawLevels, type RawResult, type ReadContext, type ReadField, type ReadFilter, type ReadMeasure, type ReadSession, type Reading, type Receipt, type RecordColumn, type RecordPage, type Recorded, type RecordsHint, type RecordsRead, type RecordsResponse, type RefOf, type Refusal, type Relationship, type RelativeRange, type Replayed, type RequiredEntry, type ResolvedDimension, type ResolvedRange, type Resource, type Result, type ResultCell, type ResultColumn, type ResultRows, type ResultWarningCode, type Row, type RowPolicy, type RunOptions, type RuntimeErrorCode, SHARED_OPTIONS, START_REFUSALS, type SchemaDriver, type Scope, type ScopeCoverage, type SealedAnswer, type SecondaryStorage, type Selection, type SemanticProvider, type ServerCall, type ServerCallInput, type ServerCalls, type SharedDisplay, type SourceDef, type SourceName, type SourceNameOf, type Span, type Sql, StartError, type StartIssue, type StartRefusalCode, type StoreDialect, type StoredFilter, type StoredFormulaNode, type StoredLockEntry, type StoredQuery, type StoredValue, type StoredVersion, TABLES, TITLE_MOST, type Tab, type TabId, type TableCheck, type TableDef, type TableName, type Tenant, type TenantBinding, type TenantKey, type TenantKeysOf, type TileAnswer, type TileInput, type TileLine, type TileRef, type TileRequest, type TileResult, type TilesRequest, type TimeAxis, type TimeBucket, type TimeStorage, type Token, type Tone, type TypedFilter, type TypedQuery, type UniqueIds, type Unit, type UnpublishedDraft, type Unread, VIEW_PREFIX, type ValidateResponse, type ValueLeaf, type ValuesResponse, type VariableLeaf, type Verb, type VersionEntry, type ViewState, type Viewer, type ViewerFor, type ViewerLeaf, type ViewerMatch, type ViewerRef, type WeekStart, type Where, type Widget, type WidgetId, type WidgetPart, type WireFilter, type WireQuery, addsUp, answerStatus, bindPolicy, bindQueryViewer, bindViewer, bucketLabel, bucketWithin, canonical, cellDigits, changeOf, changedWidget, checkCatalog, closeGaps, closeGapsCommands, commandWidget, comparisonsByQuery, composeTile, controlFieldIssues, controlFieldOffers, createDashEndpoint, createTable, currencyOf, dashboardKeyIssues, dateMillis, decimalPlaces, defineDashboard, defineErrorCodes, defineModel, describeQueries, didYouMean, diffDocs, displayOf, displayOptionsOf, documentDisplayIssues, documentLock, durationUnits, editedDisplayIssues, effectiveFilter, emptyDoc, encodeView, entriesNamed, entryAliases, entryNamed, fold, formatExact, formatTextTime, formulaRefs, freeSpot, isBound, isDateOnly, isDateRange, isMark, isRunning, isStarting, isValuePick, itemLink, lastIncludedMillisecond, layoutGaps, layoutWidgetIssues, linkTemplateIssues, lockChanged, markShifted, markedRows, markedWhole, memberLabel, missingTenantKey, movePoint, namedPolicy, namesValues, numberWriters, parseExact, parseMemberId, parseTextTime, pickProblem, placeItem, placementOf, policyBinding, principalTenant, queryClosure, readingOrder, recordColumns, recordDimensions, reduce, reduceAll, refuseStart, refusedDisplayOptions, replay, requestInstant, resolveDimension, resultColumns, roleOf, rowValue, schemaChecks, shareOf, sharedDisplay, shownAsMember, signOf, smallestFor, sourceOf, stepCommands, sumLinear, tenantValues, textMillis, tileInputs, toWire, unreadWarnings, validateModel, viaJoins, viewFor, viewLayout, wallClock, wholeAnswer, widgetDiff, widgetKindIssues, withTime, withView };
@@ -18,7 +18,7 @@ import { emptyDoc } from "./document/types.mjs";
18
18
  import { ModelError, defineModel } from "./model/define.mjs";
19
19
  import { VIEW_PREFIX, encodeView, viewFor, withView } from "./document/view.mjs";
20
20
  import { smallestFor, viewLayout } from "./document/view-layout.mjs";
21
- import { parseMemberId, recordDimensions, resolveDimension, sourceOf } from "./model/member.mjs";
21
+ import { parseMemberId, recordDimensions, resolveDimension, shownAsMember, sourceOf } from "./model/member.mjs";
22
22
  import { rowValue, sumLinear } from "./exact/sum.mjs";
23
23
  import { cellDigits, decimalPlaces, formatExact, movePoint, parseExact } from "./exact/text.mjs";
24
24
  import { MINUS, currencyOf } from "./format/write.mjs";
@@ -55,4 +55,4 @@ import { createDashEndpoint } from "./types/plugin.mjs";
55
55
  import { principalTenant } from "./types/viewer.mjs";
56
56
  import { canonical } from "./value/canonical.mjs";
57
57
  import { fold } from "./value/casefold.mjs";
58
- export { BASE_ERROR_CODES, CATALOG, CONTRACT_VERSION, DISPLAY_OPTIONS, DRILL_REASONS, GRID_COLUMNS, LIBRARY_WIDGET_KINDS, MAX_DRILL_ROWS, MAX_DRILL_STEPS, MICROS_PER_DAY, MINUS, MIN_SECRET_BYTES, ModelError, QueryReferenceError, SHARED_OPTIONS, START_REFUSALS, StartError, TABLES, TITLE_MOST, VIEW_PREFIX, addsUp, answerStatus, bindPolicy, bindQueryViewer, bindViewer, bucketLabel, bucketWithin, canonical, cellDigits, changeOf, changedWidget, checkCatalog, closeGaps, closeGapsCommands, commandWidget, comparisonsByQuery, composeTile, controlFieldIssues, controlFieldOffers, createDashEndpoint, createTable, currencyOf, dashboardKeyIssues, dateMillis, decimalPlaces, defineDashboard, defineErrorCodes, defineModel, describeQueries, didYouMean, diffDocs, displayOf, displayOptionsOf, documentDisplayIssues, documentLock, durationUnits, editedDisplayIssues, effectiveFilter, emptyDoc, encodeView, entriesNamed, entryAliases, entryNamed, fold, formatExact, formatTextTime, formulaRefs, freeSpot, isBound, isDateOnly, isDateRange, isMark, isRunning, isStarting, isValuePick, itemLink, lastIncludedMillisecond, layoutGaps, layoutWidgetIssues, linkTemplateIssues, lockChanged, markShifted, markedRows, markedWhole, memberLabel, missingTenantKey, movePoint, namedPolicy, namesValues, numberWriters, parseExact, parseMemberId, parseTextTime, pickProblem, placeItem, placementOf, policyBinding, principalTenant, queryClosure, readingOrder, recordColumns, recordDimensions, reduce, reduceAll, refuseStart, refusedDisplayOptions, replay, requestInstant, resolveDimension, resultColumns, roleOf, rowValue, schemaChecks, shareOf, sharedDisplay, signOf, smallestFor, sourceOf, stepCommands, sumLinear, tenantValues, textMillis, tileInputs, toWire, unreadWarnings, validateModel, viaJoins, viewFor, viewLayout, wallClock, wholeAnswer, widgetDiff, widgetKindIssues, withTime, withView };
58
+ export { BASE_ERROR_CODES, CATALOG, CONTRACT_VERSION, DISPLAY_OPTIONS, DRILL_REASONS, GRID_COLUMNS, LIBRARY_WIDGET_KINDS, MAX_DRILL_ROWS, MAX_DRILL_STEPS, MICROS_PER_DAY, MINUS, MIN_SECRET_BYTES, ModelError, QueryReferenceError, SHARED_OPTIONS, START_REFUSALS, StartError, TABLES, TITLE_MOST, VIEW_PREFIX, addsUp, answerStatus, bindPolicy, bindQueryViewer, bindViewer, bucketLabel, bucketWithin, canonical, cellDigits, changeOf, changedWidget, checkCatalog, closeGaps, closeGapsCommands, commandWidget, comparisonsByQuery, composeTile, controlFieldIssues, controlFieldOffers, createDashEndpoint, createTable, currencyOf, dashboardKeyIssues, dateMillis, decimalPlaces, defineDashboard, defineErrorCodes, defineModel, describeQueries, didYouMean, diffDocs, displayOf, displayOptionsOf, documentDisplayIssues, documentLock, durationUnits, editedDisplayIssues, effectiveFilter, emptyDoc, encodeView, entriesNamed, entryAliases, entryNamed, fold, formatExact, formatTextTime, formulaRefs, freeSpot, isBound, isDateOnly, isDateRange, isMark, isRunning, isStarting, isValuePick, itemLink, lastIncludedMillisecond, layoutGaps, layoutWidgetIssues, linkTemplateIssues, lockChanged, markShifted, markedRows, markedWhole, memberLabel, missingTenantKey, movePoint, namedPolicy, namesValues, numberWriters, parseExact, parseMemberId, parseTextTime, pickProblem, placeItem, placementOf, policyBinding, principalTenant, queryClosure, readingOrder, recordColumns, recordDimensions, reduce, reduceAll, refuseStart, refusedDisplayOptions, replay, requestInstant, resolveDimension, resultColumns, roleOf, rowValue, schemaChecks, shareOf, sharedDisplay, shownAsMember, signOf, smallestFor, sourceOf, stepCommands, sumLinear, tenantValues, textMillis, tileInputs, toWire, unreadWarnings, validateModel, viaJoins, viewFor, viewLayout, wallClock, wholeAnswer, widgetDiff, widgetKindIssues, withTime, withView };