@visactor/vtable 0.25.4 → 0.26.0-alpha.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.
Files changed (121) hide show
  1. package/cjs/PivotChart.d.ts +9 -0
  2. package/cjs/PivotChart.js +90 -28
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/PivotTable.d.ts +5 -2
  5. package/cjs/PivotTable.js +186 -152
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/core/BaseTable.js +1 -1
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/dataset/dataset.d.ts +20 -15
  10. package/cjs/dataset/dataset.js +85 -59
  11. package/cjs/dataset/dataset.js.map +1 -1
  12. package/cjs/dataset/statistics-helper.d.ts +13 -2
  13. package/cjs/dataset/statistics-helper.js +22 -27
  14. package/cjs/dataset/statistics-helper.js.map +1 -1
  15. package/cjs/index.d.ts +1 -1
  16. package/cjs/index.js +1 -1
  17. package/cjs/index.js.map +1 -1
  18. package/cjs/layout/chart-helper/get-chart-spec.d.ts +2 -1
  19. package/cjs/layout/chart-helper/get-chart-spec.js +3 -3
  20. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  21. package/cjs/layout/layout-helper.d.ts +12 -0
  22. package/cjs/layout/layout-helper.js +52 -4
  23. package/cjs/layout/layout-helper.js.map +1 -1
  24. package/cjs/layout/pivot-header-layout.d.ts +4 -3
  25. package/cjs/layout/pivot-header-layout.js +36 -46
  26. package/cjs/layout/pivot-header-layout.js.map +1 -1
  27. package/cjs/layout/tree-helper.d.ts +1 -0
  28. package/cjs/layout/tree-helper.js +12 -7
  29. package/cjs/layout/tree-helper.js.map +1 -1
  30. package/cjs/state/cell-move/adjust-header.js +1 -1
  31. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  32. package/cjs/state/resize/update-resize-column.js +1 -1
  33. package/cjs/state/resize/update-resize-column.js.map +1 -1
  34. package/cjs/state/resize/update-resize-row.js +5 -4
  35. package/cjs/state/resize/update-resize-row.js.map +1 -1
  36. package/cjs/themes/ARCO.js +1 -1
  37. package/cjs/themes/BRIGHT.js +1 -1
  38. package/cjs/themes/DARK.js +1 -1
  39. package/cjs/themes/DEFAULT.js +1 -1
  40. package/cjs/themes/SIMPLIFY.js +1 -1
  41. package/cjs/tools/LimitPromiseQueue.js +1 -1
  42. package/cjs/tools/NumberMap.js +1 -1
  43. package/cjs/tools/Rect.js +1 -1
  44. package/cjs/tools/calc.js +1 -1
  45. package/cjs/tools/debounce.js +1 -1
  46. package/cjs/tools/get-data-path/create-dataset.d.ts +9 -1
  47. package/cjs/tools/get-data-path/create-dataset.js +19 -8
  48. package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
  49. package/cjs/tools/get-data-path/index.js +12 -3
  50. package/cjs/tools/get-data-path/index.js.map +1 -1
  51. package/cjs/ts-types/base-table.d.ts +6 -2
  52. package/cjs/ts-types/base-table.js.map +1 -1
  53. package/cjs/ts-types/common.d.ts +2 -0
  54. package/cjs/ts-types/common.js.map +1 -1
  55. package/cjs/ts-types/menu.d.ts +1 -1
  56. package/cjs/ts-types/menu.js.map +1 -1
  57. package/cjs/ts-types/table-engine.d.ts +1 -0
  58. package/cjs/ts-types/table-engine.js.map +1 -1
  59. package/cjs/vrender.js.map +1 -1
  60. package/dist/vtable.js +882 -546
  61. package/dist/vtable.min.js +2 -2
  62. package/es/PivotChart.d.ts +9 -0
  63. package/es/PivotChart.js +97 -29
  64. package/es/PivotChart.js.map +1 -1
  65. package/es/PivotTable.d.ts +5 -2
  66. package/es/PivotTable.js +188 -148
  67. package/es/PivotTable.js.map +1 -1
  68. package/es/core/BaseTable.js +1 -1
  69. package/es/core/BaseTable.js.map +1 -1
  70. package/es/dataset/dataset.d.ts +20 -15
  71. package/es/dataset/dataset.js +85 -59
  72. package/es/dataset/dataset.js.map +1 -1
  73. package/es/dataset/statistics-helper.d.ts +13 -2
  74. package/es/dataset/statistics-helper.js +22 -27
  75. package/es/dataset/statistics-helper.js.map +1 -1
  76. package/es/index.d.ts +1 -1
  77. package/es/index.js +1 -1
  78. package/es/index.js.map +1 -1
  79. package/es/layout/chart-helper/get-chart-spec.d.ts +2 -1
  80. package/es/layout/chart-helper/get-chart-spec.js +3 -3
  81. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  82. package/es/layout/layout-helper.d.ts +12 -0
  83. package/es/layout/layout-helper.js +50 -0
  84. package/es/layout/layout-helper.js.map +1 -1
  85. package/es/layout/pivot-header-layout.d.ts +4 -3
  86. package/es/layout/pivot-header-layout.js +34 -45
  87. package/es/layout/pivot-header-layout.js.map +1 -1
  88. package/es/layout/tree-helper.d.ts +1 -0
  89. package/es/layout/tree-helper.js +12 -7
  90. package/es/layout/tree-helper.js.map +1 -1
  91. package/es/state/cell-move/adjust-header.js +1 -1
  92. package/es/state/cell-move/adjust-header.js.map +1 -1
  93. package/es/state/resize/update-resize-column.js +1 -1
  94. package/es/state/resize/update-resize-column.js.map +1 -1
  95. package/es/state/resize/update-resize-row.js +5 -4
  96. package/es/state/resize/update-resize-row.js.map +1 -1
  97. package/es/themes/ARCO.js +1 -1
  98. package/es/themes/BRIGHT.js +1 -1
  99. package/es/themes/DARK.js +1 -1
  100. package/es/themes/DEFAULT.js +1 -1
  101. package/es/themes/SIMPLIFY.js +1 -1
  102. package/es/tools/LimitPromiseQueue.js +1 -1
  103. package/es/tools/NumberMap.js +1 -1
  104. package/es/tools/Rect.js +1 -1
  105. package/es/tools/calc.js +1 -1
  106. package/es/tools/debounce.js +1 -1
  107. package/es/tools/get-data-path/create-dataset.d.ts +9 -1
  108. package/es/tools/get-data-path/create-dataset.js +20 -7
  109. package/es/tools/get-data-path/create-dataset.js.map +1 -1
  110. package/es/tools/get-data-path/index.js +15 -2
  111. package/es/tools/get-data-path/index.js.map +1 -1
  112. package/es/ts-types/base-table.d.ts +6 -2
  113. package/es/ts-types/base-table.js.map +1 -1
  114. package/es/ts-types/common.d.ts +2 -0
  115. package/es/ts-types/common.js.map +1 -1
  116. package/es/ts-types/menu.d.ts +1 -1
  117. package/es/ts-types/menu.js.map +1 -1
  118. package/es/ts-types/table-engine.d.ts +1 -0
  119. package/es/ts-types/table-engine.js.map +1 -1
  120. package/es/vrender.js.map +1 -1
  121. package/package.json +5 -5
