@altertable/data-app 0.78.0 → 0.79.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.
- package/AGENTS.md +3 -0
- package/CONTRIBUTING.md +2 -1
- package/REFERENCE.md +34 -152
- package/dist/chunks/{contract-gu1rDsV0.js → contract-BTG-BUwW.js} +7 -6
- package/dist/chunks/{contract-gu1rDsV0.js.map → contract-BTG-BUwW.js.map} +1 -1
- package/dist/chunks/{data-client-BMdL73Ab.js → data-client-C4Pay-UE.js} +3 -3
- package/dist/chunks/{data-client-BMdL73Ab.js.map → data-client-C4Pay-UE.js.map} +1 -1
- package/dist/chunks/{diagnostics-CX9SsU79.js → diagnostics-BwpM9wGn.js} +2 -2
- package/dist/chunks/{diagnostics-CX9SsU79.js.map → diagnostics-BwpM9wGn.js.map} +1 -1
- package/dist/client/index.js +3 -3
- package/dist/core/config.js +3 -2
- package/dist/core/config.js.map +1 -1
- package/dist/core/contract.js +1 -1
- package/dist/internal.js +2 -2
- package/dist/types/chunks/contract.d.ts +6 -1
- package/dist/types/core/config.d.ts +3 -0
- package/docs/app-authoring.md +160 -76
- package/docs/contract.md +16 -15
- package/docs/data-context.md +7 -10
- package/docs/filters.md +10 -12
- package/docs/formatting-and-appearance.md +2 -5
- package/docs/hosted-apps.md +2 -2
- package/docs/local-data-apps.md +5 -1
- package/docs/react.md +1 -3
- package/docs/stories-and-export.md +1 -2
- package/docs/ui.md +25 -7
- package/docs/views.md +6 -8
- package/docs/widgets.md +7 -8
- package/package.json +1 -1
package/docs/views.md
CHANGED
|
@@ -21,7 +21,6 @@ const { defineView } = createDataHooks(client);
|
|
|
21
21
|
const sampleCountsView = defineView({
|
|
22
22
|
dataContext: sampleDataContext,
|
|
23
23
|
operation: 'sampleCountsByGroup',
|
|
24
|
-
isEmpty: rows => rows.length === 0,
|
|
25
24
|
emptyFallback: { title: 'No matching groups' },
|
|
26
25
|
});
|
|
27
26
|
// ... sampleCounts dataset and story callback
|
|
@@ -56,7 +55,6 @@ const { defineView } = createDataHooks(client);
|
|
|
56
55
|
const sampleCountsView = defineView({
|
|
57
56
|
dataContext: sampleDataContext,
|
|
58
57
|
operation: 'sampleCountsByGroup',
|
|
59
|
-
isEmpty: rows => rows.length === 0,
|
|
60
58
|
emptyFallback: { title: 'No matching groups' },
|
|
61
59
|
});
|
|
62
60
|
const sampleTotalView = defineView({
|
|
@@ -92,8 +90,10 @@ refresh or failure. Use `result.scope` in content and `view.scope(snapshot)` in
|
|
|
92
90
|
stories. Let views and bound widgets own request state and loading feedback.
|
|
93
91
|
Keep static introductions outside loading boundaries.
|
|
94
92
|
|
|
95
|
-
A measured zero is valid data.
|
|
96
|
-
|
|
93
|
+
A measured zero is valid data. A view whose operation returns no rows is empty;
|
|
94
|
+
give it useful `emptyFallback` copy. Set `isEmpty` for any other result that can
|
|
95
|
+
be empty, such as a nullable summary, and omit both for one that never is, such
|
|
96
|
+
as a total.
|
|
97
97
|
|
|
98
98
|
## Detail destinations
|
|
99
99
|
|
|
@@ -111,16 +111,14 @@ const groupView = defineDetailView({
|
|
|
111
111
|
dataContext: sampleDataContext,
|
|
112
112
|
parseInput: operations.sampleCountsByGroup.input,
|
|
113
113
|
describeInput: ({ groupName }) => `group ${groupName}`,
|
|
114
|
-
isEmpty: rows => rows.length === 0,
|
|
115
114
|
emptyFallback: { title: 'No matching group' },
|
|
116
115
|
});
|
|
117
116
|
const groupCounts = groupView.dataset({
|
|
118
117
|
name: 'Group counts',
|
|
119
|
-
select: rows => rows,
|
|
120
118
|
rowKey: row => row.groupName,
|
|
121
119
|
columns: {
|
|
122
|
-
groupName: {
|
|
123
|
-
sampleCount: {
|
|
120
|
+
groupName: {},
|
|
121
|
+
sampleCount: { format: { kind: 'count' } },
|
|
124
122
|
},
|
|
125
123
|
evidence: { id: 'group-counts', glossaryIds: ['sampleCount'] },
|
|
126
124
|
});
|
package/docs/widgets.md
CHANGED
|
@@ -61,12 +61,11 @@ only when the view's operation reads a `dateTimeRangeFilter()` with
|
|
|
61
61
|
// ... sampleCountsView, sampleTotalView, and imports
|
|
62
62
|
const sampleCounts = sampleCountsView.dataset({
|
|
63
63
|
name: 'Sample counts',
|
|
64
|
-
select: rows => rows,
|
|
65
64
|
rowKey: row => row.groupName,
|
|
66
65
|
evidence: { id: 'counts-by-group', glossaryIds: ['sampleCount'] },
|
|
67
66
|
columns: {
|
|
68
|
-
groupName: { label: 'Group'
|
|
69
|
-
sampleCount: {
|
|
67
|
+
groupName: { label: 'Group' },
|
|
68
|
+
sampleCount: { format: { kind: 'count' } },
|
|
70
69
|
},
|
|
71
70
|
});
|
|
72
71
|
const totalSamples = sampleTotalView.metric(
|
|
@@ -106,8 +105,11 @@ const countsContent = sampleCountsView.content(result => (
|
|
|
106
105
|
Render each content in its own `<DataSection>`.
|
|
107
106
|
|
|
108
107
|
Column keys supply IDs and default labels; set `label` for a different header.
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
A column named after a row field reads that field. Set `value` for a computed
|
|
109
|
+
column, such as `{ value: row => row.revenue / row.orders }`, and `select` when
|
|
110
|
+
the operation returns an object rather than its rows, such as
|
|
111
|
+
`select: summary => summary.rows`. Keep row keys stable and unique. Custom cells
|
|
112
|
+
use `format: row => ...`; CSV exports the raw value. Metric comparisons require that reporting period.
|
|
111
113
|
Reuse bindings in stories with the snapshot of the view that owns them.
|
|
112
114
|
|
|
113
115
|
Tables search and paginate only supplied rows. Use query-backed pagination with a
|
|
@@ -144,9 +146,6 @@ The dataset owns evidence and empty copy; an empty row selection shows that fall
|
|
|
144
146
|
alternate-view selection shared with its inspection sheet. Give views stable IDs
|
|
145
147
|
and keep interactive state above the widget, since inspection may render it again.
|
|
146
148
|
|
|
147
|
-
Use custom controls, tables, or overlays only when bound components cannot
|
|
148
|
-
express the requirement; see [direct UI composition](ui.md).
|
|
149
|
-
|
|
150
149
|
## Exploration actions
|
|
151
150
|
|
|
152
151
|
Declare actions on their dataset or metric and pass them to its widget. A detail
|
package/package.json
CHANGED