@fusion.dev/helix-headless 0.218.0 → 0.220.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.
Files changed (84) hide show
  1. package/api.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +13 -2
  4. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +19 -9
  5. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +16 -1
  6. package/dist/breadcrumbs/root/breadcrumbs-root.js +6 -0
  7. package/dist/button/root/button-root.d.ts +33 -0
  8. package/dist/button/root/button-root.js +13 -3
  9. package/dist/canvas/root/canvas-root.d.ts +11 -0
  10. package/dist/canvas/root/canvas-root.js +1 -0
  11. package/dist/chat/composer/chat-composer.d.ts +221 -6
  12. package/dist/chat/composer/chat-composer.js +249 -19
  13. package/dist/chat/message/chat-message.d.ts +7 -0
  14. package/dist/chat/message/chat-message.js +2 -1
  15. package/dist/chat/root/chat-root.d.ts +1 -0
  16. package/dist/chat/root/chat-root.js +1 -1
  17. package/dist/code-editor/root/code-editor-root.d.ts +48 -51
  18. package/dist/code-editor/root/code-editor-root.js +67 -249
  19. package/dist/copy-button/root/copy-button-root.js +3 -3
  20. package/dist/device-screen/root/device-screen-root.d.ts +11 -0
  21. package/dist/device-screen/root/device-screen-root.js +22 -10
  22. package/dist/dialog/root/dialog-root.js +6 -1
  23. package/dist/drilldown/item/drilldown-item.js +1 -1
  24. package/dist/element-events.generated.js +4 -1
  25. package/dist/filter-input/root/filter-input-root.d.ts +4 -3
  26. package/dist/filter-input/root/filter-input-root.js +1 -20
  27. package/dist/find/index.d.ts +1 -0
  28. package/dist/find/index.js +1 -0
  29. package/dist/find/root/find-root.d.ts +314 -0
  30. package/dist/find/root/find-root.js +577 -0
  31. package/dist/graph/root/graph-root.d.ts +11 -0
  32. package/dist/graph/root/graph-root.js +4 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/input/root/input-root.d.ts +6 -0
  36. package/dist/input/root/input-root.js +7 -0
  37. package/dist/lightbox/root/lightbox-root.d.ts +4 -1
  38. package/dist/lightbox/root/lightbox-root.js +10 -8
  39. package/dist/listbox/root/listbox-root.d.ts +21 -0
  40. package/dist/listbox/root/listbox-root.js +37 -2
  41. package/dist/log/group/log-group.d.ts +18 -3
  42. package/dist/log/group/log-group.js +31 -4
  43. package/dist/log/root/log-root.d.ts +13 -3
  44. package/dist/log/root/log-root.js +5 -2
  45. package/dist/map/root/map-root.d.ts +11 -0
  46. package/dist/map/root/map-root.js +28 -12
  47. package/dist/menu/root/menu-root.d.ts +8 -0
  48. package/dist/menu/root/menu-root.js +22 -1
  49. package/dist/menu/section/menu-section.d.ts +10 -0
  50. package/dist/menu/section/menu-section.js +10 -0
  51. package/dist/meter/index.d.ts +1 -0
  52. package/dist/meter/index.js +1 -0
  53. package/dist/meter/root/meter-root.d.ts +16 -1
  54. package/dist/meter/root/meter-root.js +27 -11
  55. package/dist/meter/segment/meter-segment.d.ts +74 -0
  56. package/dist/meter/segment/meter-segment.js +47 -0
  57. package/dist/scroll-area/root/scroll-area-root.d.ts +20 -3
  58. package/dist/scroll-area/root/scroll-area-root.js +23 -4
  59. package/dist/spatial-bar-chart/bars.d.ts +125 -5
  60. package/dist/spatial-bar-chart/bars.js +194 -17
  61. package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +148 -6
  62. package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +285 -16
  63. package/dist/splitter/root/splitter-root.js +1 -0
  64. package/dist/tabs/root/tabs-root.d.ts +4 -0
  65. package/dist/tabs/tab/tab.d.ts +1 -0
  66. package/dist/tabs/tab/tab.js +2 -2
  67. package/dist/tag/root/tag-root.d.ts +1 -1
  68. package/dist/terminal/root/terminal-root.d.ts +60 -32
  69. package/dist/terminal/root/terminal-root.js +82 -178
  70. package/dist/toolbar/root/toolbar-root.d.ts +4 -1
  71. package/dist/tooltip/root/tooltip-root.d.ts +23 -1
  72. package/dist/tooltip/root/tooltip-root.js +28 -5
  73. package/dist/tour/root/tour-root.d.ts +1 -0
  74. package/dist/tour/root/tour-root.js +4 -1
  75. package/dist/tour/stop/tour-stop.js +1 -0
  76. package/dist/tree/item/tree-item.d.ts +11 -0
  77. package/dist/tree/item/tree-item.js +19 -1
  78. package/examples.json +1 -1
  79. package/lint.json +1 -1
  80. package/package.json +5 -5
  81. package/types/jsx.d.ts +2222 -118
  82. package/types/svelte.d.ts +2 -0
  83. package/types/vue.d.ts +468 -19
  84. package/types/words.d.ts +96 -1
