You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -782,7 +782,7 @@ These methods restrict which options users can select. They apply identically wh
782
782
| --- | --- | --- | --- |
783
783
|`.xAxis(fn)`| Restrict available X-axis columns | Callback receiving a `SelectableControlBuilder`| Only date/category/boolean column IDs are offered |
784
784
|`.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 |
786
786
|`.metric(fn)`| Restrict available metrics | Callback receiving a `MetricBuilder` (see below) | Only numeric column IDs are offered for aggregates |
787
787
|`.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'`|
788
788
|`.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
801
801
802
802
| Method | What it does | Parameters | Type safety |
803
803
| --- | --- | --- | --- |
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|
808
808
|`.defaultCount()`| Set count as the fallback metric | — | Compile error if count is not visible |
809
809
|`.defaultAggregate(col, agg)`| Set a specific aggregation as fallback | Column ID, single aggregation function | Must be visible (allowed and not hidden) |
810
810
@@ -827,9 +827,9 @@ These methods restrict which options users can select. They apply identically wh
827
827
| Method | What it does | Parameters | Type safety |
828
828
| --- | --- | --- | --- |
829
829
|`.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|
833
833
|`.grain(id)`| Declare the output row grain | Grain identifier string | Required when the grain changes (e.g. after `.throughAssociation()`) |
834
834
|`.chart(id?)`| Open the chart-control surface for the materialized view | Optional chart ID | Returns a standard `DatasetChartBuilder` over the flattened row type |
835
835
|`.materialize(data)`| Execute the materialization and return flat rows | Object with all dataset arrays | Returns typed flat rows |
0 commit comments