@smallwebco/tinypivot-react 1.0.81 → 1.1.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/README.md CHANGED
@@ -4,6 +4,8 @@ A lightweight data grid with free pivot tables, Pro charts, and optional AI-powe
4
4
 
5
5
  **[Live Demo](https://tiny-pivot.com)** · **[Buy License](https://tiny-pivot.com/#pricing)**
6
6
 
7
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/Small-Web-Co/tinypivot/tree/master/examples/stackblitz-react)
8
+
7
9
  ## Why TinyPivot?
8
10
 
9
11
  - **Lightweight**: Under 40KB gzipped vs 500KB+ for AG Grid
@@ -150,6 +152,8 @@ export function MyGrid({ data }) {
150
152
  | Pivot table with Sum aggregation | ✅ | ✅ |
151
153
  | Row/column totals | ✅ | ✅ |
152
154
  | Calculated fields with formulas | ✅ | ✅ |
155
+ | Pivot row group expand/collapse | ✅ | ✅ |
156
+ | **Pivot drill-through** (double-click to inspect source rows) | ❌ | ✅ |
153
157
  | **AI Data Analyst** (natural language, BYOK) | ❌ | ✅ |
154
158
  | **Chart Builder** (6 chart types) | ❌ | ✅ |
155
159
  | Advanced aggregations (Count, Avg, Min, Max, Unique, Median, Std Dev, %) | ❌ | ✅ |
@@ -173,6 +177,8 @@ export function MyGrid({ data }) {
173
177
  | `numberFormat` | `'us' \| 'eu' \| 'plain'` | `'us'` | Number display format: US (1,234.56), EU (1.234,56), plain (1234.56) |
174
178
  | `dateFormat` | `'us' \| 'eu' \| 'iso'` | `'iso'` | Date display format: US (MM/DD/YYYY), EU (DD/MM/YYYY), ISO (YYYY-MM-DD) |
175
179
  | `fieldRoleOverrides` | `Record<string, FieldRole>` | `undefined` | Override auto-detected chart field roles per column (`'dimension'` \| `'measure'` \| `'temporal'`) |
180
+ | `enableDrillDown` | `boolean` | `true` | Enable pivot row group expand/collapse chevrons |
181
+ | `enableDrillThrough` | `boolean` | `true` | Enable double-click drill-through on pivot cells (Pro feature) |
176
182
 
177
183
  ## Callbacks
178
184
 
@@ -182,6 +188,40 @@ export function MyGrid({ data }) {
182
188
  | `onSelectionChange` | `(payload) => void` | Selection changed |
183
189
  | `onExport` | `(payload) => void` | CSV exported |
184
190
  | `onCopy` | `(payload) => void` | Cells copied |
191
+ | `onCollapseChange` | `(collapsedPaths: string[]) => void` | Pivot row groups collapsed/expanded |
192
+ | `onDrillThrough` | `(result: DrillThroughResult) => void` | Pivot cell double-clicked and drill-through modal opened (Pro) |
193
+
194
+ ## Pivot Drill-Down
195
+
196
+ ### Row Group Expand/Collapse (Free)
197
+
198
+ When a pivot has two or more row fields, each group row displays a `▸`/`▾` chevron. Click to collapse or expand that group. Alt-click collapses/expands every group at the same depth. Collapsed groups still show correct aggregated values over all rows in the group.
199
+
200
+ ```tsx
201
+ <DataGrid
202
+ data={data}
203
+ onCollapseChange={(collapsedPaths) => console.log('Collapsed:', collapsedPaths)}
204
+ />
205
+ ```
206
+
207
+ ### Drill-Through to Source Rows (Pro)
208
+
209
+ Double-click any pivot value cell (including totals) to open a modal with the underlying source rows. Includes a slice description header, paginated table (50/page), and CSV export. Requires a Pro license.
210
+
211
+ ```tsx
212
+ <DataGrid
213
+ data={data}
214
+ onDrillThrough={({ rows, descriptor }) =>
215
+ console.log(`${descriptor.rowCount} rows for ${descriptor.rowPath.join(' > ')}`)
216
+ }
217
+ />
218
+ ```
219
+
220
+ Disable either behaviour individually:
221
+
222
+ ```tsx
223
+ <DataGrid data={data} enableDrillDown={false} enableDrillThrough={false} />
224
+ ```
185
225
 
186
226
  ## AI Data Analyst (Pro)
187
227