Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c315bb7
Init
vbabich Jul 17, 2025
3e1b47a
WIP
vbabich Jul 18, 2025
838ce81
WIP
vbabich Jul 23, 2025
89d10d3
Totals row
vbabich Jul 25, 2025
f1186a6
Unit tests for pivot viewport/snapshots. Expandable columns.
vbabich Aug 8, 2025
68ea770
Unit tests, fix viewport offset
vbabich Aug 12, 2025
bbe5d1d
Unit tests cleanup - extract makePivotTable and makeUpdateEvent
vbabich Aug 13, 2025
909f858
Cleanup
vbabich Aug 14, 2025
90793bd
Column viewport
vbabich Aug 22, 2025
d936338
WIP
vbabich Aug 26, 2025
5e0a0c0
WIP
vbabich Aug 28, 2025
c1d8d11
Groups
vbabich Aug 29, 2025
78b4c23
WIP
vbabich Sep 5, 2025
fe6b168
Cleanup
vbabich Sep 5, 2025
30fbfff
Cleanup
vbabich Sep 5, 2025
7fbf1ee
Cleanuo
vbabich Sep 5, 2025
c23ccbf
Cleanup, fix bugs, expand/collapse indicators
vbabich Sep 10, 2025
bb08948
Merge remote-tracking branch 'origin/main' into pivot-plugin
vbabich Sep 10, 2025
2bd8296
Fix manifest
vbabich Sep 10, 2025
900bbfd
Format values in column headers
vbabich Sep 10, 2025
cca12a5
Update plugins/pivot/src/js/src/PivotPlugin.ts
vbabich Sep 18, 2025
58d4d19
Update plugins/pivot/src/deephaven/pivot/register.py
vbabich Sep 18, 2025
7de499c
Update plugins/pivot/src/js/src/ExpandableColumnHeaderGroup.ts
vbabich Sep 18, 2025
a412653
Merge branch 'pivot-plugin' of https://github.com/vbabich/deephaven-p…
vbabich Sep 18, 2025
efe7527
Add missing IrisGridModel methods
vbabich Sep 18, 2025
94a48fa
Address review comments
vbabich Sep 19, 2025
ff1b00b
Address review comments
vbabich Sep 19, 2025
fe7547e
Address review comments
vbabich Sep 19, 2025
e21bbc6
Render IrisGridPanel in pivot plugin
vbabich Sep 19, 2025
7560ef6
Update package.json
vbabich Sep 19, 2025
cec8ebe
Update package.json
vbabich Sep 19, 2025
0dd7b3c
Update packages, clean up components
vbabich Sep 22, 2025
43e7072
Fix types, update unit tests
vbabich Sep 23, 2025
4952cba
package-lock reset
vbabich Sep 23, 2025
0b8da2e
package-lock reset
vbabich Sep 23, 2025
f430765
Merge remote-tracking branch 'origin/main' into pivot-plugin
vbabich Sep 23, 2025
ec2530d
Cleanup diff
vbabich Sep 23, 2025
5fdde35
Cleanup diff
vbabich Sep 23, 2025
7b2f2c0
Cleanup diff
vbabich Sep 23, 2025
4508d5c
Fix types
vbabich Sep 23, 2025
cea808c
Update coreplus types package
vbabich Sep 23, 2025
b05730b
Fix types
vbabich Sep 23, 2025
cd21395
Fix class name
vbabich Sep 23, 2025
e3764af
TODO
vbabich Sep 23, 2025
b6f18b5
Update readme
vbabich Sep 24, 2025
f7d1ce5
Version bump
vbabich Sep 24, 2025
0d63a3d
Disable provenance for js plugin alpha release
vbabich Sep 24, 2025
535e6ca
Fix click handling on nested header groups
vbabich Sep 24, 2025
ca674df
encode keys in group header names
vbabich Sep 24, 2025
a48eabc
Remove provenance: false
vbabich Sep 24, 2025
5b061b1
Add repository info in package.json
vbabich Sep 24, 2025
45c3a21
Add forward ref for state persistence
vbabich Sep 25, 2025
219e99d
Cleanup, review comments
vbabich Sep 29, 2025
e05048f
Delete comments
vbabich Sep 30, 2025
5d08b30
Add group column, add key column filters
vbabich Oct 1, 2025
4d3d127
Merge remote-tracking branch 'origin/main' into pivot-plugin-group-co…
vbabich Oct 3, 2025
112d56c
Mouse handlers, filters WIP
vbabich Oct 13, 2025
129c8b8
Sorts chunk 1
vbabich Nov 21, 2025
7155ee6
Sorts - use sort descriptors
vbabich Nov 21, 2025
261e24a
Render sort indicators
vbabich Nov 25, 2025
30a7f5e
Merge remote-tracking branch 'origin/main' into pivot-plugin-group-co…
vbabich Dec 16, 2025
7d43af9
package-lock update
vbabich Dec 16, 2025
558d1e6
WIP
vbabich Dec 17, 2025
e6a034a
usePivotMetricCalculator hook
vbabich Dec 17, 2025
0c6fa19
Optimize isFilterable
vbabich Dec 17, 2025
b32f76a
Cleanup
vbabich Dec 17, 2025
784242a
Cleanup
vbabich Dec 18, 2025
6a644aa
Merge remote-tracking branch 'upstream/main' into pivot-plugin-group-…
vbabich Dec 18, 2025
8fd6ace
Restore packagelcok
vbabich Dec 18, 2025
c37ef6b
PivotFilterMouseHandler
vbabich Dec 23, 2025
defc9a5
Filter UI metrics, event handlers, and renderer
vbabich Jan 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions plugins/pivot/src/js/src/IrisGridPivotMetricCalculator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import {
IrisGridMetricCalculator,
type IrisGridMetricState,
} from '@deephaven/iris-grid';
import type { GridMetrics, ModelIndex, ModelSizeMap } from '@deephaven/grid';
import { isIrisGridPivotModel } from './IrisGridPivotModel';

