@altertable/data-app 0.74.0 → 0.75.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 (50) hide show
  1. package/AGENTS.md +11 -3
  2. package/CONTRIBUTING.md +14 -3
  3. package/REFERENCE.md +173 -24
  4. package/dist/chunks/{contract-BeLPJwlO.js → contract-B3s0ybE2.js} +179 -34
  5. package/dist/chunks/contract-B3s0ybE2.js.map +1 -0
  6. package/dist/chunks/{contract-Di8SP74I.js → contract-DcPjfm0R.js} +255 -4
  7. package/dist/chunks/contract-DcPjfm0R.js.map +1 -0
  8. package/dist/chunks/{diagnostics-BTZSlNtW.js → diagnostics-DVwQ5PDK.js} +2 -2
  9. package/dist/chunks/{diagnostics-BTZSlNtW.js.map → diagnostics-DVwQ5PDK.js.map} +1 -1
  10. package/dist/chunks/format-5hMYUWk3.js +793 -0
  11. package/dist/chunks/format-5hMYUWk3.js.map +1 -0
  12. package/dist/chunks/{operation-CSM9UmO3.js → operation-CGuN7Zcb.js} +3 -3
  13. package/dist/chunks/{operation-CSM9UmO3.js.map → operation-CGuN7Zcb.js.map} +1 -1
  14. package/dist/client/index.js +51 -5
  15. package/dist/client/index.js.map +1 -1
  16. package/dist/core/config.js +4 -3
  17. package/dist/core/config.js.map +1 -1
  18. package/dist/core/contract.js +4 -3
  19. package/dist/core/format.js +1 -1
  20. package/dist/internal.js +8 -7
  21. package/dist/internal.js.map +1 -1
  22. package/dist/server/index.js +3 -3
  23. package/dist/server/index.js.map +1 -1
  24. package/dist/types/chunks/contract.d.ts +168 -10
  25. package/dist/types/chunks/date-time-range-value.d.ts +46 -0
  26. package/dist/types/chunks/index.d.ts +13 -2
  27. package/dist/types/client/index.d.ts +3 -3
  28. package/dist/types/core/config.d.ts +6 -4
  29. package/dist/types/core/contract.d.ts +3 -2
  30. package/dist/types/core/format.d.ts +20 -1
  31. package/dist/types/index.d.ts +3 -2
  32. package/dist/types/internal.d.ts +9 -4
  33. package/dist/types/server/index.d.ts +2 -2
  34. package/docs/app-authoring.md +46 -14
  35. package/docs/composition.md +4 -23
  36. package/docs/contract.md +41 -9
  37. package/docs/diagnostics.md +37 -0
  38. package/docs/embed.md +38 -0
  39. package/docs/hosted-apps.md +7 -4
  40. package/docs/local-data-apps.md +17 -2
  41. package/docs/react.md +6 -3
  42. package/docs/stories-and-export.md +14 -5
  43. package/docs/ui-quality.md +3 -2
  44. package/docs/ui.md +52 -1
  45. package/docs/variables.md +61 -0
  46. package/package.json +3 -2
  47. package/dist/chunks/contract-BeLPJwlO.js.map +0 -1
  48. package/dist/chunks/contract-Di8SP74I.js.map +0 -1
  49. package/dist/chunks/format-BdFlv_xa.js +0 -148
  50. package/dist/chunks/format-BdFlv_xa.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { $t as QueryDefinitions, Bt as DimensionSourceQueryName, L as defineOperation, M as OperationDefinition, Vt as SourceDimensionVariable, Xt as CheckedQueries, an as QueryRow, en as QueryField, in as QueryProjections, nn as QueryParameterValue, on as QuerySnapshot, sn as QueryValueType, tn as QueryParameter, zt as DimensionSourceConfig } from "../chunks/contract.js";
1
+ import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
2
+ import { Cn as QueryRow, Jt as DimensionSourceQueryName, Sn as QueryProjections, Tn as QueryValueType, W as defineOperation, Yt as SourceDimensionVariable, _n as QueryDefinitions, bn as QueryParameterValue, pn as CheckedQueries, qt as DimensionSourceConfig, vn as QueryField, wn as QuerySnapshot, yn as QueryParameter, z as OperationDefinition } from "../chunks/contract.js";
2
3
  import { o as AppearanceOptions } from "../chunks/appearance.js";
3
4
  //#region src/core/config.d.ts
