@smallwebco/tinypivot-react 1.0.71 → 1.0.73
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 +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ export default function App() {
|
|
|
80
80
|
| `theme` | `'light' \| 'dark' \| 'auto'` | `'light'` | Color theme |
|
|
81
81
|
| `numberFormat` | `'us' \| 'eu' \| 'plain'` | `'us'` | Number display format: US (1,234.56), EU (1.234,56), plain (1234.56) |
|
|
82
82
|
| `dateFormat` | `'us' \| 'eu' \| 'iso'` | `'iso'` | Date display format: US (MM/DD/YYYY), EU (DD/MM/YYYY), ISO (YYYY-MM-DD) |
|
|
83
|
+
| `fieldRoleOverrides` | `Record<string, FieldRole>` | `undefined` | Override auto-detected chart field roles per column (`'dimension'` \| `'measure'` \| `'temporal'`) |
|
|
83
84
|
|
|
84
85
|
## Callbacks
|
|
85
86
|
|
package/dist/index.cjs
CHANGED
|
@@ -1494,12 +1494,13 @@ var Chart = import_react4.default.lazy(() => import("react-apexcharts"));
|
|
|
1494
1494
|
function ChartBuilder({
|
|
1495
1495
|
data,
|
|
1496
1496
|
theme = "light",
|
|
1497
|
+
fieldRoleOverrides,
|
|
1497
1498
|
onConfigChange
|
|
1498
1499
|
}) {
|
|
1499
1500
|
const [chartConfig, setChartConfig] = (0, import_react4.useState)((0, import_tinypivot_core4.createDefaultChartConfig)());
|
|
1500
1501
|
const [draggingField, setDraggingField] = (0, import_react4.useState)(null);
|
|
1501
1502
|
const [dragOverZone, setDragOverZone] = (0, import_react4.useState)(null);
|
|
1502
|
-
const fieldInfos = (0, import_react4.useMemo)(() => (0, import_tinypivot_core4.analyzeFieldsForChart)(data), [data]);
|
|
1503
|
+
const fieldInfos = (0, import_react4.useMemo)(() => (0, import_tinypivot_core4.analyzeFieldsForChart)(data, fieldRoleOverrides), [data, fieldRoleOverrides]);
|
|
1503
1504
|
const dimensions = (0, import_react4.useMemo)(
|
|
1504
1505
|
() => fieldInfos.filter((f) => f.role === "dimension" || f.role === "temporal"),
|
|
1505
1506
|
[fieldInfos]
|
|
@@ -5030,6 +5031,7 @@ function DataGrid({
|
|
|
5030
5031
|
maxHeight = 1200,
|
|
5031
5032
|
numberFormat = "us",
|
|
5032
5033
|
dateFormat = "iso",
|
|
5034
|
+
fieldRoleOverrides,
|
|
5033
5035
|
aiAnalyst,
|
|
5034
5036
|
onCellClick,
|
|
5035
5037
|
onExport,
|
|
@@ -6192,6 +6194,7 @@ function DataGrid({
|
|
|
6192
6194
|
{
|
|
6193
6195
|
data: filteredDataForPivot,
|
|
6194
6196
|
theme: currentTheme,
|
|
6197
|
+
fieldRoleOverrides,
|
|
6195
6198
|
onConfigChange: handleChartConfigChange
|
|
6196
6199
|
}
|
|
6197
6200
|
)
|