@altertable/data-app 0.72.0 → 0.74.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 (112) hide show
  1. package/AGENTS.md +5 -61
  2. package/CONTRIBUTING.md +130 -181
  3. package/README.md +3 -4
  4. package/REFERENCE.md +35 -345
  5. package/dist/chunks/contract-BeLPJwlO.js +558 -0
  6. package/dist/chunks/contract-BeLPJwlO.js.map +1 -0
  7. package/dist/chunks/contract-Di8SP74I.js +462 -0
  8. package/dist/chunks/contract-Di8SP74I.js.map +1 -0
  9. package/dist/chunks/diagnostics-BTZSlNtW.js +967 -0
  10. package/dist/chunks/diagnostics-BTZSlNtW.js.map +1 -0
  11. package/dist/chunks/format-BdFlv_xa.js +148 -0
  12. package/dist/chunks/format-BdFlv_xa.js.map +1 -0
  13. package/dist/chunks/operation-CSM9UmO3.js +134 -0
  14. package/dist/chunks/operation-CSM9UmO3.js.map +1 -0
  15. package/dist/chunks/request-body-H1qPmmTN.js +50 -0
  16. package/dist/chunks/request-body-H1qPmmTN.js.map +1 -0
  17. package/dist/client/index.js +273 -285
  18. package/dist/client/index.js.map +1 -13
  19. package/dist/core/appearance.js +171 -162
  20. package/dist/core/appearance.js.map +1 -10
  21. package/dist/core/config.js +49 -11
  22. package/dist/core/config.js.map +1 -9
  23. package/dist/core/contract.js +3 -73
  24. package/dist/core/format.js +1 -26
  25. package/dist/index.js +1 -12
  26. package/dist/internal.js +352 -397
  27. package/dist/internal.js.map +1 -15
  28. package/dist/server/index.js +85 -97
  29. package/dist/server/index.js.map +1 -10
  30. package/dist/types/chunks/appearance.d.ts +45 -0
  31. package/dist/types/chunks/contract.d.ts +720 -0
  32. package/dist/types/chunks/index.d.ts +240 -0
  33. package/dist/types/client/index.d.ts +3 -13
  34. package/dist/types/core/appearance.d.ts +2 -42
  35. package/dist/types/core/config.d.ts +36 -39
  36. package/dist/types/core/contract.d.ts +2 -114
  37. package/dist/types/core/format.d.ts +44 -17
  38. package/dist/types/index.d.ts +3 -3
  39. package/dist/types/internal.d.ts +312 -22
  40. package/dist/types/server/index.d.ts +15 -4
  41. package/docs/app-authoring.md +77 -128
  42. package/docs/client.md +29 -63
  43. package/docs/composition.md +44 -75
  44. package/docs/contract.md +60 -100
  45. package/docs/data-context.md +35 -61
  46. package/docs/diagnostics.md +45 -0
  47. package/docs/embed.md +86 -55
  48. package/docs/formatting-and-appearance.md +17 -38
  49. package/docs/hosted-apps.md +7 -14
  50. package/docs/layout.md +30 -47
  51. package/docs/local-data-apps.md +7 -7
  52. package/docs/react-embed.md +20 -26
  53. package/docs/react.md +10 -27
  54. package/docs/server-bun.md +2 -27
  55. package/docs/server.md +6 -12
  56. package/docs/stories-and-export.md +38 -40
  57. package/docs/styling.md +14 -22
  58. package/docs/ui-quality.md +5 -5
  59. package/docs/ui.md +93 -70
  60. package/docs/variables.md +142 -254
  61. package/docs/views.md +85 -116
  62. package/docs/widgets.md +100 -153
  63. package/docs/worker.md +15 -27
  64. package/package.json +3 -2
  65. package/dist/chunks/index-5a27erdg.js +0 -54
  66. package/dist/chunks/index-5a27erdg.js.map +0 -10
  67. package/dist/chunks/index-9yxr7nmm.js +0 -742
  68. package/dist/chunks/index-9yxr7nmm.js.map +0 -17
  69. package/dist/chunks/index-j5q5n3ra.js +0 -151
  70. package/dist/chunks/index-j5q5n3ra.js.map +0 -10
  71. package/dist/chunks/index-q75zm3a7.js +0 -153
  72. package/dist/chunks/index-q75zm3a7.js.map +0 -11
  73. package/dist/chunks/index-vhaec7m5.js +0 -30
  74. package/dist/chunks/index-vhaec7m5.js.map +0 -10
  75. package/dist/chunks/index-zp78caex.js +0 -1047
  76. package/dist/chunks/index-zp78caex.js.map +0 -19
  77. package/dist/core/contract.js.map +0 -9
  78. package/dist/core/format.js.map +0 -9
  79. package/dist/index.js.map +0 -9
  80. package/dist/types/client/annotations.d.ts +0 -27
  81. package/dist/types/client/data-client.d.ts +0 -43
  82. package/dist/types/client/download.d.ts +0 -5
  83. package/dist/types/client/iframe.d.ts +0 -59
  84. package/dist/types/client/location.d.ts +0 -13
  85. package/dist/types/client/logger.d.ts +0 -14
  86. package/dist/types/client/messages.d.ts +0 -7
  87. package/dist/types/client/navigation.d.ts +0 -15
  88. package/dist/types/client/transport.d.ts +0 -15
  89. package/dist/types/core/annotations.d.ts +0 -99
  90. package/dist/types/core/bridge-endpoint.d.ts +0 -21
  91. package/dist/types/core/bridge.d.ts +0 -172
  92. package/dist/types/core/data-view.d.ts +0 -46
  93. package/dist/types/core/date-format.d.ts +0 -24
  94. package/dist/types/core/date-range.d.ts +0 -20
  95. package/dist/types/core/dimension-source.d.ts +0 -64
  96. package/dist/types/core/dimension.d.ts +0 -71
  97. package/dist/types/core/facets.d.ts +0 -13
  98. package/dist/types/core/filters.d.ts +0 -45
  99. package/dist/types/core/invariant.d.ts +0 -2
  100. package/dist/types/core/keys.d.ts +0 -2
  101. package/dist/types/core/logger.d.ts +0 -12
  102. package/dist/types/core/messages.d.ts +0 -62
  103. package/dist/types/core/navigation.d.ts +0 -11
  104. package/dist/types/core/operation-types.d.ts +0 -80
  105. package/dist/types/core/operation.d.ts +0 -20
  106. package/dist/types/core/presentation.d.ts +0 -9
  107. package/dist/types/core/queries.d.ts +0 -84
  108. package/dist/types/core/reading.d.ts +0 -17
  109. package/dist/types/core/uuid.d.ts +0 -2
  110. package/dist/types/core/variables.d.ts +0 -133
  111. package/dist/types/server/handler.d.ts +0 -13
  112. package/dist/types/server/request-body.d.ts +0 -4
