@smallwebco/tinypivot-react 1.0.83 → 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 +38 -0
- package/dist/index.cjs +868 -495
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -5
- package/dist/index.d.ts +21 -5
- package/dist/index.js +860 -487
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -152,6 +152,8 @@ export function MyGrid({ data }) {
|
|
|
152
152
|
| Pivot table with Sum aggregation | ✅ | ✅ |
|
|
153
153
|
| Row/column totals | ✅ | ✅ |
|
|
154
154
|
| Calculated fields with formulas | ✅ | ✅ |
|
|
155
|
+
| Pivot row group expand/collapse | ✅ | ✅ |
|
|
156
|
+
| **Pivot drill-through** (double-click to inspect source rows) | ❌ | ✅ |
|
|
155
157
|
| **AI Data Analyst** (natural language, BYOK) | ❌ | ✅ |
|
|
156
158
|
| **Chart Builder** (6 chart types) | ❌ | ✅ |
|
|
157
159
|
| Advanced aggregations (Count, Avg, Min, Max, Unique, Median, Std Dev, %) | ❌ | ✅ |
|
|
@@ -175,6 +177,8 @@ export function MyGrid({ data }) {
|
|
|
175
177
|
| `numberFormat` | `'us' \| 'eu' \| 'plain'` | `'us'` | Number display format: US (1,234.56), EU (1.234,56), plain (1234.56) |
|
|
176
178
|
| `dateFormat` | `'us' \| 'eu' \| 'iso'` | `'iso'` | Date display format: US (MM/DD/YYYY), EU (DD/MM/YYYY), ISO (YYYY-MM-DD) |
|
|
177
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) |
|
|
178
182
|
|
|
179
183
|
## Callbacks
|
|
180
184
|
|
|
@@ -184,6 +188,40 @@ export function MyGrid({ data }) {
|
|
|
184
188
|
| `onSelectionChange` | `(payload) => void` | Selection changed |
|
|
185
189
|
| `onExport` | `(payload) => void` | CSV exported |
|
|
186
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
|
+
```
|
|
187
225
|
|
|
188
226
|
## AI Data Analyst (Pro)
|
|
189
227
|
|