@@ -5,7 +5,11 @@ import { Dataset } from './dataset/dataset';
5
5
  import { BaseTable } from './core/BaseTable';
6
6
  import type { PivotChartProtected } from './ts-types/base-table';
7
7
  import type { ITableAxisOption } from './ts-types/component/axis';
8
+ import { type LayouTreeNode } from './layout/tree-helper';
8
9
  export declare class PivotChart extends BaseTable implements PivotChartAPI {
10
+ layoutNodeId: {
11
+ seqId: number;
12
+ };
9
13
  internalProps: PivotChartProtected;
10
14
  options: PivotChartConstructorOptions;
11
15
  pivotSortState: PivotSortState[];
@@ -91,4 +95,9 @@ export declare class PivotChart extends BaseTable implements PivotChartAPI {
91
95
  setRecords(records: Array<any>): void;
92
96
  _hasCustomRenderOrLayout(): boolean;
93
97
  changeRecordOrder(source: number, target: number): void;
98
+ getLayoutColumnTree(): LayouTreeNode[];
99
+ getLayoutColumnTreeCount(): number;
100
+ getLayoutRowTree(): LayouTreeNode[];
101
+ getLayoutRowTreeCount(): number;
102
+ getCellHeaderTreeNodes(col: number, row: number): ICellHeaderPaths;
94
103
  }
package/es/PivotChart.js CHANGED
@@ -26,12 +26,21 @@ import { TABLE_EVENT_TYPE } from "./core/TABLE_EVENT_TYPE";
26
26
 
27
27
  import { cloneDeepSpec } from "./vutil-extension-temp";
28
28
 
29
+ import { DimensionTree } from "./layout/tree-helper";
30
+
31
+ import { IndicatorDimensionKeyPlaceholder } from "./tools/global";
32
+
33
+ import { checkHasCartesianChart } from "./layout/chart-helper/get-chart-spec";
34
+
29
35
  export class PivotChart extends BaseTable {
30
36
  constructor(container, options) {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
37
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
38
+ let columnDimensionTree, rowDimensionTree;
32
39
  "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
33
40
  container = container.container ? container.container : null), super(container, options),
34
- this._selectedDataItemsInChart = [], this._selectedDimensionInChart = [], this._chartEventMap = {},
41
+ this.layoutNodeId = {
42
+ seqId: 0
43
+ }, this._selectedDataItemsInChart = [], this._selectedDimensionInChart = [], this._chartEventMap = {},
35
44
  options.layout && Object.assign(options, options.layout), this.internalProps.columns = cloneDeep(options.columns),
36
45
  this.internalProps.rows = cloneDeep(options.rows), this.internalProps.indicators = cloneDeepSpec(options.indicators),
37
46
  this.internalProps.columnTree = !options.indicatorsAsCol || (null === (_a = options.columns) || void 0 === _a ? void 0 : _a.length) || options.columnTree ? cloneDeep(options.columnTree) : [],
@@ -40,17 +49,35 @@ export class PivotChart extends BaseTable {
40
49
  this.internalProps.rowResizeType = null !== (_d = options.rowResizeType) && void 0 !== _d ? _d : "row",
41
50
  this.internalProps.dataConfig = {
42
51
  isPivotChart: !0
43
- }, this._axes = isArray(options.axes) ? options.axes : [];
44
- const rowKeys = null !== (_f = null === (_e = options.rows) || void 0 === _e ? void 0 : _e.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
45
- keys)), [])) && void 0 !== _f ? _f : [], columnKeys = null !== (_h = null === (_g = options.columns) || void 0 === _g ? void 0 : _g.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
46
- keys)), [])) && void 0 !== _h ? _h : [], indicatorKeys = null !== (_k = null === (_j = options.indicators) || void 0 === _j ? void 0 : _j.reduce(((keys, indicatorObj) => ("string" == typeof indicatorObj ? keys.push(indicatorObj) : keys.push(indicatorObj.indicatorKey),
47
- keys)), [])) && void 0 !== _k ? _k : [];
48
- this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
52
+ }, this._axes = isArray(options.axes) ? options.axes : [], options.columnTree && (columnDimensionTree = new DimensionTree(null !== (_e = this.internalProps.columnTree) && void 0 !== _e ? _e : [], this.layoutNodeId)),
53
+ options.rowTree && (rowDimensionTree = new DimensionTree(null !== (_f = this.internalProps.rowTree) && void 0 !== _f ? _f : [], this.layoutNodeId));
54
+ const rowKeys = (null === (_g = null == rowDimensionTree ? void 0 : rowDimensionTree.dimensionKeys) || void 0 === _g ? void 0 : _g.count) ? rowDimensionTree.dimensionKeys.valueArr() : null !== (_j = null === (_h = options.rows) || void 0 === _h ? void 0 : _h.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
55
+ keys)), [])) && void 0 !== _j ? _j : [], columnKeys = (null === (_k = null == columnDimensionTree ? void 0 : columnDimensionTree.dimensionKeys) || void 0 === _k ? void 0 : _k.count) ? columnDimensionTree.dimensionKeys.valueArr() : null !== (_m = null === (_l = options.columns) || void 0 === _l ? void 0 : _l.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
56
+ keys)), [])) && void 0 !== _m ? _m : [], indicatorKeys = null !== (_p = null === (_o = options.indicators) || void 0 === _o ? void 0 : _o.reduce(((keys, indicatorObj) => ("string" == typeof indicatorObj ? keys.push(indicatorObj) : keys.push(indicatorObj.indicatorKey),
57
+ keys)), [])) && void 0 !== _p ? _p : [];
58
+ if (this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
49
59
  this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules(),
50
60
  this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray(),
51
- this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_l = options.indicatorsAsCol) || void 0 === _l || _l, options.records, void 0, this.internalProps.columnTree, this.internalProps.rowTree, !0),
52
- this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset), this.refreshHeader(),
53
- this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new Title(options.title, this),
61
+ this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_q = options.indicatorsAsCol) || void 0 === _q || _q, options.records, void 0, this.internalProps.columnTree, this.internalProps.rowTree, !0),
62
+ this.options.indicatorsAsCol && checkHasCartesianChart(this.internalProps.indicators)) {
63
+ const supplyAxisNode = nodes => {
64
+ nodes.forEach((node => {
65
+ var _a;
66
+ (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) ? supplyAxisNode(node.children) : node.children = [ {
67
+ dimensionKey: "axis",
68
+ value: ""
69
+ } ];
70
+ }));
71
+ };
72
+ (null === (_r = this.dataset.rowHeaderTree) || void 0 === _r ? void 0 : _r.length) ? supplyAxisNode(this.dataset.rowHeaderTree) : this.dataset.rowHeaderTree = [ {
73
+ dimensionKey: "axis",
74
+ value: ""
75
+ } ];
76
+ }
77
+ columnDimensionTree = new DimensionTree(null !== (_s = this.dataset.colHeaderTree) && void 0 !== _s ? _s : [], this.layoutNodeId),
78
+ rowDimensionTree = new DimensionTree(null !== (_t = this.dataset.rowHeaderTree) && void 0 !== _t ? _t : [], this.layoutNodeId),
79
+ this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
80
+ this.refreshHeader(), this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new Title(options.title, this),
54
81
  this.scenegraph.resize()), setTimeout((() => {
55
82
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
56
83
  }), 0);