package/docs/server.md CHANGED
@@ -2,12 +2,11 @@
2
2
 
3
3
  Import `createDataHandler()` and the `RequestAccess` type from
4
4
  `@altertable/data-app/server`. The handler accepts a Web `Request` and returns a
5
- `Promise<Response>`. This entry can be imported in Node and Bun without loading
6
- React or the Bun local-development adapter.
5
+ `Promise<Response>` in Node or Bun.
7
6
 
8
7
  ```ts
9
8
  import { createDataHandler } from '@altertable/data-app/server';
10
- import { operations } from './operations';
9
+ import { operations } from './operations.ts';
11
10
 
12
11
  export const handleDataRequest = createDataHandler(
13
12
  operations,
@@ -36,12 +35,7 @@ See [operation contracts](contract.md), the [client](client.md), and the
36
35
 
37
36
  ## Request input limits
38
37
 
39
- JSON request bodies are limited to **16,384 encoded bytes**, including multibyte
40
- UTF-8 content. The handler counts bytes as it reads and cancels remaining
41
- consumption on overflow; it does not rely on `Content-Length`. Authorization
42
- runs before reading. Request cancellation interrupts waiting reads. Invalid or
43
- interrupted bodies return `400/invalid_input`; oversized bodies return
44
- `413/input_too_large`.
45
-
46
- `maxDurationMs` bounds execution after input parsing. It does not add a separate
47
- body-read deadline. The hosting runtime controls the size of individual chunks.
38
+ JSON request bodies are limited to 16,384 encoded bytes. Oversized bodies return
39
+ `413/input_too_large`; invalid or interrupted bodies return `400/invalid_input`.
40
+ `maxDurationMs` bounds execution after parsing; configure body-read deadlines in
41
+ the hosting runtime.
@@ -1,52 +1,50 @@
1
1
  # Stories and CSV export
2
2
 
3
- Every `<DataApp>` from `@altertable/data-app-react` supplies both `story` and `datasets`, derived from
4
- the displayed snapshot. Story and export selectors do not run before a result is available.
5
- Setup and static screens use `<DataApp>` from `@altertable/data-app-react/ui`; they may omit both
6
- or pass a direct `CsvExport` object.
3
+ Supply `story` and `datasets` on `<DataApp>` from `@altertable/data-app-react`.
4
+ Both use the displayed snapshot, including during refresh or failure.
5
+ Setup and static screens use `<DataApp>` from `/ui` and may omit both.
7
6
 
8
7
  ## Present data with stories
9
8
 
10
- Set `story` on `<DataApp>` to enable **Present story** in the toolbar.
11
- For custom shells, `@altertable/data-app-react/ui` provides `<PresentStory>`; see [direct UI composition](ui.md). Start from the [data app starter](app-authoring.md#use-release-matched-starters).
9
+ Continue the starter's `totalSamples` binding. Return one to four findings with a
10
+ headline, visual, and registered dataset or
11
+ metric as `evidence`. Reuse bindings and derive scope from the snapshot:
12
12
 
13
- Return one to four findings with a headline, a visual, and registered source
14
- evidence. Set `evidence` to the registered dataset or metric binding. The app
15
- validates that every finding belongs to its view.
13
+ ```tsx
14
+ // ... sampleCountsView, sampleCounts, totalSamples, and sampleContent
15
+ function App() {
16
+ return (
17
+ <DataApp
18
+ view={sampleCountsView}
19
+ datasets={[sampleCounts]}
20
+ story={snapshot => {
21
+ const total = totalSamples.read(snapshot);
22
+ return [
23
+ {
24
+ id: 'total-samples',
25
+ headline: `Total samples: ${formatMetric(total.value.current, totalSamples.definition.format)}`,
26
+ context: sampleCountsView.scope(snapshot),
27
+ visual: <MetricWidget metric={totalSamples} source={snapshot} />,
28
+ evidence: totalSamples,
29
+ },
30
+ ];
31
+ }}
32
+ >
33
+ <DataSection content={sampleContent} />
34
+ </DataApp>
35
+ );
36
+ }
37
+ ```
16
38
 
17
- The callback receives the displayed source and its original input, including
18
- during refresh or failure. Derive the story from that snapshot so it agrees with
19
- the visible exploration. Initial loading, empty results, and initial errors have
20
- no story to present; the toolbar keeps its story action visible and disabled.
39
+ Keep the starter's `formatMetric()` import for formatted headlines.
21
40
 
22
41
  ## Export displayed data as CSV
23
42
 
24
- Select all distinct named datasets from the displayed snapshot. One dataset downloads directly as CSV. Multiple
25
- datasets offer individual CSV downloads and **Export all** as a ZIP archive.
26
- While no displayed snapshot is available, the export action stays visible and disabled.
27
-
28
43
  Declare [datasets](widgets.md#declare-datasets-and-metrics) once and pass
29
- `datasets={[countries, otherDataset]}` to `<DataApp>`. The toolbar
30
- exports those datasets with raw values and a safe filename derived from the
31
- displayed scope. List every distinct dataset the app shows.
32
-
33
- Reuse bound metrics in story visuals:
34
-
35
- ```tsx
36
- story={snapshot => {
37
- const totalReading = total.read(snapshot);
38
- return [{
39
- id: 'total',
40
- headline: `Tracked identities: ${formatMetric(totalReading.value.current, total.definition.format)}`,
41
- context: activityView.scope(snapshot),
42
- visual: <MetricWidget metric={total} source={snapshot} />,
43
- evidence: total,
44
- }];
45
- }}
46
- ```
47
-
48
- Use the [format helpers](formatting-and-appearance.md) for story prose.
44
+ `datasets={[sampleCounts]}`. Include every distinct displayed dataset
45
+ at its displayed grain; reuse a dataset for visuals sharing the same rows.
49
46
 
50
- Dataset accessors return raw values; do not preformat numbers as display
51
- labels. Null and undefined become empty cells, while measured zero stays zero.
52
- The helpers handle quoting and spreadsheet formula protection.
47
+ One dataset downloads as CSV; multiple datasets offer individual downloads and
48
+ **Export all** as ZIP. Filenames use the displayed scope. Accessors must return
49
+ raw values: null and undefined export as empty cells, and measured zero stays
50
+ zero. Export handles quoting and spreadsheet formula protection.
package/docs/styling.md CHANGED
@@ -1,18 +1,15 @@
1
1
  # Styling
2
2
 
3
- Use components and typed props first: `<Stack>` for sections, `<Grid>` for peers,
4
- and `<TextContent>` for prose. Standard widgets use [views and bindings](widgets.md);
5
- custom controls and direct widget shells use [`@altertable/data-app-react/ui`](ui.md).
6
-
7
- Configure theme, palette, accent, typography, density, radius, and elevation through
8
- `app.appearance`; see [appearance](formatting-and-appearance.md). Call
9
- `injectDataAppStyles()` before mounting. Use one `<DataApp>` per document.
3
+ Keep default appearance unless customization is requested. Use components and
4
+ typed props first. Configure appearance once through
5
+ `dataApp.appearance`; see [formatting and appearance](formatting-and-appearance.md).
6
+ Call `injectDataAppStyles()` before mounting and use one `<DataApp>` per document.
10
7
 
11
8
  ## Customize
12
9
 
13
- Add app-owned classes through `className`. Render package components rather than copying their classes onto markup;
14
- private descendants are not customization hooks. Public names and stable roots
15
- are listed in the [typed contract](https://github.com/altertable-ai/data-app/blob/main/packages/data-app-react/src/style-contract.ts).
10
+ Add app-owned classes through `className` and override public tokens. Render
11
+ package components; do not copy their classes or select private descendants.
12
+ Public hooks are listed in the [style contract](https://github.com/altertable-ai/data-app/blob/main/packages/data-app-react/src/style-contract.ts).
16
13
 
17
14
  ```css
