@deephaven/js-plugin-pivot 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10996,11 +10996,11 @@ class IrisGridPivotModel extends irisGrid.IrisGridModel {
10996
10996
  }
10997
10997
  expandAllColumns() {
10998
10998
  log$4.debug("expandAllColumns");
10999
- this.setColumnExpanded(this.keyColumns.length, true, true);
10999
+ this.setColumnExpanded(this.getGrandTotalsColumnIndex(), true, true);
11000
11000
  }
11001
11001
  collapseAllColumns() {
11002
11002
  log$4.debug("collapseAllColumns");
11003
- this.setColumnExpanded(this.keyColumns.length, false, true);
11003
+ this.setColumnExpanded(this.getGrandTotalsColumnIndex(), false, true);
11004
11004
  }
11005
11005
  isColumnExpandable(x, depth) {
11006
11006
  var _a;
@@ -11012,8 +11012,15 @@ class IrisGridPivotModel extends irisGrid.IrisGridModel {
11012
11012
  }
11013
11013
  return ((_a = this.columns[x]) == null ? void 0 : _a.hasChildren) ?? false;
11014
11014
  }
11015
+ /**
11016
+ * Get the index of the first grand totals column.
11017
+ * This is the column index that represents the root of the column hierarchy.
11018
+ */
11019
+ getGrandTotalsColumnIndex() {
11020
+ return this.keyColumns.length + (this.groupColumn == null ? 0 : 1);
11021
+ }
11015
11022
  isGrandTotalsColumn(x) {
11016
- const totalsStartIndex = this.keyColumns.length + (this.groupColumn == null ? 0 : 1);
11023
+ const totalsStartIndex = this.getGrandTotalsColumnIndex();
11017
11024
  return x >= totalsStartIndex && x < this.virtualColumns.length;
11018
11025
  }
11019
11026
  isColumnExpanded(x) {
@@ -11043,7 +11050,7 @@ class IrisGridPivotModel extends irisGrid.IrisGridModel {
11043
11050
  return depth;
11044
11051
  }
11045
11052
  textValueForCell(x, y) {
11046
- var _a;
11053
+ var _a, _b;
11047
11054
  if (((_a = this.formattedStringData[x]) == null ? void 0 : _a[y]) === void 0) {
11048
11055
  const value2 = this.valueForCell(x, y);
11049
11056
  if (value2 === null) {
@@ -11053,10 +11060,22 @@ class IrisGridPivotModel extends irisGrid.IrisGridModel {
11053
11060
  return void 0;
11054
11061
  }
11055
11062
  const column = this.columns[x];
11063
+ let columnType = column.type;
11064
+ let columnName = column.name;
11065
+ const groupOffset = this.groupColumn == null ? 0 : 1;
11066
+ if (groupOffset === 1 && x === 0 && y !== 0) {
11067
+ const rowDepth = ((_b = this.row(y)) == null ? void 0 : _b.depth) ?? 2;
11068
+ const keyCount = this.keyColumns.length;
11069
+ if (rowDepth > 0 && rowDepth < keyCount) {
11070
+ const sourceKeyColumn = this.keyColumns[rowDepth - 1];
11071
+ columnType = sourceKeyColumn.type;
11072
+ columnName = sourceKeyColumn.name;
11073
+ }
11074
+ }
11056
11075
  const hasCustomColumnFormat = this.getCachedCustomColumnFormatFlag(
11057
11076
  this.formatter,
11058
- column.name,
11059
- column.type
11077
+ columnName,
11078
+ columnType
11060
11079
  );
11061
11080
  let formatOverride;
11062
11081
  if (!hasCustomColumnFormat) {
@@ -11067,8 +11086,8 @@ class IrisGridPivotModel extends irisGrid.IrisGridModel {
11067
11086
  }
11068
11087
  const text = this.displayString(
11069
11088
  value2,
11070
- column.type,
11071
- column.name,
11089
+ columnType,
11090
+ columnName,
11072
11091
  formatOverride
11073
11092
  );
11074
11093
  this.cacheFormattedValue(x, y, text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/js-plugin-pivot",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Pivot plugin for Deephaven",
5
5
  "keywords": [
6
6
  "Deephaven",
@@ -58,5 +58,5 @@
58
58
  "files": [
59
59
  "dist/index.js"
60
60
  ],
61
- "gitHead": "aa57501928427c83086811d7700bfcc4e6962265"
61
+ "gitHead": "a90120783141bad37e4499a8870349181b4fc93c"
62
62
  }