export interface PivotGridMetrics extends GridMetrics {
// Width of the widest column source header text, including padding
sourceTextWidth: number;
}

class IrisGridPivotMetricCalculator extends IrisGridMetricCalculator {
// Gets the text width for a column header group, including padding
getColumnHeaderGroupTextWidth(
modelColumn: ModelIndex,
depth: number,
state: IrisGridMetricState,
maxColumnWidth: number
): number {
return super.getColumnHeaderGroupWidth(
modelColumn,
depth,
state,
maxColumnWidth
);
}

getColumnHeaderGroupWidth(
modelColumn: ModelIndex,
depth: number,
state: IrisGridMetricState,
maxColumnWidth: number
): number {
return this.getColumnHeaderGroupTextWidth(
modelColumn,
depth,
state,
maxColumnWidth
);
}

// TODO: fix performance, cache results?
calculateSourceTextWidths(
model: unknown,
state: IrisGridMetricState
): ModelSizeMap {
const sourceTextWidths: ModelSizeMap = new Map();
if (!isIrisGridPivotModel(model)) {
return sourceTextWidths;
}

const { theme } = state;
const { headerHorizontalPadding, maxColumnWidth } = theme;

// TODO: iterate over parents of column 0 to find source columns

const sourceIndexes: ModelIndex[] = Object.keys(model.columns)
.map(Number)
.filter(key => key < 0);

sourceIndexes.forEach(sourceIndex => {
const width = this.getColumnHeaderGroupTextWidth(
sourceIndex,
0,
state,
maxColumnWidth
);
// Extra padding between the text and the sort icon
sourceTextWidths.set(sourceIndex, width + headerHorizontalPadding);
});
return sourceTextWidths;
}

/**
* Gets the metrics for the current state. This method has to be called before setColumnSize or resetColumnSize.
* @param state The current IrisGridMetricState
* @returns The metrics for the current state
*/
getMetrics(state: IrisGridMetricState): PivotGridMetrics {
const { model } = state;
// Update column widths if columns in the cached model don't match the current model passed in the state
const sourceTextWidths = this.calculateSourceTextWidths(model, state);

const sourceTextWidth = Math.max(...sourceTextWidths.values());

return {
...super.getMetrics(state),
sourceTextWidth,
};
}
}

export default IrisGridPivotMetricCalculator;
12 changes: 6 additions & 6 deletions plugins/pivot/src/js/src/IrisGridPivotModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,13 @@ class IrisGridPivotModel<R extends UIPivotRow = UIPivotRow>
dh: typeof CorePlusDhType;

get filter(): readonly DhType.FilterCondition[] {
return EMPTY_ARRAY;
return this.pivotTable.filter;
}

set filter(_: readonly DhType.FilterCondition[]) {
// No-op
// TODO: DH-20363: Add support for Pivot filters
set filter(filters: DhType.FilterCondition[]) {
log.debug2('Setting filter on pivot table', filters);
this.pivotTable.applyFilter(filters);
this.applyViewport();
}

hydratePivotSort(
Expand Down Expand Up @@ -627,8 +628,7 @@ class IrisGridPivotModel<R extends UIPivotRow = UIPivotRow>
}

isFilterable(columnIndex: ModelIndex): boolean {
// TODO: DH-20363: Add support for Pivot filters
return false;
return this.columns[columnIndex]?.isFilterable ?? false;
}

isColumnSortable(columnIndex: ModelIndex): boolean {
Expand Down
Loading
Loading