18
15
  .app-action {
@@ -21,18 +18,14 @@ are listed in the [typed contract](https://github.com/altertable-ai/data-app/blo
21
18
  }
22
19
  ```
23
20
 
24
- Type inline token overrides with `DataAppStyle`. Give optional tokens a `var()`
25
- fallback in app CSS. Use `:root` for shared theme overrides, including menus and overlays.
26
- Prefer `app.appearance` for brand and chart colors. When overriding accent tokens,
27
- choose a contrasting foreground too. Keep text inputs at least 16px on mobile.
28
-
29
- Menus and selection dropdowns share `--atbl-dropdown-padding`,
30
- `--atbl-dropdown-item-padding-block`, `--atbl-dropdown-item-padding-inline`, and
31
- `--atbl-dropdown-item-gap`. Their default padding follows the control density.
21
+ Type inline overrides with `DataAppStyle`. Give optional tokens a `var()` fallback.
22
+ Use `:root` for overrides shared with menus and overlays. Prefer `dataApp.appearance`
23
+ for brand and chart colors; pair accent overrides with a contrasting foreground.
24
+ Keep text inputs at least 16px on mobile.
32
25
 
33
26
  ## Native controls
34
27
 
35
- Use package controls when possible. For a custom native control:
28
+ Prefer package controls. For a custom native control:
36
29
 
37
30
  ```tsx
38
31
  <button type="button" data-atbl-control="action" data-atbl-focus="ring">
@@ -40,6 +33,5 @@ Use package controls when possible. For a custom native control:
40
33
  </button>
41
34
  ```
42
35
 
43
- These hooks provide cursor and focus styling; keep accessible names, disabled
44
- state, and keyboard behavior. See
45
- [UI quality](ui-quality.md) for rendered verification.
36
+ These hooks style cursor and focus. Supply accessible names, disabled state, and
37
+ keyboard behavior, then verify [UI quality](ui-quality.md).
@@ -13,8 +13,8 @@ Keep static context visible during loading. Skeletonize only dynamic content;
13
13
  refresh, errors, and retry retain the displayed result and scope. Loading
14
14
  geometry should match ready content.
15
15
 
16
- Verify a real app at phone and desktop widths, including 320px, in both themes
17
- and with enlarged text. Exercise long labels, localized values, many filters,
18
- and loading, empty, refresh, and error states. Check containment, contrast,
19
- keyboard focus, date/menu navigation, modal dismissal, and reduced motion.
20
- Inspect rendered screenshots as well as computed styles.
16
+ The SDK owns standard theme handling, responsive components, and keyboard/focus
17
+ behavior for its controls. Review app-owned content at its intended width with realistic labels
18
+ and values. When adding custom layout or CSS, check narrow and wide widths for
19
+ clipping and overflow; check custom colors in both themes and custom controls
20
+ with the keyboard.
package/docs/ui.md CHANGED
@@ -10,36 +10,55 @@ frame for deliberately custom content. Use `<GettingStarted>` for
10
10
  connection setup. Fetched data belongs to a declared view; avoid inventing
11
11
  request states to populate a shell.
12
12
 
13
- Widget titles use the available header width and wrap when needed. Supplying
14
- `status` reserves space for refresh and retry feedback, including while idle.
15
-
16
- Direct `<DateRangePicker>`, `<DimensionPicker>`, and `useAppVariables()` support
17
- custom control ownership. The caller supplies values and change handlers.
18
- Custom tables use `<DataTable>` and its cell helpers; controls and overlays
19
- include `<SearchField>`, `<ChoicePicker>`, `<Tabs>`, `<Sheet>`, and `<HelpPopover>`.
20
- Horizontal `<TabList>` content scrolls with gradient cues at overflowing edges.
13
+ Custom controls own values and change handlers; use `useAppVariables()` for
14
+ custom URL state. Use `<DataTable>` for custom tables and `<Tabs>`, `<Sheet>`,
15
+ and `<HelpPopover>` for navigation and overlays.
21
16
 
22
17
  Standalone `<AboutData>`, glossary components, and `<PresentStory>` support
23
18
  custom inspection and presentation. Supply registered context and evidence, and
24
19
  derive findings from the displayed data. Standard widgets and `<DataApp>`
25
20
  already own these experiences.
26
21
 
27
- For framework mounting, `<DataAppProvider app={app}>` supplies app identity, shared requests and one inspection sheet. Wrap custom shells in it; app components inherit identity and appearance.
22
+ For framework mounting, `<DataAppProvider app={dataApp}>` supplies app identity, shared requests and one inspection sheet. Wrap custom shells in it; app components inherit identity and appearance.
28
23
  Call `injectDataAppStyles()` before mounting either entry; imports do not install
29
24
  styles.
30
25
 
26
+ ## Custom activity labels
27
+
28
+ For a custom activity label, wrap `<ShimmerText>` in `<output>`:
29
+
30
+ ```tsx
31
+ import { ShimmerText } from '@altertable/data-app-react/ui';
32
+
33
+ function LoadingLabel() {
34
+ return (
35
+ <output>
36
+ <ShimmerText>Loading results</ShimmerText>
37
+ </output>
38
+ );
39
+ }
40
+ ```
41
+
31
42
  ## Keyboard actions
32
43
 
33
44
  Use `isPlainKeyEvent()` from `@altertable/data-app-react/ui` in custom key handlers so local actions
34
45
  leave shortcut modifiers and IME composition untouched:
35
46
 
36
47
  ```tsx
37
- onKeyDown={event => {
38
- if (event.key === 'Enter' && isPlainKeyEvent(event.nativeEvent)) {
39
- event.preventDefault();
40
- submit();
41
- }
42
- }}
48
+ function SearchInput() {
49
+ // ... submit handler
50
+ return (
51
+ <input
52
+ aria-label="Search"
53
+ onKeyDown={event => {
54
+ if (event.key === 'Enter' && isPlainKeyEvent(event.nativeEvent)) {
55
+ event.preventDefault();
56
+ submit();
57
+ }
58
+ }}
59
+ />
60
+ );
61
+ }
43
62
  ```
44
63
 
45
64
  Pass `{ allowShift: true }` when the handler also supports Shift gestures.
@@ -47,17 +66,13 @@ Pass `{ allowShift: true }` when the handler also supports Shift gestures.
47
66
  ## Choose a selection control
48
67
 
49
68
  Use `<DimensionPicker>` for typed field filters and `<ChoicePicker>` for searchable
50
- values. A single value uses a checkmark and closes after selection; multiple
51
- values use checkbox indicators and keep the popup open. These pickers expose
52
- listbox options, including search and loading feedback.
69
+ values.
53
70
 
54
71
  Use `<MenuTrigger>`, `<MenuButton>`, `<MenuPopover>`, `<Menu>`, and `<MenuItem>`
55
72
  for commands or short choice menus
56
73
  such as sort order or display mode. Actions use `onAction`. Set
57
74
  `selectionMode="single"` for mutually exclusive choices (radio menu items), or
58
- `selectionMode="multiple"` for independent toggles (checkbox menu items). Menus
59
- support arrow keys, typeahead, Escape, and focus return to their trigger. Keep
60
- search fields and other form inputs outside menus.
75
+ `selectionMode="multiple"` for independent toggles (checkbox menu items). Keep search fields and form inputs outside menus.
61
76
 
62
77
  ```tsx
63
78
  <MenuTrigger>
@@ -81,11 +96,8 @@ search fields and other form inputs outside menus.
81
96
  `<MenuButton>` accepts text or icons; give icon-only buttons an accessible name.
82
97
  `<MenuPopover>` owns placement and popup styling.
83
98
 
84
- Use `<MenuSection>` to group choices with their own selection state and
85
- `<MenuSeparator>` between groups or commands. Menu selection closes the popup
86
- by default; set `shouldCloseOnSelect={false}` for repeated toggles. Selection
87
- indicators derive from the menu or section's selection mode; do not add checkbox
88
- markup to single-choice items.
99
+ Use `<MenuSection>` for grouped choices and `<MenuSeparator>` between groups.
100
+ Selection indicators derive from `selectionMode`; do not add checkbox markup.
89
101
 
90
102
  ## Charts
91
103
 
@@ -97,10 +109,9 @@ so rows, loading state, evidence, and inspection come from that dataset.
97
109
  Pass ordered items with unique, nonblank IDs and finite numbers. Bar and pie
98
110
  values must be nonnegative. Use `formatValue` for domain formatting.
99
111
 
100
- Line and area charts show equally spaced samples; include missing periods in the
101
- input. These charts space items evenly, so they do not represent irregular time
102
- intervals. Distinguish a missing observation from measured zero when preparing
103
- the samples. Pie slices represent mutually exclusive parts of one total; shares
112
+ Line and area charts space samples equally; include missing periods and use
113
+ composed charts for irregular intervals. Distinguish missing observations from zero.
114
+ Pie slices represent mutually exclusive parts of one total; shares
104
115
  use the sum of supplied items, so include Other when showing a subset of the
105
116
  whole. Scatter points represent independent X/Y observations.
106
117
 
@@ -133,29 +144,44 @@ Use `<ComposedChart>` from `@altertable/data-app-react/ui` for multiple series o
133
144
  standalone charts' themed series primitives; axes, scatter, tooltip, and reference
134
145
  primitives are also available.
135
146
 
147
+ Declare shared measure semantics with `valueFormat` (currency, count, or ratio).
148
+ Numeric Y axes automatically use a common k/M/B/T scale and precision derived from
149
+ visible ticks; tooltips retain the measure format. Ratios use percentages without
150
+ compact scaling. Set an axis `tickFormatter` or tooltip `formatter` to override
151
+ presentation, including when different axes represent different units.
152
+
136
153
  ```tsx
137
- <VisualizationWidget dataset={revenue} source={result}>
138
- {rows => (
139
- <ComposedChart data={rows} ariaLabel="Monthly revenue and target in euros">
140
- <ComposedChart.XAxis dataKey="month" />
141
- <ComposedChart.YAxis />
142
- <ComposedChart.Tooltip />
143
- <ComposedChart.Legend />
144
- <ComposedChart.Bar dataKey="revenue" name="Revenue (€)" />
145
- <ComposedChart.Line
146
- dataKey="target"
147
- name="Target (€)"
148
- stroke="var(--atbl-chart-2)"
149
- />
150
- </ComposedChart>
151
- )}
152
- </VisualizationWidget>
154
+ // ... revenueView and its revenue dataset
155
+ const revenueContent = revenueView.content(result => (
156
+ <VisualizationWidget dataset={revenue} source={result}>
157
+ {rows => (
158
+ <ComposedChart
159
+ data={rows}
160
+ ariaLabel="Monthly revenue and target in euros"
161
+ valueFormat={{ kind: 'currency', currency: 'EUR' }}
162
+ >
163
+ <ComposedChart.XAxis dataKey="month" />
164
+ <ComposedChart.YAxis />
165
+ <ComposedChart.Tooltip />
166
+ <ComposedChart.Legend />
167
+ <ComposedChart.Bar dataKey="revenue" name="Revenue (€)" />
168
+ <ComposedChart.Line
169
+ dataKey="target"
170
+ name="Target (€)"
171
+ stroke="var(--atbl-chart-2)"
172
+ />
173
+ </ComposedChart>
174
+ )}
175
+ </VisualizationWidget>
176
+ ));
153
177
  ```
154
178
 
155
179
  For irregular time intervals, use `<ComposedChart.XAxis>` with ISO dates, zoned
156
180
  ISO timestamps, or `Date` values; spacing follows elapsed time. Use `scale="utc"`
157
181
  for epoch milliseconds, or `type="category"` to keep date-like labels categorical.
158
182
  On UTC axes, supplied `ticks` and `tickFormatter` take precedence over automatic labels.
183
+ Axes with `<ComposedChart.Bar>` reserve half the smallest date interval at both ends
184
+ to keep edge bars inside the plot. An explicit `domain` overrides this spacing.
159
185
  Preserve missing measures as `null` and choose `connectNulls` deliberately; do not
160
186
  replace missing observations with zero.
161
187
 
@@ -169,10 +195,7 @@ its columns aligned with the displayed measures.
169
195
  Include `<ComposedChart.Legend />` to derive labels and colored square markers from the series;
170
196
  omit it when no legend is needed. For any chart, compose `<ChartLegend>` with
171
197
  `<ChartLegend.Item>`, `<ChartLegend.Marker>`, and `<ChartLegend.Label>` using the
172
- same names and colors as the plot. Square markers are
173
- shared with chart tooltips and funnel summaries. Pass `kind="square"` explicitly
174
- when composing a marker.
175
- `<PieChart>` includes a legend by default; `showLegend={false}` omits it.
198
+ same names and colors as the plot. `<PieChart>` includes a legend by default; `showLegend={false}` omits it.
176
199
 
177
200
  Legends describe series; authored toggles or a composed legend's `onClick`
178
201
  leave series visibility to the app.
@@ -196,33 +219,33 @@ filter declarations own URL state, validation, and operation meaning.
196
219
  | `<DimensionPicker>` | Typed categorical predicates with fixed or facet options |
197
220
 
198
221
  ```tsx
199
- <RadioGroup label="Metric" value={metric} onChange={setMetric}>
200
- <Radio value="orders">Orders</Radio>
201
- <Radio value="revenue">Revenue</Radio>
202
- </RadioGroup>
203
-
204
- <CheckboxGroup label="Statuses" values={statuses} onChange={setStatuses}>
205
- <Checkbox value="paid" label="Paid" />
206
- <Checkbox value="pending" label="Pending" />
207
- </CheckboxGroup>
222
+ function FilterChoices() {
223
+ // ... metric, statuses, and their change handlers
224
+ return (
225
+ <>
226
+ <RadioGroup label="Metric" value={metric} onChange={setMetric}>
227
+ <Radio value="orders">Orders</Radio>
228
+ <Radio value="revenue">Revenue</Radio>
229
+ </RadioGroup>
230
+
231
+ <CheckboxGroup label="Statuses" values={statuses} onChange={setStatuses}>
232
+ <Checkbox value="paid" label="Paid" />
233
+ <Checkbox value="pending" label="Pending" />
234
+ </CheckboxGroup>
235
+ </>
236
+ );
237
+ }
208
238
  ```
209
239
 
210
- A standalone `<Checkbox>` uses `checked` and `onChange`; a group item supplies
211
- `value`. `<SegmentedControl>` accepts the same labeled options as `<Select>` and
212
- keeps radio-group semantics. Numeric range controls retain invalid draft bounds
213
- and emit only valid intervals. Numeric input and compact selects respect the
214
- shared mobile text-size minimum.
240
+ A standalone `<Checkbox>` uses `checked` and `onChange`; group items use `value`.
215
241
 
216
242
  Use `<FilterBar>` to arrange predicates and `<VariableBar>` for mixed app
217
243
  parameters. Use `<FilterActions>` for Clear or paired Apply/Cancel actions on
218
244
  app-owned drafts; provide the handlers for your applied state.
219
245
 
220
- `<NumberFilterPicker>` composes numeric fields inside a dedicated popover. Edits
221
- remain local until Apply; Cancel and dismissal discard them. Use `<NumberField>`
222
- and `<NumberRangeField>` as inline input primitives when composing forms.
246
+ Use `<NumberFilterPicker>` for a numeric predicate popover or numeric fields
247
+ for inline forms.
223
248
 
224
249
  Use `<Button variant="primary">` for the main committing action, such as Apply.
225
250
  Use outline and ghost buttons for secondary actions.
226
- Use `<Button variant="inline">` for actions within text or table cells. It has no
227
- control padding or background and underlines on hover. Keep button semantics for
228
- opening a sheet; use links for navigation to a URL.
251
+ Use `<Button variant="inline">` for actions within text or table cells. Use buttons for opening sheets and links for URL navigation.