Skip to content

Commit d8dfb16

Browse files
docs(README): update filter and aggregation method descriptions for clarity
- Revised descriptions for `.filters(fn)`, `.count()`, `.aggregate(col, ...aggs)`, `.hideCount()`, and `.hideAggregate(col, ...aggs)` methods to clarify their functionality and type safety. - Adjusted terminology to emphasize whitelisting behavior for metrics and aggregations, enhancing understanding for developers.
1 parent cf19a37 commit d8dfb16

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ These methods restrict which options users can select. They apply identically wh
782782
| --- | --- | --- | --- |
783783
| `.xAxis(fn)` | Restrict available X-axis columns | Callback receiving a `SelectableControlBuilder` | Only date/category/boolean column IDs are offered |
784784
| `.groupBy(fn)` | Restrict available grouping columns | Callback receiving a `SelectableControlBuilder` | Only category/boolean column IDs are offered |
785-
| `.filters(fn)` | Restrict available filter columns | Callback receiving a `SelectableControlBuilder` (no `.default()`) | Only filterable column IDs are offered |
785+
| `.filters(fn)` | Restrict available filter columns | Callback receiving a `SelectableControlBuilder` (no `.default()`) | Only category/boolean column IDs are offered |
786786
| `.metric(fn)` | Restrict available metrics | Callback receiving a `MetricBuilder` (see below) | Only numeric column IDs are offered for aggregates |
787787
| `.chartType(fn)` | Restrict available chart types | Callback receiving a `SelectableControlBuilder` | Values narrowed to `'bar' \| 'grouped-bar' \| 'percent-bar' \| 'line' \| 'area' \| 'percent-area' \| 'pie' \| 'donut' \| 'table'` |
788788
| `.timeBucket(fn)` | Restrict available time bucket intervals | Callback receiving a `SelectableControlBuilder` | Values narrowed to `'year' \| 'quarter' \| 'month' \| 'week' \| 'day'` |
@@ -801,10 +801,10 @@ These methods restrict which options users can select. They apply identically wh
801801

802802
| Method | What it does | Parameters | Type safety |
803803
| --- | --- | --- | --- |
804-
| `.count()` | Enable the row-count metric |||
805-
| `.aggregate(col, ...aggs)` | Enable numeric aggregations | Column ID, one or more of `'sum' \| 'avg' \| 'min' \| 'max'` | Column must be a `number` column |
806-
| `.hideCount()` | Hide the count metric from the UI || Compile error if count was not added |
807-
| `.hideAggregate(col, ...aggs)` | Hide specific aggregations | Column ID, aggregation functions | Can only hide what was previously allowed |
804+
| `.count()` | Whitelist the row-count metric (without this or `.aggregate()`, all metrics are available by default) |||
805+
| `.aggregate(col, ...aggs)` | Whitelist specific numeric aggregations | Column ID, one or more of `'sum' \| 'avg' \| 'min' \| 'max'` | Column must be a `number` column |
806+
| `.hideCount()` | Hide count from the default set without whitelisting || Compile error if count was explicitly whitelisted and then hidden |
807+
| `.hideAggregate(col, ...aggs)` | Hide specific aggregations from the default set without whitelisting | Column ID, aggregation functions | Can only hide metrics that are visible |
808808
| `.defaultCount()` | Set count as the fallback metric || Compile error if count is not visible |
809809
| `.defaultAggregate(col, agg)` | Set a specific aggregation as fallback | Column ID, single aggregation function | Must be visible (allowed and not hidden) |
810810

@@ -827,9 +827,9 @@ These methods restrict which options users can select. They apply identically wh
827827
| Method | What it does | Parameters | Type safety |
828828
| --- | --- | --- | --- |
829829
| `.from(datasetId)` | Set the base dataset (determines the starting grain) | Dataset ID | Must be a registered dataset |
830-
| `.join(alias, config)` | Lookup join (preserves grain) | Alias string, `{ relationship }` | Relationship must exist in the model |
831-
| `.throughAssociation(alias, config)` | Expand rows through a many-to-many | Alias string, `{ association }` | Association must exist in the model |
832-
| `.columns(...)` | Project specific columns from a joined/expanded dataset | Column IDs | Only chart-visible columns from the target dataset |
830+
| `.join(alias, config)` | Lookup join (preserves grain) | Alias string, `{ relationship, columns? }` | Relationship must exist in the model; optional `columns` projects specific fields |
831+
| `.throughRelationship(alias, config)` | Expand rows through a one-to-many relationship | Alias string, `{ relationship, columns? }` | Relationship must exist in the model |
832+
| `.throughAssociation(alias, config)` | Expand rows through a many-to-many association | Alias string, `{ association, columns? }` | Association must exist in the model |
833833
| `.grain(id)` | Declare the output row grain | Grain identifier string | Required when the grain changes (e.g. after `.throughAssociation()`) |
834834
| `.chart(id?)` | Open the chart-control surface for the materialized view | Optional chart ID | Returns a standard `DatasetChartBuilder` over the flattened row type |
835835
| `.materialize(data)` | Execute the materialization and return flat rows | Object with all dataset arrays | Returns typed flat rows |

0 commit comments

Comments
 (0)