@@ -1,4 +1,4 @@
1
- import { solid, ticks } from '@fusion.dev/helix-core';
1
+ import { depthOrder, pathData, solid, ticks, } from '@fusion.dev/helix-core';
2
2
  import { niceRange } from '../spatial-scatter-chart/field.js';
3
3
  import { inBox } from '../spatial-scatter-chart/view.js';
4
4
  const HEIGHT = 0.6;
@@ -12,50 +12,125 @@ const named = (count, labels, nearest = false) => {
12
12
  ticks: labels.map((_, at) => at),
13
13
  };
14
14
  };
15
- export const barsOf = (rows, columns) => {
15
+ export const barsOf = (rows, columns, stacked = false, toneOf = () => undefined) => {
16
16
  const series = columns.map((column) => rows.find((row) => row.cells[column])?.cells[column]?.name ?? '');
17
17
  const cells = [];
18
18
  const values = [];
19
+ const reached = [];
19
20
  rows.forEach((row, at) => {
21
+ let [above, below] = [0, 0];
20
22
  columns.forEach((column, depth) => {
21
23
  const value = row.cells[column]?.value;
22
24
  const read = Number.isFinite(value) ? value : undefined;
25
+ let from = stacked ? above : 0;
23
26
  if (read !== undefined) {
24
27
  values.push(read);
28
+ if (stacked) {
29
+ from = read < 0 ? below : above;
30
+ if (read < 0) {
31
+ below += read;
32
+ }
33
+ else {
34
+ above += read;
35
+ }
36
+ }
37
+ reached.push(from + read);
25
38
  }
26
- cells.push({ across: at, column, depth, label: row.label, row: at, value: read });
39
+ const lane = stacked ? 0 : depth;
40
+ const tone = toneOf(at, depth);
41
+ cells.push({
42
+ across: at,
43
+ column,
44
+ depth,
45
+ from,
46
+ label: row.label,
47
+ lane,
48
+ row: at,
49
+ ...(tone ? { tone } : {}),
50
+ value: read,
51
+ });
27
52
  });
28
53
  });
29
- const [low, high] = [Math.min(0, ...values), Math.max(0, ...values)];
54
+ const lanes = stacked ? 1 : series.length;
55
+ const [low, high] = [Math.min(0, ...reached), Math.max(0, ...reached)];
30
56
  const range = low === high ? [0, 1] : niceRange(low, high);
31
- const longest = Math.max(rows.length, series.length, 1);
57
+ const longest = Math.max(rows.length, lanes, 1);
32
58
  return {
33
59
  axes: {
34
- extent: [Math.max(rows.length, 1) / longest, HEIGHT, Math.max(series.length, 1) / longest],
60
+ extent: [Math.max(rows.length, 1) / longest, HEIGHT, Math.max(lanes, 1) / longest],
35
61
  x: named(rows.length, rows.map((row) => row.label)),
36
62
  y: { name: series.length === 1 ? (series[0] ?? '') : '', range, ticks: ticks(range) },
37
- z: named(series.length, series.length === 1 ? [] : series, true),
63
+ z: named(lanes, lanes === 1 ? [] : series, true),
38
64
  },
39
65
  categories: rows.map((row) => row.label),
40
66
  cells,
67
+ lanes,
41
68
  readings: values.length,
42
69
  series,
70
+ stacked,
43
71
  };
44
72
  };
45
73
  const FOOTPRINT = 0.6;
46
- export const barsDrawn = (field, projection) => {
74
+ const CLIMB = 15 / 72;
75
+ const placesOf = (field, projection, layout) => {
76
+ const [ex, , ez] = field.axes.extent;
77
+ const [cos, sin] = projection.across;
78
+ const lined = layout !== 'grid';
79
+ const spread = lined ? Math.abs(cos) + Math.abs(sin) : 1;
80
+ const spacing = Math.min((2 * ex) / Math.max(field.categories.length, 1), (2 * ez) / Math.max(field.lanes, 1)) /
81
+ spread;
82
+ const origin = projection.at(0, 0, 0);
83
+ const rise = origin.y - projection.at(-sin, cos, 0).y;
84
+ const across = projection.at(cos, sin, 0).x - origin.x;
85
+ const climb = layout === 'diagonal' && rise > 0 ? ((field.climb ?? CLIMB) * across) / rise : 0;
86
+ return {
87
+ place: (cell) => {
88
+ const along = inBox(field.axes.x, cell.across) * ex;
89
+ const back = -inBox(field.axes.z, cell.lane) * ez + along * climb;
90
+ return lined
91
+ ? { x: along * cos - back * sin, y: along * sin + back * cos }
92
+ : { x: along, y: back };
93
+ },
94
+ spacing,
95
+ };
96
+ };
97
+ export const rowFits = (width, size) => size > 0 ? Math.max(1, Math.floor((width * FOOTPRINT) / size)) : 1;
98
+ export const widthOf = (bar) => {
99
+ const xs = bar.corners.map((corner) => corner.x);
100
+ return Math.max(...xs) - Math.min(...xs);
101
+ };
102
+ export const climbing = (field, rise, length) => ({
103
+ ...field,
104
+ climb: length > 0 ? Math.min(CLIMB, rise / length) : CLIMB,
105
+ });
106
+ const ROW_TALL = 1.25;
107
+ export const tallestTimes = (field, projection, bars) => {
108
+ const first = bars[0];
109
+ const fall = Math.abs(projection.at(0, 0, 1).y - projection.at(0, 0, 0).y);
110
+ const tallest = Math.max(0, ...bars.map((bar) => bar.height)) * fall;
111
+ if (!first || tallest <= 0) {
112
+ return Number.POSITIVE_INFINITY;
113
+ }
114
+ const length = (field.categories.length * widthOf(first)) / FOOTPRINT;
115
+ return (ROW_TALL * length) / tallest;
116
+ };
117
+ export const heightened = (field, times) => {
47
118
  const [ex, ey, ez] = field.axes.extent;
48
- const spacing = Math.min((2 * ex) / Math.max(field.categories.length, 1), (2 * ez) / Math.max(field.series.length, 1));
49
- const zero = inBox(field.axes.y, 0) * ey;
119
+ return { ...field, axes: { ...field.axes, extent: [ex, ey * times, ez] } };
120
+ };
121
+ export const barsDrawn = (field, projection, layout = 'grid', grown = () => 1) => {
122
+ const ey = field.axes.extent[1];
123
+ const { place, spacing } = placesOf(field, projection, layout);
50
124
  return field.cells.flatMap((cell, index) => {
51
- if (cell.value === undefined) {
125
+ if (cell.value === undefined || (field.stacked && cell.value === 0)) {
52
126
  return [];
53
127
  }
54
- const x = inBox(field.axes.x, cell.across) * ex;
55
- const y = -inBox(field.axes.z, cell.depth) * ez;
56
- const top = inBox(field.axes.y, cell.value) * ey;
57
- const base = Math.min(zero, top);
58
- const height = Math.abs(top - zero);
128
+ const { x, y } = place(cell);
129
+ const share = grown(cell);
130
+ const start = inBox(field.axes.y, cell.from * share) * ey;
131
+ const top = inBox(field.axes.y, (cell.from + cell.value) * share) * ey;
132
+ const base = Math.min(start, top);
133
+ const height = Math.abs(top - start);
59
134
  const lifted = {
60
135
  ...projection,
61
136
  at: (px, py, pz = 0) => projection.at(px, py, pz + base),
@@ -67,6 +142,108 @@ export const barsDrawn = (field, projection) => {
67
142
  corners.push(lifted.at(cx, cy, 0), lifted.at(cx, cy, height));
68
143
  }
69
144
  }
70
- return [{ corners, drawn: solid(lifted, 'block', x, y, width, height), height, index, x, y }];
145
+ return [
146
+ { base, corners, drawn: solid(lifted, 'block', x, y, width, height), height, index, x, y },
147
+ ];
148
+ });
149
+ };
150
+ export const paintOrder = (projection, bars) => {
151
+ const columns = new Map();
152
+ for (const bar of depthOrder(projection, bars)) {
153
+ const place = `${bar.x},${bar.y}`;
154
+ columns.set(place, [...(columns.get(place) ?? []), bar]);
155
+ }
156
+ return [...columns.values()].flatMap((column) => column.sort((one, two) => one.base - two.base));
157
+ };
158
+ const PLATE = 0.85;
159
+ export const floorOf = (field, projection, layout = 'row') => {
160
+ const { place, spacing } = placesOf(field, projection, layout);
161
+ const floor = inBox(field.axes.y, 0) * field.axes.extent[1];
162
+ const half = (spacing * PLATE) / 2;
163
+ const seen = new Set();
164
+ return field.cells.flatMap((cell) => {
165
+ const key = `${cell.across} ${cell.lane}`;
166
+ if (seen.has(key)) {
167
+ return [];
168
+ }
169
+ seen.add(key);
170
+ const { x, y } = place(cell);
171
+ const corners = [
172
+ projection.at(x - half, y - half, floor),
173
+ projection.at(x + half, y - half, floor),
174
+ projection.at(x + half, y + half, floor),
175
+ projection.at(x - half, y + half, floor),
176
+ ];
177
+ const front = corners.reduce((low, one) => (one.y > low.y ? one : low));
178
+ return [{ across: cell.across, corners, d: pathData(corners), front }];
179
+ });
180
+ };
181
+ const NAME_WIDE = 0.58;
182
+ export const namesOf = (field, plates, size) => {
183
+ const fronts = new Map();
184
+ for (const plate of plates) {
185
+ const kept = fronts.get(plate.across);
186
+ if (!kept || plate.front.y > kept.y) {
187
+ fronts.set(plate.across, plate.front);
188
+ }
189
+ }
190
+ const tones = new Map();
191
+ for (const cell of field.cells) {
192
+ if (cell.tone && cell.value !== undefined && !tones.has(cell.across)) {
193
+ tones.set(cell.across, cell.tone);
194
+ }
195
+ }
196
+ const all = field.categories.flatMap((text, across) => {
197
+ const front = fronts.get(across);
198
+ return front
199
+ ? [{ across, text, tone: tones.get(across), x: front.x, y: front.y + size * 1.1 }]
200
+ : [];
71
201
  });
202
+ const room = (name) => {
203
+ const half = (name.text.length * size * NAME_WIDE) / 2 + size * 0.4;
204
+ return [name.x - half, name.x + half];
205
+ };
206
+ const clear = (one, kept) => {
207
+ const [from, to] = room(one);
208
+ return kept.every((other) => {
209
+ const [left, right] = room(other);
210
+ return to <= left || from >= right;
211
+ });
212
+ };
213
+ const toned = all.filter((name) => name.tone);
214
+ const rest = all.filter((name) => !name.tone);
215
+ for (let step = 1; step <= Math.max(1, all.length); step++) {
216
+ const kept = toned.filter((name, at) => clear(name, toned.slice(0, at)));
217
+ let fits = true;
218
+ for (const name of rest) {
219
+ if (name.across % step !== 0) {
220
+ continue;
221
+ }
222
+ if (clear(name, kept)) {
223
+ kept.push(name);
224
+ }
225
+ else if (!clear(name, kept.filter((one) => one.tone))) {
226
+ }
227
+ else {
228
+ fits = false;
229
+ break;
230
+ }
231
+ }
232
+ if (fits) {
233
+ return kept.sort((one, other) => one.across - other.across);
234
+ }
235
+ }
236
+ return [];
237
+ };
238
+ const GROW = 1000;
239
+ const STAGGER = 110;
240
+ const SPREAD = 660;
241
+ const stepOf = (categories) => categories > 1 ? Math.min(STAGGER, SPREAD / (categories - 1)) : 0;
242
+ export const grownAt = (across, categories, elapsed) => {
243
+ const t = (elapsed - across * stepOf(categories)) / GROW;
244
+ if (t <= 0) {
245
+ return 0;
246
+ }
247
+ return t >= 1 ? 1 : 1 - (1 - t) ** 3;
72
248
  };
249
+ export const growTime = (categories) => GROW + stepOf(categories) * Math.max(0, categories - 1);
@@ -13,6 +13,11 @@ declare const HelixHeadlessSpatialBarChart_base: typeof HelixElement & (new (...
13
13
  * depth, each as tall as its value from zero and colored by its series, so
14
14
  * one series is a single row of bars and several make a block of them.
15
15
  *
16
+ * **A cell's `data-tone` colors its own bar and writes its value above it**,
17
+ * such as `data-tone="primary"` on the one reading a chart is about, as on
18
+ * `Bar Chart`. The value is the cell's own text. Without a tone, a bar takes
19
+ * its series' color.
20
+ *
16
21
  * **The flat `Bar Chart` is read more exactly.** Measured, a reader judges
17
22
  * a 3D bar's value less closely than a flat one's, and a bar can stand
18
23
  * behind another. Use this one where the shape across two sets of names
@@ -79,6 +84,8 @@ declare const HelixHeadlessSpatialBarChart_base: typeof HelixElement & (new (...
79
84
  * @csspart empty - The words when the table has no readings: the `empty` slot, falling back to `empty-text`.
80
85
  * @csspart face - One face of a bar the view shows, shaded by which way it faces.
81
86
  * @csspart fallback - The box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.
87
+ * @csspart floor - One place on the floor of a `row`, under a bar or where one would stand, drawn as its outline.
88
+ * @csspart glow - The outline of a bar whose cell names a tone, blurred by 8 CSS pixels and painted under the bar, with no fill until a stylesheet gives it one: a soft glow in the bar's tone.
82
89
  * @csspart grid - The box's edges and its grid, in the chart's own drawing.
83
90
  * @csspart live - The readout: a polite live region that says the bar the keys moved to. Hide it visually.
84
91
  * @csspart loading - The words while `loading` is set and there are no readings.
@@ -90,7 +97,7 @@ declare const HelixHeadlessSpatialBarChart_base: typeof HelixElement & (new (...
90
97
  * @csspart summary - The number of bars, series, and categories, and the range of values, written as a sentence for screen readers, which describes the plot. Hide it visually.
91
98
  * @csspart table - The readings as a table, for a screen reader, rendered only where they were drawn from `data`, a page of them at a time past a few hundred. Hide it visually.
92
99
  * @csspart table-pages - Which readings a page of the `table` holds, and the buttons that show the previous and the next page, rendered only while it holds a page. Hide it visually.
93
- * @csspart tick - A category's or a series' name, or a value at a tick, along its edge of the box, in the chart's own drawing.
100
+ * @csspart tick - A category's or a series' name, or a value at a tick, along its edge of the box, or a category's name under its place in a `row`, in the chart's own drawing.
94
101
  * @csspart tooltip-anchor - The `Tooltip` element itself.
95
102
  * @csspart tooltip-arrow - The bubble's point, forwarded from `Tooltip`.
96
103
  * @csspart tooltip-arrow-bottom - The point while the bubble is below the reading, on its top edge. Set alongside `tooltip-arrow`.
@@ -107,8 +114,16 @@ declare const HelixHeadlessSpatialBarChart_base: typeof HelixElement & (new (...
107
114
  * @csspart tooltip-surface-right - The bubble while it is right of the reading. Set alongside `tooltip-surface`.
108
115
  * @csspart tooltip-surface-top - The bubble while it is above the reading. Set alongside `tooltip-surface`.
109
116
  * @csspart tooltip-value - A column's value inside the tooltip.
117
+ * @csspart value - The value of a bar whose cell names a tone, written above it in the chart's own drawing.
110
118
  *
111
- * @cssproperty --spatial-bar-chart-shade - How far a bar's face turns from the light, from 0 for its top. The component writes it on each face, and the stylesheet that shades the face reads it.
119
+ * @cssproperty --spatial-bar-chart-shade -How far a bar's face turns from the light, from 0 for its top. The component writes it on each face, and the stylesheet that shades the face reads it.
120
+ * @cssproperty --spatial-bar-chart-tone-accent - The color of a bar whose cell says `data-tone="accent"`.
121
+ * @cssproperty --spatial-bar-chart-tone-danger - The color of a bar whose cell says `data-tone="danger"`.
122
+ * @cssproperty --spatial-bar-chart-tone-info - The color of a bar whose cell says `data-tone="info"`.
123
+ * @cssproperty --spatial-bar-chart-tone-muted - The color of a bar whose cell says `data-tone="muted"`.
124
+ * @cssproperty --spatial-bar-chart-tone-primary - The color of a bar whose cell says `data-tone="primary"`. A tone with no property of its own falls back to the bar's series color, and the same holds for a name you define.
125
+ * @cssproperty --spatial-bar-chart-tone-success - The color of a bar whose cell says `data-tone="success"`.
126
+ * @cssproperty --spatial-bar-chart-tone-warning - The color of a bar whose cell says `data-tone="warning"`.
112
127
  *
113
128
  * @cssstate active - While a bar is shown, under the pointer or the keys.
114
129
  * @cssstate drawn - While a renderer has drawn the bars, and the chart's own drawing is hidden.
@@ -122,8 +137,32 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
122
137
  */
123
138
  static words: string;
124
139
  /**
125
- * Draws no box: no edges, grid, numbers, or names, so the readings stand
126
- * alone and fill the plot, as a picture on a product's own page does. The
140
+ * Grows the bars up from the floor the first time the chart comes into
141
+ * view with readings, each category a little after the one before it, so
142
+ * the drawing arrives the way a page's own picture does. The growth is
143
+ * fast at first, slows to rest, and never passes a bar's value.
144
+ *
145
+ * Under `prefers-reduced-motion`, or where the page has paused its motion
146
+ * through `pauseMotion` or `Motion Toggle`, the bars stand at their height
147
+ * from the start. A later table draws the bars it already had at their
148
+ * height, and grows the bars it adds, each from the floor, so a reading that
149
+ * arrives while the chart is in view arrives the same way.
150
+ */
151
+ grow: boolean;
152
+ /**
153
+ * Grows the bars again each time the chart comes back into view after it
154
+ * left it, as a pane does when it is opened again, where `grow` alone grows
155
+ * them the first time only. Only a chart that grows takes it.
156
+ *
157
+ * While it is out of view the bars stand at the floor, so the first frame
158
+ * after it returns is the start of the growth and never a flash at full
159
+ * height.
160
+ */
161
+ growAgain: boolean;
162
+ /**
163
+ * Draws no box: no edges, grid, numbers, or names, and in a `row` no
164
+ * floor, so the readings stand alone and fill the plot, as a picture on a
165
+ * product's own page does. The
127
166
  * table, the summary, the tooltip, and the keys still carry every value,
128
167
  * and a renderer draws no box either.
129
168
  */
@@ -135,12 +174,57 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
135
174
  openLabel: string;
136
175
  /** The plot's name where the chart has none: no `aria-label`, `label`, or table caption. */
137
176
  plotLabel: string;
177
+ /**
178
+ * Stacks a category's series into one column, each block standing on the
179
+ * ones before it, so the column is as tall as the category's total, as a
180
+ * flat `Bar Chart` stacks them.
181
+ *
182
+ * Absent stands the series one behind another in depth. Stacked, every
183
+ * series stands in the front row, so none hides another, and the parts of
184
+ * one total read together. A negative reading hangs below zero on the
185
+ * negatives before it. The scale fits the stacks.
186
+ */
187
+ stacked: boolean;
138
188
  /**
139
189
  * The `summary` part's sentence. `{count}`, `{series}`, and `{categories}`
140
190
  * are the number of bars, series, and categories, written in the locale,
141
191
  * and `{low}` and `{high}` the lowest and the highest value.
142
192
  */
143
193
  summaryLabel: string;
194
+ /**
195
+ * How the bars stand.
196
+ *
197
+ * Unset, they stand on a grid of categories across and series in depth,
198
+ * in a box the camera looks at from a corner, so the grid recedes at an
199
+ * angle. `row` lays the categories in a straight line across the page and
200
+ * turns each bar to the camera, showing its top and two sides, for one row
201
+ * of readings in a small space such as a pane: turning the view turns each
202
+ * bar where it stands, and the row stays level. It is the chart's own
203
+ * drawing that lays the row: a renderer connected through
204
+ * `@fusion.dev/helix-plot` stands the bars on the grid.
205
+ *
206
+ * `diagonal` is the same row climbing to the right as it recedes, each
207
+ * place a step further back than the one before, as a row of days on a
208
+ * product's page is drawn: the row rises one part in five across the page
209
+ * from any turn, and its floor and names climb with it. A row whose bars
210
+ * have a size climbs at most a quarter of the plot's height, so the bars
211
+ * of a long row keep theirs.
212
+ *
213
+ * **A row draws its floor in place of a box**: each place as an outline a
214
+ * little wider than its bar, and each category's name under it, as many
215
+ * names as fit without touching. A name whose bar names a tone is written
216
+ * first, in that tone. `no-box` leaves the floor and the names out.
217
+ *
218
+ * **A `column-gap` on the `fallback` part gives a row's bars one width**,
219
+ * which the styled tier sets from `--spatial-bar-chart-bar-size`: one bar
220
+ * stands as wide as each of twenty, the row is as long as its bars and
221
+ * centered, the tallest bar stands as high as the plot has room for and
222
+ * no taller than the row is long and a quarter again, so one bar stands
223
+ * as a block, and `fits` says how many bars the plot holds, so a page
224
+ * can give it the latest of a longer table. It is read when the plot's
225
+ * size changes.
226
+ */
227
+ variant?: 'diagonal' | 'row';
144
228
  /** Whether a renderer has drawn the bars, which hides the chart's own drawing. */
145
229
  private rendered;
146
230
  /** Where the chart's own drawing is seen from, which a drag or Shift with an arrow turns. */
@@ -153,6 +237,34 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
153
237
  private last;
154
238
  /** The bar the keys rested on last, so a change of it can be told. */
155
239
  private told;
240
+ /**
241
+ * The size of the box the chart's own drawing fills, its font size, and
242
+ * the bar size the stylesheet asks for, in CSS pixels, once measured: the
243
+ * names and values are written at that size whatever the drawing's scale.
244
+ */
245
+ private room;
246
+ /** Measures the box the chart's own drawing fills. */
247
+ private sizes;
248
+ /**
249
+ * How far the bars have grown in: waiting to be seen, growing since a
250
+ * moment, or `undefined` once they stand at their height. `grew` says the
251
+ * first table has been drawn, so a later one is not grown again.
252
+ */
253
+ private growth;
254
+ private grew;
255
+ /**
256
+ * The bars a later table added, by category label, each growing from the
257
+ * floor: when it started, and its place among the bars that came with it, so
258
+ * several arriving together follow one another as the first table's do. A
259
+ * bar leaves the map once it stands.
260
+ */
261
+ private readonly fresh;
262
+ /** The categories of the table drawn last, so a later table's new ones are known. */
263
+ private drawnLabels;
264
+ /** Watches for the chart to leave the view, after which `grow-again` has it grow in once more. */
265
+ private gone;
266
+ /** Watches for the chart to come into view, which starts the bars growing. */
267
+ private seen;
156
268
  /** Carries a host `aria-labelledby` and `aria-describedby` to the plot. */
157
269
  protected readonly aria: AriaForwardController;
158
270
  /**
@@ -160,7 +272,7 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
160
272
  * column a series.** A renderer reads it.
161
273
  */
162
274
  get field(): BarField;
163
- /** The field last read, and the rows and columns it was read from. */
275
+ /** The field last read, and the rows, columns, and series it was read from. */
164
276
  private memo;
165
277
  /** The bar the keys or the pointer rest on, as its place in `field.cells`, or `-1`. */
166
278
  get active(): number;
@@ -194,6 +306,36 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
194
306
  * the server calls this one.
195
307
  */
196
308
  protected willUpdate(changed: PropertyValues<this>): void;
309
+ /** Draws each frame until the bars a later table added stand. */
310
+ private followFresh;
311
+ disconnectedCallback(): void;
312
+ /** The element the size observer watches, so a drawing drawn again is watched again. */
313
+ private measured;
314
+ /** Watches the box the chart's own drawing fills, and keeps its size and font size. */
315
+ private measure;
316
+ /**
317
+ * How many categories a `row` or a `diagonal` has room for across the
318
+ * plot at its bar size, measured as it is read, or
319
+ * `undefined` where there is no row, no bar size, or nothing drawn to
320
+ * measure. A page with a longer table gives the chart its latest that
321
+ * many rows, and says so.
322
+ */
323
+ get fits(): number | undefined;
324
+ /**
325
+ * A row with a bar size of its own: how many of the drawing's units make a
326
+ * pixel, so each bar is as wide as asked, and the field with its value axis
327
+ * as tall as fills the plot's height with the names and the value. Where
328
+ * the row is too long for the plot, its bars narrow until it fits.
329
+ */
330
+ private sized;
331
+ /** Starts the bars growing once the chart comes into view, and draws each frame until they stand. */
332
+ private watchGrowth;
333
+ /**
334
+ * Under `grow-again`, waits for the chart to leave the view, then puts the
335
+ * bars back at the floor and waits to be seen, so growing again starts from
336
+ * the same place the first time did.
337
+ */
338
+ private watchExit;
197
339
  connectedCallback(): void;
198
340
  protected updated(changed: PropertyValues): void;
199
341
  /**
@@ -222,7 +364,7 @@ export declare class HelixHeadlessSpatialBarChart extends HelixHeadlessSpatialBa
222
364
  * drawing, until a renderer has drawn and where none is connected.
223
365
  */
224
366
  private renderFallback;
225
- /** One bar, its faces in its series' color, each shaded by which way it faces. */
367
+ /** One bar, its faces in its tone's color or its series', each shaded by which way it faces. */
226
368
  private renderBar;
227
369
  /** The readout: the bar's category, series, and value in words, once the keys have moved to one. */
228
370
  private renderLive;