@@ -83,10 +110,13 @@ export class PivotChart extends BaseTable {
83
110
  return ifCan;
84
111
  }
85
112
  updateOption(options) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
113
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
87
114
  const internalProps = this.internalProps;
88
- super.updateOption(options), this.internalProps.columns = cloneDeep(options.columns),
89
- this.internalProps.rows = cloneDeep(options.rows), this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? cloneDeepSpec(options.indicators) : [],
115
+ let columnDimensionTree, rowDimensionTree;
116
+ super.updateOption(options), this.layoutNodeId = {
117
+ seqId: 0
118
+ }, this.internalProps.columns = cloneDeep(options.columns), this.internalProps.rows = cloneDeep(options.rows),
119
+ this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? cloneDeepSpec(options.indicators) : [],
90
120
  this.internalProps.columnTree = !options.indicatorsAsCol || (null === (_b = options.columns) || void 0 === _b ? void 0 : _b.length) || options.columnTree ? cloneDeep(options.columnTree) : [],
91
121
  this.internalProps.rowTree = options.indicatorsAsCol || (null === (_c = options.rows) || void 0 === _c ? void 0 : _c.length) || options.rowTree ? cloneDeep(options.rowTree) : [],
92
122
  options.records && (this.internalProps.records = options.records), this.setCustomStateNameToSpec(),
