@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/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. Set `isEmpty` and useful `emptyFallback` copy when
96
- a result can be empty; omit both when it never is, such as a total.
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: { value: row => row.groupName },
123
- sampleCount: { value: row => row.sampleCount, format: { kind: 'count' } },
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', value: row => row.groupName },
69
- sampleCount: { value: row => row.sampleCount, format: { kind: 'count' } },
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
- Keep row keys stable and unique. Custom cells use `format: row => ...`; CSV uses
110
- the raw `value` accessor. Metric comparisons require that reporting period.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altertable/data-app",
3
- "version": "0.78.0",
3
+ "version": "0.79.0",
4
4
  "description": "Portable definitions, contracts, formatting, browser clients, and request handlers for Altertable data apps.",
5
5
  "keywords": [
6
6
  "altertable",