4
5
  export type DataAppConfig<Queries extends QueryDefinitions = QueryDefinitions> = {
@@ -49,9 +50,10 @@ export type DataAppDefinition<Queries extends QueryDefinitions = QueryDefinition
49
50
  * references, and callbacks. Extraction reads literals without executing app code.
50
51
  * TypeScript and runtime query rules own configuration validation.
51
52
  *
52
- * SQL passes unchanged to the backend, which interprets placeholders such as `$orgId`.
53
+ * Scalar placeholders pass to the backend. Datetime-range bound references ($period.from/to)
54
+ * expand to DuckDB timestamp expressions while the range is bound as JSON.
53
55
  * Declare each parameter's type and optional defaultValue.
54
- * Values are finite numbers, strings, booleans, or null, never SQL fragments or identifiers.
56
+ * Values are scalars or declared datetime ranges, never SQL fragments or identifiers.
55
57
  * Host queryParams supply protected values; callers cannot override them.
56
58
  */
57
59
  export declare function defineDataApp<const Queries extends QueryDefinitions>(config: DataAppConfig<Queries> & {
@@ -59,5 +61,5 @@ export declare function defineDataApp<const Queries extends QueryDefinitions>(co
59
61
  }): DataAppDefinition<Queries>;
60
62
  export declare function dataAppTitle(config: Pick<DataAppConfig, 'title' | 'scope'>): string;
61
63
  //#endregion
62
- export type { QueryDefinitions, QueryField, QueryParameter, QueryParameterValue, QueryProjections, QueryRow, QueryValueType };
64
+ export type { AbsoluteOrRelativeDateTime, DateTimeRange, QueryDefinitions, QueryField, QueryParameter, QueryParameterValue, QueryProjections, QueryRow, QueryValueType, RelativeAnchor, RelativeDateTime, RelativeOffset, RelativeUnit };
63
65
  //# sourceMappingURL=config.d.ts.map
@@ -1,2 +1,3 @@
1
- import { $t as QueryDefinitions, A as DateRangeContractOptions, At as BooleanSelection, B as parseDateRangeInput, C as dataAppRoutes, D as sqlQueryRoute, E as navigationUpdateRoute, F as connectionCheck, Ft as numberFilter, G as DimensionFilterOptions, H as parseLabel, I as defineDateRangeContract, J as DimensionOption, Kt as DateRange, L as defineOperation, Lt as parseBooleanSelection, M as OperationDefinition, Mt as NumberOperator, N as RegisteredQuery, Nt as NumberSelection, O as ConnectionOperation, Ot as NavigationUpdate, P as ReportingPeriod, Pt as booleanFilter, Q as DimensionVariable, R as defineQueryNames, Rt as parseNumberSelection, S as createMessageRouter, T as defineMessageRoute, U as parseTrue, Ut as variableInput, V as parseEmptyInput, W as previousDateRange, Y as DimensionSelection, _ as MessageRoutes, a as annotationEditorStateRoute, an as QueryRow, b as RoutedMessage, c as annotationUpdateRoute, cn as DataOperation, d as MessageContext, dn as DataQueryInput, en as QueryField, et as dimensionFilter, f as MessageDispatcher, fn as DisclosedQuery, g as MessageRoute, gn as OperationContracts, h as MessageOutput, hn as OperationContext, i as annotationDraftRoute, in as QueryProjections, it as parseFacetOptions, j as DateRangeRequest, jt as NumberFilter, k as DateRangeContract, kt as BooleanFilter, l as parseDataAppAnnotationDraft, ln as DataOperations, m as MessageInput, mn as Lakehouse, n as DataAppAnnotationDraft, nn as QueryParameterValue, nt as dimensionPredicate, o as annotationModeRoute, p as MessageHandlers, q as DimensionMember, r as DataAppAnnotationPresentation, rn as QueryParameters, rt as parseDimensionSelection, s as annotationSendRoute, sn as QueryValueType, t as DataSourceError, tn as QueryParameter, u as DataQueryRoute, un as DataQueryBody, v as MessageRoutingError, vn as QueryResult, w as defineDataQueryRoute, x as SqlQueryInput, y as MessageTransport, yn as TransportResponse, z as parseCount } from "../chunks/contract.js";
2
- export { type BooleanFilter, type BooleanSelection, type ConnectionOperation, type DataAppAnnotationDraft, type DataAppAnnotationPresentation, type DataOperation, type DataOperations, type DataQueryBody, type DataQueryInput, type DataQueryRoute, DataSourceError, type DateRangeContract, type DateRangeContractOptions, type DateRange as DateRangeInput, type DateRangeRequest, type DimensionFilterOptions, type DimensionMember, type DimensionOption, type DimensionSelection, type DimensionVariable, type DisclosedQuery, type Lakehouse, type MessageContext, type MessageDispatcher, type MessageHandlers, type MessageInput, type MessageOutput, type MessageRoute, type MessageRoutes, MessageRoutingError, type MessageTransport, type NavigationUpdate, type NumberFilter, type NumberOperator, type NumberSelection, type OperationContext, type OperationContracts, type OperationDefinition, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryParameters, type QueryProjections, type QueryResult, type QueryRow, type QueryValueType, type RegisteredQuery, type ReportingPeriod, type RoutedMessage, type SqlQueryInput, type TransportResponse, annotationDraftRoute, annotationEditorStateRoute, annotationModeRoute, annotationSendRoute, annotationUpdateRoute, booleanFilter, connectionCheck, createMessageRouter, dataAppRoutes, defineDataQueryRoute, defineDateRangeContract, defineMessageRoute, defineOperation, defineQueryNames, dimensionFilter, dimensionPredicate, navigationUpdateRoute, numberFilter, parseBooleanSelection, parseCount, parseDataAppAnnotationDraft, parseDateRangeInput, parseDimensionSelection, parseEmptyInput, parseFacetOptions, parseLabel, parseNumberSelection, parseTrue, previousDateRange, sqlQueryRoute, variableInput };
1
+ import { a as resolveDateTimeRange, c as DateTimeRange, i as parseDateTimeRange, n as formatDateTimeRange, o as serializeDateTimeRange, p as ResolvedDateTimeRange, r as parseDateTimeBound, s as AbsoluteOrRelativeDateTime, t as formatDateTimeBound, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
2
+ import { $ as DimensionFilterOptions, $t as DateTimeRangeComparisonSelection, A as dataAppRoutes, An as DisclosedQuery, B as RegisteredQuery, Bt as NumberOperator, C as MessageRoute, Cn as QueryRow, D as RoutedMessage, Dn as DataOperations, E as MessageTransport, En as DataOperation, F as ConnectionOperation, G as defineQueryNames, Gt as parseBooleanSelection, H as connectionCheck, Ht as booleanFilter, I as DateRangeContract, In as QueryResult, It as NavigationUpdate, J as parseEmptyInput, K as parseCount, Kt as parseNumberSelection, L as DateRangeContractOptions, Ln as TransportResponse, Lt as BooleanFilter, M as defineMessageRoute, Mn as Lakehouse, N as navigationUpdateRoute, Nn as OperationContext, O as SqlQueryInput, On as DataQueryBody, P as sqlQueryRoute, Pn as OperationContracts, Q as dateTimeRangeSql, Qt as DateTimeRangeComparisonRequest, R as DateRangeRequest, Rn as DateTimeRangeContract, Rt as BooleanSelection, S as MessageOutput, Sn as QueryProjections, T as MessageRoutingError, Tn as QueryValueType, U as defineDateRangeContract, Ut as numberFilter, V as ReportingPeriod, Vt as NumberSelection, W as defineOperation, X as parseTrue, Y as parseLabel, Z as previousDateRange, Zt as variableInput, _ as DataQueryRoute, _n as QueryDefinitions, a as OpenExternalLink, an as dateTimeRangePresets, b as MessageHandlers, bn as QueryParameterValue, c as resolveExternalLinkTarget, ct as dimensionFilter, d as annotationDraftRoute, dt as parseDimensionSelection, en as DateTimeRangeComparisonVariable, f as annotationEditorStateRoute, ft as parseFacetOptions, g as parseDataAppAnnotationDraft, h as annotationUpdateRoute, i as ExternalLinkTarget, in as DateTimeRangeVariableOptions, j as defineDataQueryRoute, k as createMessageRouter, kn as DataQueryInput, l as DataAppAnnotationDraft, ln as DateRange, m as annotationSendRoute, n as ExternalLinkModifiers, nn as DateTimeRangePreset, nt as DimensionOption, o as openExternalLinkRoute, on as dateTimeRangeVariable, ot as DimensionVariable, p as annotationModeRoute, q as parseDateRangeInput, r as ExternalLinkResult, rn as DateTimeRangeVariable, rt as DimensionSelection, s as parseExternalUrl, t as DataSourceError, tn as DateTimeRangeComparisonVariableOptions, tt as DimensionMember, u as DataAppAnnotationPresentation, ut as dimensionPredicate, v as MessageContext, vn as QueryField, w as MessageRoutes, x as MessageInput, xn as QueryParameters, y as MessageDispatcher, yn as QueryParameter, z as OperationDefinition, zn as DateTimeRangeRequest, zt as NumberFilter } from "../chunks/contract.js";
3
+ export { type AbsoluteOrRelativeDateTime, type BooleanFilter, type BooleanSelection, type ConnectionOperation, type DataAppAnnotationDraft, type DataAppAnnotationPresentation, type DataOperation, type DataOperations, type DataQueryBody, type DataQueryInput, type DataQueryRoute, DataSourceError, type DateRangeContract, type DateRangeContractOptions, type DateRange as DateRangeInput, type DateRangeRequest, type DateTimeRange, type DateTimeRangeComparisonRequest, type DateTimeRangeComparisonSelection, type DateTimeRangeComparisonVariable, type DateTimeRangeComparisonVariableOptions, type DateTimeRangeContract, type DateTimeRangePreset, type DateTimeRangeRequest, type DateTimeRangeVariable, type DateTimeRangeVariableOptions, type DimensionFilterOptions, type DimensionMember, type DimensionOption, type DimensionSelection, type DimensionVariable, type DisclosedQuery, type ExternalLinkModifiers, type ExternalLinkResult, type ExternalLinkTarget, type Lakehouse, type MessageContext, type MessageDispatcher, type MessageHandlers, type MessageInput, type MessageOutput, type MessageRoute, type MessageRoutes, MessageRoutingError, type MessageTransport, type NavigationUpdate, type NumberFilter, type NumberOperator, type NumberSelection, type OpenExternalLink, type OperationContext, type OperationContracts, type OperationDefinition, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryParameters, type QueryProjections, type QueryResult, type QueryRow, type QueryValueType, type RegisteredQuery, type RelativeDateTime, type ReportingPeriod, type ResolvedDateTimeRange, type RoutedMessage, type SqlQueryInput, type TransportResponse, annotationDraftRoute, annotationEditorStateRoute, annotationModeRoute, annotationSendRoute, annotationUpdateRoute, booleanFilter, connectionCheck, createMessageRouter, dataAppRoutes, dateTimeRangePresets, dateTimeRangeSql, dateTimeRangeVariable, defineDataQueryRoute, defineDateRangeContract, defineMessageRoute, defineOperation, defineQueryNames, dimensionFilter, dimensionPredicate, formatDateTimeBound, formatDateTimeRange, navigationUpdateRoute, numberFilter, openExternalLinkRoute, parseBooleanSelection, parseCount, parseDataAppAnnotationDraft, parseDateRangeInput, parseDateTimeBound, parseDateTimeRange, parseDimensionSelection, parseEmptyInput, parseExternalUrl, parseFacetOptions, parseLabel, parseNumberSelection, parseTrue, previousDateRange, resolveDateTimeRange, resolveExternalLinkTarget, serializeDateTimeRange, sqlQueryRoute, variableInput };
@@ -1,3 +1,22 @@
1
+ import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, n as formatDateTimeRange, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
2
+ //#region src/core/date-time-range-parser.d.ts
3
+ type DateTimeRangeParseFailureReason = 'empty' | 'unrecognized' | 'invalid-range' | 'ambiguous';
4
+ type DateTimeRangeParserOptions = {
5
+ /** UTC-encoded reference fields for omitted dates/years. Defaults to the current UTC date/time. */
6
+ now?: Date;
7
+ };
8
+ type ParseDateTimeRangeResult = {
9
+ ok: true;
10
+ range: DateTimeRange;
11
+ normalizedInput: string;
12
+ parser: 'relative' | 'calendar-preset' | 'calendar-range' | 'unix' | 'chrono';
13
+ } | {
14
+ ok: false;
15
+ reason: DateTimeRangeParseFailureReason;
16
+ normalizedInput: string;
17
+ };
18
+ export declare function parseDateTimeRangeInput(input: string, options?: DateTimeRangeParserOptions): ParseDateTimeRangeResult;
19
+ //#endregion
1
20
  //#region src/core/date-format.d.ts
2
21
  /** Formatting for calendar dates and instants without implicit time-zone parsing. */
3
22
  type DateFormatOptions = {
@@ -63,5 +82,5 @@ export declare function formatPercent(ratio: number | null | undefined, options?
63
82
  maximumFractionDigits?: number;
64
83
  }): string;
65
84
  //#endregion
66
- export type { DateFormat, DateFormatOptions, DateTimeFormatOptions };
85
+ export { type AbsoluteOrRelativeDateTime, type DateFormat, type DateFormatOptions, type DateTimeFormatOptions, type DateTimeRange, type DateTimeRangeParseFailureReason, type DateTimeRangeParserOptions, type ParseDateTimeRangeResult, type RelativeAnchor, type RelativeDateTime, type RelativeOffset, type RelativeUnit, formatDateTimeRange };
67
86
  //# sourceMappingURL=format.d.ts.map
@@ -1,3 +1,4 @@
1
- import { $t as QueryDefinitions, an as QueryRow, en as QueryField, in as QueryProjections, nn as QueryParameterValue, sn as QueryValueType, tn as QueryParameter } from "./chunks/contract.js";
1
+ import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "./chunks/date-time-range-value.js";
2
+ import { Cn as QueryRow, Sn as QueryProjections, Tn as QueryValueType, _n as QueryDefinitions, bn as QueryParameterValue, vn as QueryField, yn as QueryParameter } from "./chunks/contract.js";
2
3
  import { DataAppConfig, DataAppDefinition, dataAppTitle, defineDataApp } from "./core/config.js";
3
- export { type DataAppConfig, type DataAppDefinition, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryProjections, type QueryRow, type QueryValueType, dataAppTitle, defineDataApp };
4
+ export { type AbsoluteOrRelativeDateTime, type DataAppConfig, type DataAppDefinition, type DateTimeRange, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryProjections, type QueryRow, type QueryValueType, type RelativeAnchor, type RelativeDateTime, type RelativeOffset, type RelativeUnit, dataAppTitle, defineDataApp };
@@ -1,5 +1,6 @@
1
- import { $ as createDimensionFilter, Ct as multiChoiceVariable, Dt as HistoryMode, Gt as DatePresetId, Ht as dimensionSource, It as numberOperatorLabels, Jt as inclusiveDays, K as DimensionFilterSettings, Kt as DateRange, St as defineAppVariables, Tt as validateChoiceOptions, Vt as SourceDimensionVariable, Wt as DatePreset, X as DimensionSelectionVariable, Yt as withinBounds, Z as DimensionValue, Zt as IsUnion, _t as SearchVariable, at as FacetVariable, bt as choiceVariable, ct as AppVariableValues, dt as ChoiceOption, ft as ChoiceVariable, gt as MultiChoiceVariable, ht as DateRangeVariableOptions, j as DateRangeRequest, lt as CheckedFacetContexts, mt as DateRangeVariable, ot as facetSource, pt as DateRangeSelection, qt as availableDatePresets, r as DataAppAnnotationPresentation, st as AppVariable, tt as dimensionMemberKey, ut as CheckedVariableDeclarations, vt as VariableCollection, wt as searchVariable, xt as dateRangeVariable, yt as VariablePresentation } from "./chunks/contract.js";
2
- import { i as parseAppDiagnosticReport, m as localFrameBridge, w as LogEntry } from "./chunks/index.js";
1
+ import { a as resolveDateTimeRange, c as DateTimeRange, f as RelativeUnit, i as parseDateTimeRange, n as formatDateTimeRange, o as serializeDateTimeRange, r as parseDateTimeBound, s as AbsoluteOrRelativeDateTime, t as formatDateTimeBound, u as RelativeDateTime } from "./chunks/date-time-range-value.js";
2
+ import { $t as DateTimeRangeComparisonSelection, At as defineAppVariables, Ct as DateRangeVariableOptions, Dt as VariablePresentation, Et as VariableCollection, Ft as HistoryMode, Mt as searchVariable, Nt as validateChoiceOptions, Ot as choiceVariable, Qt as DateTimeRangeComparisonRequest, R as DateRangeRequest, St as DateRangeVariable, Tt as SearchVariable, Wt as numberOperatorLabels, Xt as dimensionSource, Yt as SourceDimensionVariable, _t as CheckedFacetContexts, an as dateTimeRangePresets, at as DimensionValue, bt as ChoiceVariable, cn as DatePresetId, dn as inclusiveDays, en as DateTimeRangeComparisonVariable, et as DimensionFilterSettings, fn as withinBounds, gn as MAX_QUERY_ROWS, gt as AppVariableValues, ht as AppVariable, in as DateTimeRangeVariableOptions, it as DimensionSelectionVariable, jt as multiChoiceVariable, kt as dateRangeVariable, ln as DateRange, lt as dimensionMemberKey, mn as IsUnion, mt as facetSource, nn as DateTimeRangePreset, on as dateTimeRangeVariable, pt as FacetVariable, rn as DateTimeRangeVariable, sn as DatePreset, st as createDimensionFilter, tn as DateTimeRangeComparisonVariableOptions, u as DataAppAnnotationPresentation, un as availableDatePresets, vt as CheckedVariableDeclarations, wt as MultiChoiceVariable, xt as DateRangeSelection, yt as ChoiceOption, zn as DateTimeRangeRequest } from "./chunks/contract.js";
3
+ import { D as LogEntry, _ as localFrameBridge, s as parseAppDiagnosticReport } from "./chunks/index.js";
3
4
  import { c as Theme } from "./chunks/appearance.js";
4
5
  //#region src/core/bridge.d.ts
5
6
  /** Data app delivery protocol. IDs identify a document, a shell session, and an individual call. */
@@ -292,7 +293,7 @@ type MetricValues = {
292
293
  previous?: number | null;
293
294
  };
294
295
  type MetricReading = DataReading<MetricValues & {
295
- period?: DateRangeRequest;
296
+ period?: DateRangeRequest | DateTimeRangeRequest;
296
297
  }>;
297
298
  //#endregion
298
299
  //#region src/core/uuid.d.ts
@@ -308,5 +309,9 @@ export declare function readRequestBody(request: Request, maxBytes: number): Pro
308
309
  /** Separator for opaque composite keys, independent of URL and DOM ID formats. */
309
310
  export declare const KEY_SEPARATOR = ":";
310
311
  //#endregion
311
- export { type AppVariable, type AppVariableValues, type BridgeDiagnostic, type BridgeEventMessage, type CheckedFacetContexts, type CheckedVariableDeclarations, type ChoiceOption, type ChoiceVariable, type DataAppPresentation, type DataReading, type DataView, type DatePreset, type DatePresetId, type DateRange, type DateRangeSelection, type DateRangeVariable, type DateRangeVariableOptions, type DimensionFilterSettings, type DimensionSelectionVariable, type DimensionValue, type DisplayedSnapshot, type FacetVariable, type HistoryMode, type IsUnion, type MetricReading, type MetricValues, type MultiChoiceVariable, type SearchVariable, type SourceDimensionVariable, type VariableCollection, type VariablePresentation, availableDatePresets, choiceVariable, createDimensionFilter, dateRangeVariable, defineAppVariables, dimensionMemberKey, dimensionSource, facetSource, inclusiveDays, localFrameBridge, multiChoiceVariable, numberOperatorLabels, parseAppDiagnosticReport, searchVariable, validateChoiceOptions, withinBounds };
312
+ //#region src/core/time-units.d.ts
313
+ /** Fixed durations in UTC-rebased arithmetic; months and years are calendar-dependent. */
314
+ export declare const fixedUnitMilliseconds: Partial<Record<RelativeUnit, number>> & Record<'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK', number>;
315
+ //#endregion
316
+ export { type AbsoluteOrRelativeDateTime, type AppVariable, type AppVariableValues, type BridgeDiagnostic, type BridgeEventMessage, type CheckedFacetContexts, type CheckedVariableDeclarations, type ChoiceOption, type ChoiceVariable, type DataAppPresentation, type DataReading, type DataView, type DatePreset, type DatePresetId, type DateRange, type DateRangeSelection, type DateRangeVariable, type DateRangeVariableOptions, type DateTimeRange, type DateTimeRangeComparisonRequest, type DateTimeRangeComparisonSelection, type DateTimeRangeComparisonVariable, type DateTimeRangeComparisonVariableOptions, type DateTimeRangePreset, type DateTimeRangeVariable, type DateTimeRangeVariableOptions, type DimensionFilterSettings, type DimensionSelectionVariable, type DimensionValue, type DisplayedSnapshot, type FacetVariable, type HistoryMode, type IsUnion, MAX_QUERY_ROWS, type MetricReading, type MetricValues, type MultiChoiceVariable, type RelativeDateTime, type SearchVariable, type SourceDimensionVariable, type VariableCollection, type VariablePresentation, availableDatePresets, choiceVariable, createDimensionFilter, dateRangeVariable, dateTimeRangePresets, dateTimeRangeVariable, defineAppVariables, dimensionMemberKey, dimensionSource, facetSource, formatDateTimeBound, formatDateTimeRange, inclusiveDays, localFrameBridge, multiChoiceVariable, numberOperatorLabels, parseAppDiagnosticReport, parseDateTimeBound, parseDateTimeRange, resolveDateTimeRange, searchVariable, serializeDateTimeRange, validateChoiceOptions, withinBounds };
312
317
  //# sourceMappingURL=internal.d.ts.map
@@ -1,9 +1,9 @@
1
- import { ln as DataOperations, mn as Lakehouse, rn as QueryParameters } from "../chunks/contract.js";
1
+ import { Dn as DataOperations, Mn as Lakehouse, xn as QueryParameters } from "../chunks/contract.js";
2
2
  //#region src/server/handler.d.ts
3
3
  /** Authorization result for one viewer request. A hosted adapter must scope its lakehouse client. */
4
4
  type RequestAccess = {
5
5
  lakehouse: Lakehouse;
6
- /** Trusted values shared across queries; each query uses only its declared keys. */
6
+ /** Trusted values shared across queries; each query uses only its declared keys. Datetime ranges use serializeDateTimeRange(); they are decoded and validated before SQL binding. */
7
7
  queryParams?: QueryParameters;
8
8
  };
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  # Author a data app
2
2
 
3
- Build an exploration that answers the user's question and a story of its strongest
4
- findings.
3
+ Use the SDK to connect queries, operations, views, and widgets. The app brief determines the content structure. Component examples do not prescribe
4
+ which sections or features every app must contain.
5
5
 
6
6
  ## Use release-matched starters
7
7
 
@@ -13,20 +13,26 @@ for the requested change. For a new app, use the starter supplied by the authori
13
13
  | ----------------------- | ------------------------------------------------------------------- |
14
14
  | Hosted / remote / cloud | `starter-data-app/index.tsx` |
15
15
  | Local | `starter-local-data-app` |
16
-
17
- The hosted starter is the canonical query → operation → context → view → dataset
18
- → widget → story example. Hosted apps stay in one file with public package imports
16
+ | Hosted metric | `starter-metric-data-app/index.tsx` |
17
+ | Hosted Finding | `starter-finding-data-app/index.tsx` |
18
+ | Local metric | `starter-local-metric-data-app` |
19
+ | Local Finding | `starter-local-finding-data-app` |
20
+
21
+ Choose the runtime and use case supplied by the app brief. Each starter is editable
22
+ source; replace fixture queries and sample content before publishing. The hosted starter demonstrates query → operation
23
+ → context → view → dataset → widget composition, including a story example.
24
+ Hosted apps stay in one file with public package imports
19
25
  and a literal `defineDataApp()` declaration. Local apps use the same composition
20
26
  with their existing server/client wiring. Replace fixture data and connectivity screens; edit
21
27
  app-owned files, not installed packages.
22
28
 
23
- ## Build the exploration
29
+ ## Connect data and components
24
30
 
25
31
  1. **Define the question and scope.** Inspect relevant fields, definitions, time
26
32
  coverage, and missing or incomplete observations. Establish the population,
27
33
  grain, measures, and comparison. Choose a chart that answers the question.
28
- 2. **Replace the starter queries and operation.** Keep supplied registry SQL
29
- unchanged; otherwise write queries against inspected data. Declare `params`
34
+ 2. **Replace the starter queries and operation.** Write queries
35
+ against inspected data and preserve supplied metric definitions. Declare `params`
30
36
  and result aliases in `projections`. Validate flat operation inputs, execute
31
37
  named queries with `query()`, and derive results from its typed rows.
32
38
  3. **Update context and bindings.** Describe definitions and coverage in the data
@@ -37,21 +43,45 @@ app-owned files, not installed packages.
37
43
  useful filters in `variables`; `<DataApp>` renders them. Use `defineTimeView()`
38
44
  for period-driven analysis and `defineDataView()` otherwise. Split views only
39
45
  for independent requests. Keep protected values such as `orgId` backend-owned.
40
- 5. **Compose the exploration.** Lead with the strongest supported finding and
41
- visible scope. Use `<Stack>` for sections, `<Grid>` for peers, and bound widgets
46
+ 5. **Compose the content.** Follow the app brief for section order and narrative.
47
+ Use `<Stack>` for sections, `<Grid>` for peers, and bound widgets
42
48
  from `@altertable/data-app-react`. Keep static explanations outside loading
43
49
  boundaries. Use app tabs only for distinct questions and widget `views` only
44
50
  for alternate representations of one dataset. Keep default appearance;
45
51
  customize when requested. Use custom UI only when bound components cannot
46
52
  express the requirement.
47
- 6. **Adapt the story.** Return one to four supported findings using the same
48
- bindings and displayed input as the exploration. Supply every distinct
49
- displayed dataset to `<DataApp datasets={...}>` for CSV export.
53
+ 6. **Connect shell features.** See [stories and export](stories-and-export.md)
54
+ for the current `<DataApp>` requirements and how to bind these features to the
55
+ displayed result. The app brief determines presentation content and export
56
+ coverage.
50
57
 
51
58
  Keep credentials, authorization, and enforced query limits in the host/backend.
52
59
  The starter supplies transport and mounting; change them only for an explicit
53
60
  integration task.
54
61
 
62
+ ## Link to external pages
63
+
64
+ Use `<ExternalLink>` for HTTPS destinations in widget content:
65
+
66
+ ```tsx
67
+ import { ExternalLink } from '@altertable/data-app-react';
68
+
69
+ function ReportLink() {
70
+ return (
71
+ <ExternalLink href="https://example.com/report">
72
+ View full report
73
+ </ExternalLink>
74
+ );
75
+ }
76
+ ```
77
+
78
+ For programmatic navigation, import `navigateNewTab`, `navigateNewWindow`, or
79
+ `navigateNewWindowOrTab` from `@altertable/data-app/client`. For example,
80
+ `navigateNewWindowOrTab(url, event)` accepts a DOM or React event: Shift requests
81
+ a window, Ctrl/Cmd requests a tab, and an unmodified event does nothing.
82
+
83
+ Embedded hosts must enable the [external link route](embed.md#external-links).
84
+
55
85
  ## Verify the app
56
86
 
57
87
  Run the authoring workflow's validation, then inspect the app:
@@ -60,7 +90,8 @@ Run the authoring workflow's validation, then inspect the app:
60
90
  Distinguish measured zero, missing values, and empty results.
61
91
  - Change filters and exercise loading, empty, error, refresh, and stale states.
62
92
  Narrative, scope, story, and export must agree with the displayed result.
63
- - Present the story and check exported columns, raw values, filename, and scope.
93
+ - For exposed presentation and export features, check the story, exported
94
+ columns, raw values, filename, and scope.
64
95
  - Review app-owned content for clipping and readability at its intended width.
65
96
  Check custom layout or CSS at narrow and wide widths; check custom colors in
66
97
  both themes.
@@ -84,6 +115,7 @@ Open only the section needed for a requirement the starter does not cover:
84
115
  | -------------------------------------------- | ----------------------------------------------------------------- |
85
116
  | Adding categorical, numeric, or time filters | [Variables](variables.md) |
86
117
  | Adding a chart or narrative binding | [Widgets](widgets.md) |
118
+ | Adding supplemental control hints | [Tooltips](ui.md#tooltips-and-explanations) |
87
119
  | Adding a detail destination | [Detail views](views.md#detail-destinations) |
88
120
  | Registering physical sources | [Source identifiers](data-context.md#register-source-identifiers) |
89
121
  | Customizing appearance or CSS | [Formatting](formatting-and-appearance.md), [styling](styling.md) |
@@ -1,13 +1,12 @@
1
- # Compose an exploration
1
+ # Compose data components
2
2
 
3
3
  Define the question, population, period, measures, and comparison before choosing
4
4
  widgets. A focused answer may need only a chart and a paragraph.
5
5
 
6
- ## Build a sequence of questions
6
+ ## Choose components
7
7
 
8
- Lead with the strongest supported result and visible scope. Give each section a
9
- question: what happened, when, where it differs, or what supports the finding.
10
- Omit sections that add no evidence.
8
+ The app brief determines the content and section order.
9
+ Choose components for the information each section needs to convey:
11
10
 
12
11
  | Element | Purpose |
13
12
  | --------- | ------------------------------------------------------ |
@@ -33,21 +32,3 @@ averaging subgroup rates.
33
32
  Derive claims from the [displayed result and its input](views.md#preserve-displayed-results).
34
33
  A claim about all channels may stop being valid after selecting one. Observed
35
34
  differences support investigation; they do not establish a cause.
36
-
37
- ## Example: where are we losing signups?
38
-
39
- Define funnel entry, completion window, and channel attribution. Compare
40
- populations with equal opportunity to complete and identify incomplete periods.
41
-
42
- | Question | Display |
43
- | ------------------------------------- | -------------------------------------------------------- |
44
- | How many starters complete? | Conversion versus a comparable prior period, with counts |
45
- | When does conversion change? | Trend with incomplete periods identified |
46
- | At which step and for which channels? | Funnel and channel comparisons with counts and rates |
47
- | What supports the comparison? | Table of counts, denominators, and rates |
48
-
49
- Use one view for these related datasets. Let dates select funnel entry dates and
50
- channel filters affect every section. Reuse datasets for charts and tables.
51
- Select one to four supported findings for the [story](stories-and-export.md).
52
- Verify that changing a filter updates every claim and preserves a useful reading
53
- order.
package/docs/contract.md CHANGED
@@ -33,8 +33,9 @@ ORDER BY group_name LIMIT $limit`,
33
33
  });
34
34
  ```
35
35
 
36
- Replace fixture SQL with inspected data. Preserve supplied registry SQL. Keep
37
- operation inputs flat; derive SQL parameters inside `run()`:
36
+ Replace fixture SQL with inspected data. Keep query declarations and projections
37
+ in sync when adapting SQL to the app's inputs. Preserve metric definitions.
38
+ Keep operation inputs flat; derive SQL parameters inside `run()`:
38
39
 
39
40
  ```ts
40
41
  import { parseCount } from '@altertable/data-app/contract';
@@ -68,7 +69,9 @@ HTTP results must be JSON-serializable.
68
69
 
69
70
  Host `queryParams` supplies protected parameters that callers cannot override.
70
71
  Other values come from `query()` arguments or defaults. The host/backend enforces
71
- data access and limits.
72
+ data access and limits. Operation policies must set `maxQueryRows` to a positive
73
+ integer no greater than 10,000. The shared SQL host handler also rejects requests
74
+ for more than 10,000 rows.
72
75
 
73
76
  ### Declare query projections
74
77
 
@@ -79,11 +82,39 @@ return SQL text and declare `string` when exact numeric precision matters.
79
82
 
80
83
  Use `operations.sampleCountsByGroup.queryNames` for context and evidence.
81
84
 
82
- ## Shared date ranges
85
+ ### Bind datetime ranges
83
86
 
84
- For period-driven analysis, declare `defineDateRangeContract()` from
85
- `@altertable/data-app/contract` once and share it between the operation's parser
86
- and `defineTimeView()`:
87
+ Declare a `dateTimeRange` parameter and pass a `DateTimeRange` to `query()`.
88
+ For a [comparison variable](variables.md#absolute-and-relative-datetime-ranges),
89
+ pass its `range` or `comparison` bounds. Reference those bounds in SQL:
90
+
91
+ ```ts
92
+ const dataApp = defineDataApp({
93
+ // ... title, description, and scope
94
+ queries: {
95
+ events: {
96
+ statement: `SELECT occurred_at AS "occurredAt" FROM events
97
+ WHERE occurred_at >= $period.from AND occurred_at < $period.to`,
98
+ params: { period: { type: 'dateTimeRange' } },
99
+ projections: { occurredAt: { type: 'string' } },
100
+ },
101
+ },
102
+ });
103
+ ```
104
+
105
+ The start is inclusive and the end exclusive. Relative values resolve at query
106
+ execution. Absolute values encode wall-clock fields in UTC: selecting 4 PM stores
107
+ 16:00Z.
108
+ SQL bounds are timezone-free timestamps. Configure the backend session to the
109
+ reporting timezone and interpret timestamp-with-timezone comparisons in that
110
+ same zone.
111
+
112
+ ## Share reporting policy
113
+
114
+ Pass an optional `defineDateRangeContract()` to `dateTimeRangeVariable()` to
115
+ share coverage, duration limits, and reporting timezone between the picker and
116
+ server parser. By default, coverage ends yesterday; set `completeDays: false`
117
+ to include today. Declare the policy once:
87
118
 
88
119
  ```ts
89
120
  import { defineDateRangeContract } from '@altertable/data-app/contract';
@@ -95,5 +126,6 @@ const calendar = defineDateRangeContract({
95
126
  });
96
127
  ```
97
128
 
98
- Use `calendar.parseRequest()` to validate periods. The contract owns source
99
- coverage, time zone, maximum range, and comparison rules.
129
+ Use the shared contract in the [datetime variable workflow](variables.md#absolute-and-relative-datetime-ranges),
130
+ including optional previous-period comparison. Calendar-only views share it with
131
+ `calendar.parseRequest()` and `defineTimeView()`.
@@ -43,3 +43,40 @@ reset the allowance. Callback resolution means acceptance, not agent execution.
43
43
  Omit `onRepairRequest` when delivery or reliable state retention is unavailable;
44
44
  the banner offers diagnostics to copy instead. Avoid sensitive values in errors.
45
45
  Source locations use generated filenames and positions.
46
+
47
+ ## Custom banners
48
+
49
+ Use `session.snapshot()` to read diagnostics, delivery status, the automatic
50
+ request count, and the latest request's start time. Subscribe with
51
+ `session.subscribe()` and request a fix with `session.requestRepair()`. These APIs
52
+ work without React or the default banner.
53
+
54
+ In React, pass the snapshot to your own banner:
55
+
56
+ ```tsx
57
+ import type { DataAppRepairSession } from '@altertable/data-app-embed';
58
+ import { useSyncExternalStore } from 'react';
59
+
60
+ import { RepairBanner } from './RepairBanner';
61
+
62
+ function AppRepair({ session }: { session: DataAppRepairSession }) {
63
+ const repair = useSyncExternalStore(
64
+ listener => session.subscribe(listener),
65
+ session.snapshot,
66
+ session.snapshot
67
+ );
68
+
69
+ return (
70
+ <RepairBanner
71
+ repair={repair}
72
+ onRequestRepair={() => void session.requestRepair()}
73
+ />
74
+ );
75
+ }
76
+ ```
77
+
78
+ The host owns agent activity and revision loading. Request acceptance does not
79
+ mean the agent has started or finished. Clear the previous attempt's activity
80
+ when requesting another fix, and clear progress when the updated revision's
81
+ diagnostics settle. Custom banners choose their own presentation; the default
82
+ `<DataAppRepairBanner>` accepts observed host activity through `progress`.
package/docs/embed.md CHANGED
@@ -86,6 +86,44 @@ Host Back/Forward events publish opaque host state through the bridge. The app's
86
86
  optional navigation adapter interprets search/hash and synchronizes controls;
87
87
  opaque apps keep that state in memory rather than modifying their document URL.
88
88
 
89
+ ## External links
90
+
91
+ Register the external link route to let apps request HTTPS navigation without
92
+ relaxing the iframe sandbox:
93
+
94
+ ```ts
95
+ import {
96
+ createMessageRouter,
97
+ openExternalLinkRoute,
98
+ } from '@altertable/data-app/contract';
99
+ import { createExternalLinkHandler } from '@altertable/data-app-embed';
100
+
101
+ const router = createMessageRouter(
102
+ { 'navigation:openExternal': openExternalLinkRoute },
103
+ {
104
+ 'navigation:openExternal': createExternalLinkHandler({
105
+ allowedOrigins: ['https://example.com'],
106
+ }),
107
+ }
108
+ );
109
+ // Pass router.dispatch as the bridge's onMessage handler.
110
+ ```
111
+
112
+ To use an existing modifier-based host navigation helper, register it directly:
113
+
114
+ ```ts
115
+ const openExternalLink = createExternalLinkHandler({
116
+ navigate: navigateNewWindowOrTab,
117
+ });
118
+ // Register openExternalLink for navigation:openExternal in the host router.
119
+ ```
120
+
121
+ Here `navigateNewWindowOrTab` is the host's `(url, event)` navigation helper.
122
+ Use the frontend helper, not the app-side bridge client with the same name.
123
+
124
+ Choose permitted origins according to the host's data policy: URLs can carry app
125
+ data, and the initial origin check does not constrain redirects at the destination.
126
+
89
127
  ## Status and diagnostics
90
128
 
91
129
  `onStatusChange` receives `connecting`, `connected`, `ready`, `failed`, or
@@ -1,6 +1,8 @@
1
1
  # Author a data app
2
2
 
3
- Follow the [shared authoring flow](app-authoring.md) with the version-matched `starter-data-app/index.tsx` for a hosted / remote / cloud data app. Keep the app in
3
+ Follow the [SDK integration guide](app-authoring.md) with a version-matched hosted
4
+ starter selected by the authoring workflow. The shared starter
5
+ is `starter-data-app/index.tsx`; its sample content is replaceable. Keep the app in
4
6
  one file with public package imports; omit server files, HTML, credentials, and
5
7
  relative or app-alias imports.
6
8
 
@@ -13,15 +15,16 @@ interpolation), finite signed numbers, booleans, and null. Parentheses, `as`, an
13
15
  computed keys, references, and callbacks. Static apps use `queries: {}`.
14
16
 
15
17
  Replace sample queries and bindings with inspected source data. Supply `scope`
16
- in `defineDataApp()` and `story` and `datasets` on `<DataApp>`.
18
+ in `defineDataApp()`. When using bound `<DataApp>`, follow its current
19
+ [story and dataset requirements](stories-and-export.md).
17
20
 
18
21
  Keep the starter's client, style injection, and mounting code. The host supplies
19
22
  the transport; no bootstrap or message routes are needed in app code.
20
23
 
21
24
  ## Convert a local data app
22
25
 
23
- 1. Combine the app's operations and parsers, data context, views, story,
24
- CSV export, app declaration, and browser entry into one `index.tsx`, following the
26
+ 1. Combine the app's operations and parsers, data context, views, any presentation
27
+ and export features, app declaration, and browser entry into one `index.tsx`, following the
25
28
  [single-file starter](app-authoring.md#use-release-matched-starters).
26
29
  2. Replace the HTTP client with `createDataClient({ operations })`, using the
27
30
  operation registry as a value. See [browser-owned operations](client.md#browser-owned-operations-for-bundle-apps)
@@ -2,8 +2,9 @@
2
2
 
3
3
  Use the local scaffold supplied by your authoring workflow. Its README covers
4
4
  setup and its AGENTS.md identifies app-owned files.
5
- Replace the connectivity screen with the exploration, CSV export, and story from the
6
- [shared authoring flow](app-authoring.md).
5
+ Replace the connectivity screen or fixture examples with the content specified by
6
+ the app brief, using the [shared SDK patterns](app-authoring.md). Local execution
7
+ does not require a particular content structure or presentation story.
7
8
 
8
9
  | Task | Documentation |
9
10
  | ---------------------------- | ---------------------------------------- |
@@ -12,3 +13,17 @@ Replace the connectivity screen with the exploration, CSV export, and story from
12
13
  | Customize the browser client | [HTTP client](client.md#http-operations) |
13
14
 
14
15
  You can also [convert the local app to a hosted data app](hosted-apps.md#convert-a-local-data-app).
16
+
17
+ ## Preview the use-case starters
18
+
19
+ From the SDK repository, run `bun run dev:gallery` with Docker available. It starts
20
+ and seeds the Altertable mock with fictional sample data.
21
+
22
+ | Starter | Hosted preview | Local preview |
23
+ | ------- | ------------------------------------------------- | ------------------------ |
24
+ | Metric | <http://127.0.0.1:27418/starter-metric-data-app> | <http://127.0.0.1:27421> |
25
+ | Finding | <http://127.0.0.1:27418/starter-finding-data-app> | <http://127.0.0.1:27422> |
26
+
27
+ Copied starters use the normal query connection. Replace their example queries
28
+ with verified sources in the target lakehouse; the mock and seed belong only to
29
+ local development. Never create demo objects in a user's lakehouse.
package/docs/react.md CHANGED
@@ -15,9 +15,12 @@ mountDataApp({ app: dataApp, component: App });
15
15
 
16
16
  The app supplies `dataApp`, `App`, and a `#root` element.
17
17
 
18
- Keep the starter's mounting and client wiring. Use declared views and bound
19
- widgets for exploration. Use `/ui` for setup/static screens or a custom component
20
- only when bound components cannot express the requirement.
18
+ Keep the selected starter's mounting and client wiring. The
19
+ app brief selects the starter and content structure; the available runtime
20
+ starters are listed in [app authoring](app-authoring.md#use-release-matched-starters).
21
+ Use declared views and bound widgets for data-backed content. Use `/ui` for
22
+ setup/static screens or a custom component only when bound components cannot
23
+ express the requirement.
21
24
 
22
25
  Hosts embedding an app use the separate `@altertable/data-app-embed` package;
23
26
  that integration is outside ordinary app authoring.
@@ -1,8 +1,16 @@
1
1
  # Stories and CSV export
2
2
 
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.
3
+ The bound `<DataApp>` from `@altertable/data-app-react` accepts an optional `story`
4
+ callback and optional nonempty `datasets` list. Omit either prop to omit its toolbar
5
+ control. Supplied features use the displayed snapshot, including during refresh or
6
+ failure. A story callback returning `[]` leaves a disabled presentation action.
7
+ Set `showToolbar={false}` to omit page actions together; data loading, error states,
8
+ and declared filters remain available. Setup and static screens can use `<DataApp>`
9
+ from `/ui`.
10
+
11
+ These are component contracts. The app brief determines the
12
+ intended presentation and export coverage. A presentation story is distinct from
13
+ explanatory prose in the app body.
6
14
 
7
15
  ## Present data with stories
8
16
 
@@ -41,8 +49,9 @@ Keep the starter's `formatMetric()` import for formatted headlines.
41
49
  ## Export displayed data as CSV
42
50
 
43
51
  Declare [datasets](widgets.md#declare-datasets-and-metrics) once and pass
44
- `datasets={[sampleCounts]}`. Include every distinct displayed dataset
45
- at its displayed grain; reuse a dataset for visuals sharing the same rows.
52
+ `datasets={[sampleCounts]}`. This list determines which datasets are available
53
+ for export, using their bound rows and columns. Preserve the displayed grain;
54
+ reuse a dataset for visuals sharing the same rows.
46
55
 
47
56
  One dataset downloads as CSV; multiple datasets offer individual downloads and
48
57
  **Export all** as ZIP. Filenames use the displayed scope. Accessors must return
@@ -1,7 +1,8 @@
1
1
  # UI quality
2
2
 
3
- Lead with a supported finding and visible scope. Explain each chart's purpose,
4
- measures, units, and source evidence. Use package typography and formatters;
3
+ Make the main result easy to identify and compare. Make its scope, units, and
4
+ supporting evidence explicit, using context supplied by the host where available
5
+ instead of repeating it. Explain each chart's purpose and measures. Use package typography and formatters;
5
6
  keep primary values prominent and preserve exact values in records and exports.
6
7
 
7
8
  Compose with `<Stack>`, `<Grid>`, and `<TextContent>`; parents own spacing and