@@ -94,17 +124,35 @@ export class PivotChart extends BaseTable {
94
124
  internalProps.rowResizeType = null !== (_e = options.rowResizeType) && void 0 !== _e ? _e : "row",
95
125
  internalProps.dataConfig = {
96
126
  isPivotChart: !0
97
- }, this._axes = isArray(options.axes) ? options.axes : [];
98
- const rowKeys = null !== (_g = null === (_f = options.rows) || void 0 === _f ? void 0 : _f.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
99
- keys)), [])) && void 0 !== _g ? _g : [], columnKeys = null !== (_j = null === (_h = options.columns) || void 0 === _h ? void 0 : _h.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
100
- keys)), [])) && void 0 !== _j ? _j : [], indicatorKeys = null !== (_l = null === (_k = options.indicators) || void 0 === _k ? void 0 : _k.reduce(((keys, indicatorObj) => ("string" == typeof indicatorObj ? keys.push(indicatorObj) : keys.push(indicatorObj.indicatorKey),
101
- keys)), [])) && void 0 !== _l ? _l : [];
102
- return this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
127
+ }, this._axes = isArray(options.axes) ? options.axes : [], options.columnTree && (columnDimensionTree = new DimensionTree(null !== (_f = this.internalProps.columnTree) && void 0 !== _f ? _f : [], this.layoutNodeId)),
128
+ options.rowTree && (rowDimensionTree = new DimensionTree(null !== (_g = this.internalProps.rowTree) && void 0 !== _g ? _g : [], this.layoutNodeId));
129
+ const rowKeys = (null === (_h = null == rowDimensionTree ? void 0 : rowDimensionTree.dimensionKeys) || void 0 === _h ? void 0 : _h.count) ? rowDimensionTree.dimensionKeys.valueArr() : null !== (_k = null === (_j = options.rows) || void 0 === _j ? void 0 : _j.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
130
+ keys)), [])) && void 0 !== _k ? _k : [], columnKeys = (null === (_l = null == columnDimensionTree ? void 0 : columnDimensionTree.dimensionKeys) || void 0 === _l ? void 0 : _l.count) ? columnDimensionTree.dimensionKeys.valueArr() : null !== (_o = null === (_m = options.columns) || void 0 === _m ? void 0 : _m.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
131
+ keys)), [])) && void 0 !== _o ? _o : [], indicatorKeys = null !== (_q = null === (_p = options.indicators) || void 0 === _p ? void 0 : _p.reduce(((keys, indicatorObj) => ("string" == typeof indicatorObj ? keys.push(indicatorObj) : keys.push(indicatorObj.indicatorKey),
132
+ keys)), [])) && void 0 !== _q ? _q : [];
133
+ if (this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
103
134
  this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules(),
104
135
  this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray(),
105
- this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_m = options.indicatorsAsCol) || void 0 === _m || _m, null !== (_o = options.records) && void 0 !== _o ? _o : this.internalProps.records, void 0, this.internalProps.columnTree, this.internalProps.rowTree, !0),
106
- internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset), this.refreshHeader(),
107
- internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
136
+ this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_r = options.indicatorsAsCol) || void 0 === _r || _r, null !== (_s = options.records) && void 0 !== _s ? _s : this.internalProps.records, void 0, this.internalProps.columnTree, this.internalProps.rowTree, !0),
137
+ this.options.indicatorsAsCol && checkHasCartesianChart(this.internalProps.indicators)) {
138
+ const supplyAxisNode = nodes => {
139
+ nodes.forEach((node => {
140
+ var _a;
141
+ (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) ? supplyAxisNode(node.children) : node.children = [ {
142
+ dimensionKey: "axis",
143
+ value: ""
144
+ } ];
145
+ }));
146
+ };
147
+ (null === (_t = this.dataset.rowHeaderTree) || void 0 === _t ? void 0 : _t.length) ? supplyAxisNode(this.dataset.rowHeaderTree) : this.dataset.rowHeaderTree = [ {
148
+ dimensionKey: "axis",
149
+ value: ""
150
+ } ];
151
+ }
152
+ return columnDimensionTree = new DimensionTree(null !== (_u = this.dataset.colHeaderTree) && void 0 !== _u ? _u : [], this.layoutNodeId),
153
+ rowDimensionTree = new DimensionTree(null !== (_v = this.dataset.rowHeaderTree) && void 0 !== _v ? _v : [], this.layoutNodeId),
154
+ internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
155
+ this.refreshHeader(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
108
156
  var _a;
109
157
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
110
158
  })), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
