serverside_pivot 0.0.90 → 0.0.91
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 +152 -135
- package/dist/react/chunks/{DetailDrawer-DtsvdhO4.mjs → DetailDrawer-Eb4EpVHG.mjs} +1 -1
- package/dist/react/chunks/{DetailSidePanel-v_7iU73g.mjs → DetailSidePanel-BTcHOiKr.mjs} +1 -1
- package/dist/react/chunks/{DetailSurfaceContent-BOXVc58A.mjs → DetailSurfaceContent-B3ZNKh7q.mjs} +1 -1
- package/dist/react/chunks/{ECharts2dRenderer-BGL_NVGU.mjs → ECharts2dRenderer-C3Qv0uAa.mjs} +1 -1
- package/dist/react/chunks/{ECharts3dRenderer-BF2YWlsP.mjs → ECharts3dRenderer-BB_7-fOt.mjs} +1 -1
- package/dist/react/chunks/{EditSidePanel-CuvtsKTK.mjs → EditSidePanel-C2cAvxlK.mjs} +1 -1
- package/dist/react/chunks/{InlineDetailPanel-Bmtlu3lc.mjs → InlineDetailPanel-BXLAw1o3.mjs} +1 -1
- package/dist/react/chunks/{PivotCharts-CA3_0bB8.mjs → PivotCharts-Bw6Swoa3.mjs} +3 -3
- package/dist/react/chunks/{ReportEditor-DYBr0HDz.mjs → ReportEditor-D4V0ry2B.mjs} +1 -1
- package/dist/react/chunks/{SidebarPanel-B64bhrUW.mjs → SidebarPanel-xO59p_2o.mjs} +2 -2
- package/dist/react/chunks/{SparklineDetailGraph-90WjWkhg.mjs → SparklineDetailGraph-Bu85X7OJ.mjs} +1 -1
- package/dist/react/chunks/{installCanvasRenderer-C8gE9ttC.mjs → installCanvasRenderer-B7sfDGoL.mjs} +1 -1
- package/dist/react/chunks/react-CPZZxtSo.mjs +26999 -0
- package/dist/react/chunks/{xlsx.mini.min-BwwnBtoK.mjs → xlsx.mini.min-vfxHk3Ry.mjs} +1 -1
- package/dist/react/components/DashTanstackPivot.react.d.ts +7 -0
- package/dist/react/components/PivotWorkspace.d.ts +1 -1
- package/dist/react/hooks/usePivotNormalization.d.ts +11 -1
- package/dist/react/index.mjs +14 -6
- package/dist/react/react.d.ts +1 -0
- package/dist/react/runtime/client/clientPivotTransport.d.ts +28 -0
- package/dist/react/runtime/client/clientResponsePostProcessor.d.ts +20 -0
- package/dist/react/runtime/client/clientSqlPlanner.d.ts +5 -0
- package/dist/react/runtime/client/duckdbWasmExecutor.d.ts +36 -0
- package/dist/react/runtime/client/index.d.ts +6 -0
- package/dist/react/runtime/client/modeResolver.d.ts +16 -0
- package/dist/react/runtime/client/types.d.ts +202 -0
- package/dist/react/runtime/useRuntimeStructuralSync.d.ts +4 -1
- package/package.json +28 -3
- package/dist/react/chunks/react-52jgz-em.mjs +0 -25301
|
@@ -286,6 +286,13 @@ declare namespace DashTanstackPivot {
|
|
|
286
286
|
rowOverscan: PropTypes.Requireable<number>;
|
|
287
287
|
columnOverscan: PropTypes.Requireable<number>;
|
|
288
288
|
prefetchColumns: PropTypes.Requireable<number>;
|
|
289
|
+
executionMode: PropTypes.Requireable<string>;
|
|
290
|
+
clientEngine: PropTypes.Requireable<string>;
|
|
291
|
+
duckdbWasmThreshold: PropTypes.Requireable<number>;
|
|
292
|
+
clientRowThreshold: PropTypes.Requireable<number>;
|
|
293
|
+
dataUrl: PropTypes.Requireable<string>;
|
|
294
|
+
duckdbWasmCdnUrl: PropTypes.Requireable<string>;
|
|
295
|
+
legacyClientTable: PropTypes.Requireable<boolean>;
|
|
289
296
|
}>>;
|
|
290
297
|
chartServerWindow: PropTypes.Requireable<PropTypes.InferProps<{
|
|
291
298
|
enabled: PropTypes.Requireable<boolean>;
|
|
@@ -6,7 +6,7 @@ import type { PivotRuntimeProps } from '../runtime/runtimeDomains';
|
|
|
6
6
|
* to emulate Dash's callback graph or serialize row blocks through its state.
|
|
7
7
|
*/
|
|
8
8
|
export interface PivotWorkspaceProps extends Omit<PivotRuntimeProps, 'setProps' | 'runtimeRequest' | 'runtimeResponse'> {
|
|
9
|
-
readonly transport
|
|
9
|
+
readonly transport?: PivotTransport;
|
|
10
10
|
readonly onStateChange?: (state: Readonly<Partial<PivotRuntimeProps>>) => void;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -31,6 +31,8 @@ export const SOFT_CENTER_COLUMN_WARNING_THRESHOLD: 2000;
|
|
|
31
31
|
export const HARD_CENTER_COLUMN_WARNING_THRESHOLD: 10000;
|
|
32
32
|
export const SUPPORTED_DEFAULT_NUMBER_FORMATS: Set<string>;
|
|
33
33
|
export const GRAND_TOTAL_ROW_ID: "__grand_total__";
|
|
34
|
+
export function isGrandTotalRow(row: any): boolean;
|
|
35
|
+
export function isSubtotalRow(row: any): boolean;
|
|
34
36
|
export const MISSING_PERSISTED_VALUE: unique symbol;
|
|
35
37
|
export const CUSTOM_CATEGORY_FIELD_PREFIX: "__custom_category__";
|
|
36
38
|
export const CUSTOM_DIMENSION_KINDS: Set<string>;
|
|
@@ -107,7 +109,7 @@ export function createChartDefinitionId(prefix?: string): string;
|
|
|
107
109
|
export function cloneSerializable(value: any, fallback?: null): any;
|
|
108
110
|
export function normalizeViewModeValue(value: any): any;
|
|
109
111
|
export function normalizeDetailModeValue(value: any): any;
|
|
110
|
-
export function normalizeTreeSourceTypeValue(value: any): "
|
|
112
|
+
export function normalizeTreeSourceTypeValue(value: any): "adjacency" | "path" | "nested";
|
|
111
113
|
export function normalizeTreeDisplayModeValue(value: any): "singleColumn" | "multipleColumns";
|
|
112
114
|
export function normalizeTreeGroupDefaultExpandedValue(value: any): number;
|
|
113
115
|
export function normalizeTreeDefaultOpenPathsValue(value: any): any[];
|
|
@@ -447,6 +449,14 @@ export function normalizePerformanceConfigValue(value: any): {
|
|
|
447
449
|
rowOverscan: number | null;
|
|
448
450
|
columnOverscan: number | null;
|
|
449
451
|
prefetchColumns: number | null;
|
|
452
|
+
executionMode: any;
|
|
453
|
+
clientEngine: any;
|
|
454
|
+
duckdbWasmThreshold: number | null;
|
|
455
|
+
clientRowThreshold: number | null;
|
|
456
|
+
dataUrl: any;
|
|
457
|
+
duckdbWasmCdnUrl: any;
|
|
458
|
+
duckdbWasmInstance: any;
|
|
459
|
+
legacyClientTable: boolean;
|
|
450
460
|
};
|
|
451
461
|
export function buildLargeColumnAdvisory({ serverSide, totalCenterCols, colFields }: {
|
|
452
462
|
serverSide: any;
|
package/dist/react/index.mjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { ap as
|
|
1
|
+
import { ap as s, aq as t, ar as o, as as n, at as r, au as i, av as l, aw as c, ax as p, ay as m, az as u, aA as v, aB as C } from "./chunks/react-CPZZxtSo.mjs";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
s as ClientPivotTransport,
|
|
4
|
+
t as ClientResponsePostProcessor,
|
|
5
|
+
o as ClientSqlPlanner,
|
|
6
|
+
n as DuckDbWasmExecutor,
|
|
7
|
+
r as HttpPivotTransport,
|
|
8
|
+
i as LatestViewportScheduler,
|
|
9
|
+
l as PivotWorkspace,
|
|
10
|
+
c as injectThemeCssVars,
|
|
11
|
+
p as normalizeClientEngineKind,
|
|
12
|
+
m as normalizeExecutionMode,
|
|
13
|
+
u as resolveClientEngineKind,
|
|
14
|
+
v as resolveExecutionMode,
|
|
15
|
+
C as themes
|
|
8
16
|
};
|
package/dist/react/react.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export { PivotWorkspace } from './components/PivotWorkspace';
|
|
3
3
|
export { HttpPivotTransport, LatestViewportScheduler, type PayloadReference, type PivotTransport, } from './runtime/httpTransport';
|
|
4
4
|
export { themes, injectThemeCssVars } from './utils/styles';
|
|
5
|
+
export { ClientPivotTransport, DuckDbWasmExecutor, ClientSqlPlanner, ClientResponsePostProcessor, resolveExecutionMode, resolveClientEngineKind, normalizeExecutionMode, normalizeClientEngineKind, type ExecutionMode, type ClientEngineKind, type ClientRuntimeConfig, type ClientEngineTelemetry, type LogicalPivotPlan, } from './runtime/client/index';
|
|
5
6
|
export type { PivotWorkspaceProps } from './components/PivotWorkspace';
|
|
6
7
|
export type { PivotRuntimeProps, PivotThemeName, PivotValueConfig, ValConfig, FilterCondition, FilterConfig, SortConfig, ChartDefinition, } from './runtime/runtimeDomains';
|
|
7
8
|
export type { RuntimeRequestV1, RuntimeResponseV1, RuntimeRequestSchemaV1, RuntimeResponseSchemaV1, } from './runtime/runtimeContract';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PayloadReference, RuntimeTransportRequestOptions } from '../httpTransport';
|
|
2
|
+
import type { JsonObject, RuntimeRequestV1, RuntimeResponseV1 } from '../runtimeContract';
|
|
3
|
+
import type { ClientEngineTelemetry, ClientPivotTransportInterface, ClientRuntimeConfig, DrillThroughQuery, DrillThroughResult } from './types';
|
|
4
|
+
export interface ClientPivotTransportOptions extends ClientRuntimeConfig {
|
|
5
|
+
data?: Array<{
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
tableName?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ClientPivotTransport implements ClientPivotTransportInterface {
|
|
11
|
+
private executor;
|
|
12
|
+
private config;
|
|
13
|
+
private payloadStore;
|
|
14
|
+
private exportStore;
|
|
15
|
+
constructor(options?: ClientPivotTransportOptions);
|
|
16
|
+
setData(rows: Array<{
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}>): void;
|
|
19
|
+
getData(): Array<{
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
updateConfig(config: Partial<ClientRuntimeConfig>): void;
|
|
23
|
+
getTelemetry(): ClientEngineTelemetry;
|
|
24
|
+
request(request: RuntimeRequestV1, options?: RuntimeTransportRequestOptions): Promise<RuntimeResponseV1>;
|
|
25
|
+
queryDrillThrough(query: DrillThroughQuery): Promise<DrillThroughResult>;
|
|
26
|
+
fetchPayload(reference: PayloadReference, _options?: RuntimeTransportRequestOptions): Promise<JsonObject>;
|
|
27
|
+
fetchExportPayload(reference: PayloadReference, _options?: RuntimeTransportRequestOptions): Promise<Blob>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RuntimeResponseV1 } from '../runtimeContract';
|
|
2
|
+
import type { ClientExecutedDataset, DrillThroughQuery, DrillThroughResult, LogicalPivotPlan } from './types';
|
|
3
|
+
export declare function evaluateSafeFormula(expression: string, context: {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}): {
|
|
6
|
+
value: number | null;
|
|
7
|
+
error: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare class ClientResponsePostProcessor {
|
|
10
|
+
static buildResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
11
|
+
static buildDataResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
12
|
+
static buildFilterOptionsResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
13
|
+
static buildChartResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
14
|
+
static executeDrillThroughQuery(allRows: Array<{
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}>, plan: LogicalPivotPlan, query: DrillThroughQuery): DrillThroughResult;
|
|
17
|
+
static buildDetailResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
18
|
+
static buildDrillResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
19
|
+
static buildExportResponse(plan: LogicalPivotPlan, executed: ClientExecutedDataset): RuntimeResponseV1;
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ClientEngineTelemetry, ClientExecutedDataset, ClientRuntimeConfig, LogicalPivotPlan, NormalizedCustomDimension, NormalizedFieldFilter } from './types';
|
|
2
|
+
export declare function applyCustomDimensionsToDataset(rows: Array<{
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}>, customDimensions: NormalizedCustomDimension[]): Array<{
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function filterDatasetRows(rows: Array<{
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}>, filters: NormalizedFieldFilter[], excludeField?: string): Array<{
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
export declare class DuckDbWasmExecutor {
|
|
13
|
+
private rows;
|
|
14
|
+
private config;
|
|
15
|
+
private wasmReady;
|
|
16
|
+
private wasmInitializing;
|
|
17
|
+
private wasmRetryAfter;
|
|
18
|
+
private dbInstance;
|
|
19
|
+
private dbConn;
|
|
20
|
+
private registeredTableSignature;
|
|
21
|
+
private telemetry;
|
|
22
|
+
constructor(initialRows?: Array<{
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>, config?: ClientRuntimeConfig);
|
|
25
|
+
setData(rows: Array<{
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}>): void;
|
|
28
|
+
getData(): Array<{
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}>;
|
|
31
|
+
updateConfig(config: Partial<ClientRuntimeConfig>): void;
|
|
32
|
+
getTelemetry(): ClientEngineTelemetry;
|
|
33
|
+
private tryInitializeWasm;
|
|
34
|
+
private ensureTableRegistered;
|
|
35
|
+
execute(plan: LogicalPivotPlan): Promise<ClientExecutedDataset>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClientEngineKind, ClientRuntimeConfig, ExecutionMode } from './types';
|
|
2
|
+
export interface ModeResolutionInput {
|
|
3
|
+
serverSide?: boolean;
|
|
4
|
+
data?: unknown;
|
|
5
|
+
table?: string;
|
|
6
|
+
runtimeResponse?: unknown;
|
|
7
|
+
performanceConfig?: ClientRuntimeConfig | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ModeResolutionOptions {
|
|
10
|
+
performanceConfig?: ClientRuntimeConfig | null;
|
|
11
|
+
hasExternalServerTransport?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function normalizeExecutionMode(value: unknown): ExecutionMode;
|
|
14
|
+
export declare function normalizeClientEngineKind(value: unknown): ClientEngineKind;
|
|
15
|
+
export declare function resolveExecutionMode(props?: ModeResolutionInput, options?: ModeResolutionOptions): 'client' | 'server';
|
|
16
|
+
export declare function resolveClientEngineKind(config: ClientRuntimeConfig | null | undefined, rowCount: number, wasmReady?: boolean): 'duckdb-wasm' | 'memory';
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { PivotTransport } from '../httpTransport';
|
|
2
|
+
import type { RuntimeRequestV1 } from '../runtimeContract';
|
|
3
|
+
export type ExecutionMode = 'auto' | 'client' | 'server';
|
|
4
|
+
export type ClientEngineKind = 'auto' | 'duckdb-wasm' | 'memory';
|
|
5
|
+
export type PivotViewMode = 'pivot' | 'tree' | 'report' | 'table';
|
|
6
|
+
export type PivotLayoutMode = 'hierarchy' | 'outline' | 'tabular';
|
|
7
|
+
export interface ClientRuntimeConfig {
|
|
8
|
+
executionMode?: ExecutionMode;
|
|
9
|
+
clientEngine?: ClientEngineKind;
|
|
10
|
+
duckdbWasmThreshold?: number;
|
|
11
|
+
clientRowThreshold?: number;
|
|
12
|
+
dataUrl?: string;
|
|
13
|
+
duckdbWasmCdnUrl?: string;
|
|
14
|
+
duckdbWasmInstance?: unknown;
|
|
15
|
+
legacyClientTable?: boolean;
|
|
16
|
+
tableName?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ClientEngineTelemetry {
|
|
19
|
+
activeMode: 'client' | 'server';
|
|
20
|
+
activeEngine: 'duckdb-wasm' | 'memory' | 'server';
|
|
21
|
+
wasmReady: boolean;
|
|
22
|
+
lastQuerySql: string;
|
|
23
|
+
lastExecutionMs: number;
|
|
24
|
+
rowCount: number;
|
|
25
|
+
networkRoundtrips: number;
|
|
26
|
+
lastUpdatedAt: number;
|
|
27
|
+
}
|
|
28
|
+
export interface NormalizedValConfig {
|
|
29
|
+
field: string;
|
|
30
|
+
agg: string;
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
weightField?: string;
|
|
34
|
+
windowFn?: string;
|
|
35
|
+
formula?: string;
|
|
36
|
+
formulaScope?: 'measures' | 'columns';
|
|
37
|
+
percentile?: number;
|
|
38
|
+
separator?: string;
|
|
39
|
+
format?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface NormalizedCustomDimension {
|
|
42
|
+
id: string;
|
|
43
|
+
field: string;
|
|
44
|
+
name: string;
|
|
45
|
+
defaultBucket: string;
|
|
46
|
+
rules: Array<{
|
|
47
|
+
label: string;
|
|
48
|
+
op: string;
|
|
49
|
+
value: unknown;
|
|
50
|
+
value2?: unknown;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export interface NormalizedFilterClause {
|
|
54
|
+
type: string;
|
|
55
|
+
value?: unknown;
|
|
56
|
+
values?: unknown[];
|
|
57
|
+
caseSensitive?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface NormalizedFieldFilter {
|
|
60
|
+
field: string;
|
|
61
|
+
operator: 'AND' | 'OR';
|
|
62
|
+
clauses: NormalizedFilterClause[];
|
|
63
|
+
}
|
|
64
|
+
export interface NormalizedSortRule {
|
|
65
|
+
id: string;
|
|
66
|
+
desc: boolean;
|
|
67
|
+
sortType?: string;
|
|
68
|
+
sortKeyField?: string;
|
|
69
|
+
absoluteSort?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface LogicalPivotPlan {
|
|
72
|
+
kind: 'data' | 'filter_options' | 'chart' | 'detail' | 'drill' | 'update' | 'export' | 'transaction';
|
|
73
|
+
table: string;
|
|
74
|
+
viewMode: PivotViewMode;
|
|
75
|
+
layoutMode: PivotLayoutMode;
|
|
76
|
+
showSubtotalFooters: boolean;
|
|
77
|
+
includeGrandTotal: boolean;
|
|
78
|
+
showRowTotals: boolean;
|
|
79
|
+
showColTotals: boolean;
|
|
80
|
+
grandTotalPosition: 'top' | 'bottom';
|
|
81
|
+
rowFields: string[];
|
|
82
|
+
colFields: string[];
|
|
83
|
+
valConfigs: NormalizedValConfig[];
|
|
84
|
+
customDimensions: NormalizedCustomDimension[];
|
|
85
|
+
filters: NormalizedFieldFilter[];
|
|
86
|
+
sorting: NormalizedSortRule[];
|
|
87
|
+
sortOptions: {
|
|
88
|
+
columnSortBy?: string;
|
|
89
|
+
columnSortOrder?: string;
|
|
90
|
+
nulls?: string;
|
|
91
|
+
naturalSort?: boolean;
|
|
92
|
+
fieldOptions?: {
|
|
93
|
+
[key: string]: {
|
|
94
|
+
sortType?: string;
|
|
95
|
+
sortKeyField?: string;
|
|
96
|
+
absoluteSort?: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
expandedAll: boolean;
|
|
101
|
+
expandedPaths: string[][];
|
|
102
|
+
collapsedPaths: string[][];
|
|
103
|
+
measureAxis: {
|
|
104
|
+
placement: 'columns' | 'rows';
|
|
105
|
+
position?: number;
|
|
106
|
+
measureColId?: string;
|
|
107
|
+
valueColId?: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
valueLabel?: string;
|
|
110
|
+
};
|
|
111
|
+
treeConfig: {
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
} | null;
|
|
114
|
+
reportDef: {
|
|
115
|
+
[key: string]: unknown;
|
|
116
|
+
} | null;
|
|
117
|
+
detailConfig: {
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
} | null;
|
|
120
|
+
layoutManifest: Array<{
|
|
121
|
+
id?: string;
|
|
122
|
+
layoutId?: string;
|
|
123
|
+
}> | null;
|
|
124
|
+
start: number;
|
|
125
|
+
end: number;
|
|
126
|
+
colStart: number | null;
|
|
127
|
+
colEnd: number | null;
|
|
128
|
+
needsColSchema: boolean;
|
|
129
|
+
version: number;
|
|
130
|
+
windowSeq: number;
|
|
131
|
+
stateEpoch: number;
|
|
132
|
+
abortGeneration: number;
|
|
133
|
+
sessionId: string;
|
|
134
|
+
clientInstance: string;
|
|
135
|
+
intent: string;
|
|
136
|
+
rawRequest: RuntimeRequestV1;
|
|
137
|
+
sql: {
|
|
138
|
+
baseFilteredSql: string;
|
|
139
|
+
groupingSql: string;
|
|
140
|
+
colValuesSql: string;
|
|
141
|
+
grandTotalSql: string;
|
|
142
|
+
filterOptionsSql: string;
|
|
143
|
+
drillSql: string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export interface AggregatedCellMetrics {
|
|
147
|
+
sum: number;
|
|
148
|
+
count: number;
|
|
149
|
+
numericCount: number;
|
|
150
|
+
min: number | null;
|
|
151
|
+
max: number | null;
|
|
152
|
+
weightedNumer: number;
|
|
153
|
+
weightedDenom: number;
|
|
154
|
+
values: unknown[];
|
|
155
|
+
firstValue: unknown;
|
|
156
|
+
lastValue: unknown;
|
|
157
|
+
}
|
|
158
|
+
export interface ClientExecutedDataset {
|
|
159
|
+
filteredRows: Array<{
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
}>;
|
|
162
|
+
allRows: Array<{
|
|
163
|
+
[key: string]: unknown;
|
|
164
|
+
}>;
|
|
165
|
+
colCombinations: string[];
|
|
166
|
+
engineUsed: 'duckdb-wasm' | 'memory';
|
|
167
|
+
executionMs: number;
|
|
168
|
+
lastSql: string;
|
|
169
|
+
}
|
|
170
|
+
export interface DrillThroughQuery {
|
|
171
|
+
table?: string;
|
|
172
|
+
rowPath: string;
|
|
173
|
+
rowFields: string[];
|
|
174
|
+
colField?: string;
|
|
175
|
+
colVal?: string;
|
|
176
|
+
filters?: {
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
};
|
|
179
|
+
customDimensions?: unknown[];
|
|
180
|
+
page?: number;
|
|
181
|
+
pageSize?: number;
|
|
182
|
+
sortCol?: string;
|
|
183
|
+
sortDir?: 'asc' | 'desc';
|
|
184
|
+
filterText?: string;
|
|
185
|
+
}
|
|
186
|
+
export interface DrillThroughResult {
|
|
187
|
+
rows: Array<{
|
|
188
|
+
[key: string]: unknown;
|
|
189
|
+
}>;
|
|
190
|
+
totalRows: number;
|
|
191
|
+
page: number;
|
|
192
|
+
pageSize: number;
|
|
193
|
+
columns: string[];
|
|
194
|
+
}
|
|
195
|
+
export interface ClientPivotTransportInterface extends PivotTransport {
|
|
196
|
+
setData: (rows: Array<{
|
|
197
|
+
[key: string]: unknown;
|
|
198
|
+
}>) => void;
|
|
199
|
+
updateConfig: (config: Partial<ClientRuntimeConfig>) => void;
|
|
200
|
+
getTelemetry: () => ClientEngineTelemetry;
|
|
201
|
+
queryDrillThrough: (query: DrillThroughQuery) => Promise<DrillThroughResult>;
|
|
202
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* server-side data request. The three request paths are explicit: local UI,
|
|
4
4
|
* hierarchy expansion, and cache-invalidating structural changes.
|
|
5
5
|
*/
|
|
6
|
-
export function useRuntimeStructuralSync({ actions: { beginExpansionRequest, beginStructuralTransaction, buildRuntimeRequestStateOverride, buildLayoutRequestFields, markRequestPending, resolveStableRequestedColumnWindow, setPendingColumnSkeletonCount, }, refs: { abortGenerationRef, clientInstanceRef, expansionScrollRestoreRafRef, expansionScrollRestoreRef, latestDataVersionRef, latestRequestedViewportRef, latestViewportRef, needsColSchemaRef, parentRef, pendingExpansionRef, sessionIdRef, setPropsRef, }, state: { colFields, columnOrder, columnPinning, columnSizing, columnVisibility, customDimensions, detailConfig, detailMode, effectiveSortOptions, expanded, filters, grandTotalPinOverride, immersiveMode, layoutMode, reportDef, rowFields, rowPinning, runtimeMeasureAxis, serverSide, serverSideBlockSize, serverSidePinsGrandTotal, showColTotals, showRowTotals, showSubtotals, sorting, tableName, treeConfig, valConfigs, viewMode, }, initialState, }: {
|
|
6
|
+
export function useRuntimeStructuralSync({ actions: { beginExpansionRequest, beginStructuralTransaction, buildRuntimeRequestStateOverride, buildLayoutRequestFields, markRequestPending, resolveStableRequestedColumnWindow, setPendingColumnSkeletonCount, }, refs: { abortGenerationRef, clientInstanceRef, expansionScrollRestoreRafRef, expansionScrollRestoreRef, latestDataVersionRef, latestRequestedViewportRef, latestViewportRef, needsColSchemaRef, parentRef, pendingExpansionRef, sessionIdRef, setPropsRef, }, state: { clientEngine, clientRuntimeActive, colFields, columnOrder, columnPinning, columnSizing, columnVisibility, customDimensions, detailConfig, detailMode, effectiveSortOptions, executionMode, expanded, filters, grandTotalPinOverride, immersiveMode, layoutMode, reportDef, rowFields, rowPinning, runtimeMeasureAxis, serverSide, serverSideBlockSize, serverSidePinsGrandTotal, showColTotals, showRowTotals, showSubtotals, sorting, tableName, treeConfig, valConfigs, viewMode, }, initialState, }: {
|
|
7
7
|
actions: {
|
|
8
8
|
beginExpansionRequest: any;
|
|
9
9
|
beginStructuralTransaction: any;
|
|
@@ -28,6 +28,8 @@ export function useRuntimeStructuralSync({ actions: { beginExpansionRequest, beg
|
|
|
28
28
|
setPropsRef: any;
|
|
29
29
|
};
|
|
30
30
|
state: {
|
|
31
|
+
clientEngine: any;
|
|
32
|
+
clientRuntimeActive: any;
|
|
31
33
|
colFields: any;
|
|
32
34
|
columnOrder: any;
|
|
33
35
|
columnPinning: any;
|
|
@@ -37,6 +39,7 @@ export function useRuntimeStructuralSync({ actions: { beginExpansionRequest, beg
|
|
|
37
39
|
detailConfig: any;
|
|
38
40
|
detailMode: any;
|
|
39
41
|
effectiveSortOptions: any;
|
|
42
|
+
executionMode: any;
|
|
40
43
|
expanded: any;
|
|
41
44
|
filters: any;
|
|
42
45
|
grandTotalPinOverride: any;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serverside_pivot",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.91",
|
|
4
|
+
"description": "Enterprise-grade analytical pivot table & virtualized data grid for React. Dual-engine: zero-network in-browser analytics (DuckDB-WASM & in-memory) and scalable server-side pushdown. Built with TanStack Table v8, ECharts 6, and 2D virtualization.",
|
|
5
5
|
"main": "./dist/react/index.mjs",
|
|
6
6
|
"types": "./dist/react/react.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typecheck:js": "tsc --project tsconfig.checked-js.json --noEmit && node scripts/verify_checked_js_gate.mjs",
|
|
37
37
|
"generate:runtime-contract-types": "json2ts -i pivot_engine/pivot_engine/runtime/runtime-contract.schema.json -o src/lib/runtime/runtime-contract.generated.ts && json2ts -i pivot_engine/pivot_engine/runtime/runtime-response.schema.json -o src/lib/runtime/runtime-response-contract.generated.ts"
|
|
38
38
|
},
|
|
39
|
-
"author": "
|
|
39
|
+
"author": "Ramzy <ramzyelawady@gmail.com>",
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@tanstack/react-table": "^8.10.7",
|
|
@@ -85,5 +85,30 @@
|
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=8.11.0",
|
|
87
87
|
"npm": ">=6.1.0"
|
|
88
|
+
},
|
|
89
|
+
"keywords": [
|
|
90
|
+
"react",
|
|
91
|
+
"pivot-table",
|
|
92
|
+
"pivot-grid",
|
|
93
|
+
"datagrid",
|
|
94
|
+
"table",
|
|
95
|
+
"tanstack-table",
|
|
96
|
+
"duckdb-wasm",
|
|
97
|
+
"analytics",
|
|
98
|
+
"virtualized-table",
|
|
99
|
+
"olap",
|
|
100
|
+
"echarts",
|
|
101
|
+
"data-visualization",
|
|
102
|
+
"excel-formulas",
|
|
103
|
+
"spreadsheet",
|
|
104
|
+
"hybrid-pivot"
|
|
105
|
+
],
|
|
106
|
+
"repository": {
|
|
107
|
+
"type": "git",
|
|
108
|
+
"url": "git+https://github.com/Ramzy22/serverside_pivot.git"
|
|
109
|
+
},
|
|
110
|
+
"homepage": "https://github.com/Ramzy22/serverside_pivot#readme",
|
|
111
|
+
"bugs": {
|
|
112
|
+
"url": "https://github.com/Ramzy22/serverside_pivot/issues"
|
|
88
113
|
}
|
|
89
114
|
}
|