@@ -172,7 +220,7 @@ export class PivotChart extends BaseTable {
172
220
  })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
173
221
  var _a;
174
222
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
175
- })), aggregator = this.dataset.getAggregator(this.internalProps.layoutMap.indicatorsAsCol ? rowKeys : rowKeys.slice(0, -1), this.internalProps.layoutMap.indicatorsAsCol ? colKeys.slice(0, -1) : colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
223
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
176
224
  return aggregator.value ? aggregator.value() : void 0;
177
225
  }
178
226
  const {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row), rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col), dataValue = null === (_c = this.records[rowIndex]) || void 0 === _c ? void 0 : _c[colIndex];
@@ -203,7 +251,7 @@ export class PivotChart extends BaseTable {
203
251
  })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
204
252
  var _a;
205
253
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
206
- })), aggregator = this.dataset.getAggregator(this.internalProps.layoutMap.indicatorsAsCol ? rowKeys : rowKeys.slice(0, -1), this.internalProps.layoutMap.indicatorsAsCol ? colKeys.slice(0, -1) : colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
254
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
207
255
  return aggregator.value ? aggregator.value() : void 0;
208
256
  }
209
257
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -221,7 +269,7 @@ export class PivotChart extends BaseTable {
221
269
  var _a;
222
270
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
223
271
  }));
224
- return this.dataset.getAggregator(this.internalProps.layoutMap.indicatorsAsCol ? rowKeys : rowKeys.slice(0, -1), this.internalProps.layoutMap.indicatorsAsCol ? colKeys.slice(0, -1) : colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
272
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
225
273
  }
226
274
  }
227
275
  getCellRawRecord(col, row) {
@@ -318,6 +366,8 @@ export class PivotChart extends BaseTable {
318
366
  }
319
367
  _generateCollectValuesConfig(columnKeys, rowKeys) {
320
368
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
369
+ columnKeys = columnKeys.filter((key => key !== IndicatorDimensionKeyPlaceholder)),
370
+ rowKeys = rowKeys.filter((key => key !== IndicatorDimensionKeyPlaceholder));
321
371
  const indicators = this.internalProps.indicators, collectValuesBy = {};
322
372
  for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
323
373
  if ("pie" === (null === (_a = indicators[i].chartSpec) || void 0 === _a ? void 0 : _a.type) || "rose" === (null === (_b = indicators[i].chartSpec) || void 0 === _b ? void 0 : _b.type) || "radar" === (null === (_c = indicators[i].chartSpec) || void 0 === _c ? void 0 : _c.type) || "gauge" === (null === (_d = indicators[i].chartSpec) || void 0 === _d ? void 0 : _d.type) || "wordCloud" === (null === (_e = indicators[i].chartSpec) || void 0 === _e ? void 0 : _e.type)) continue;
@@ -565,14 +615,17 @@ export class PivotChart extends BaseTable {
565
615
  }
566
616
  }
567
617
  setRecords(records) {
618
+ var _a, _b;
568
619
  const oldHoverState = {
569
620
  col: this.stateManager.hover.cellPos.col,
570
621
  row: this.stateManager.hover.cellPos.row
571
622
  };
572
623
  this.options.records = this.internalProps.records = records;
573
- this.options;
574
- const internalProps = this.internalProps;
575
- this.dataset.setRecords(records), internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset),
624
+ const options = this.options, internalProps = this.internalProps;
625
+ let columnDimensionTree, rowDimensionTree;
626
+ this.dataset.setRecords(records), columnDimensionTree = options.columnTree ? internalProps.layoutMap.columnDimensionTree : new DimensionTree(null !== (_a = this.dataset.colHeaderTree) && void 0 !== _a ? _a : [], this.layoutNodeId),
627
+ rowDimensionTree = options.rowTree ? internalProps.layoutMap.rowDimensionTree : new DimensionTree(null !== (_b = this.dataset.rowHeaderTree) && void 0 !== _b ? _b : [], this.layoutNodeId),
628
+ internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
576
629
  this.refreshHeader(), this.scenegraph.clearCells(), this.clearCellStyleCache(),
577
630
  this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
578
631
  this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
@@ -596,5 +649,20 @@ export class PivotChart extends BaseTable {
596
649
  return !1;
597
650
  }
598
651
  changeRecordOrder(source, target) {}
652
+ getLayoutColumnTree() {
653
+ return this.internalProps.layoutMap.getLayoutColumnTree();
654
+ }
655
+ getLayoutColumnTreeCount() {
656
+ return this.internalProps.layoutMap.getLayoutColumnTreeCount();
657
+ }
658
+ getLayoutRowTree() {
659
+ return this.internalProps.layoutMap.getLayoutRowTree();
660
+ }
661
+ getLayoutRowTreeCount() {
662
+ return this.internalProps.layoutMap.getLayoutRowTreeCount();
663
+ }
664
+ getCellHeaderTreeNodes(col, row) {
665
+ return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
666
+ }
599
667
  }
600
668
  //# sourceMappingURL=PivotChart.js.map