@visactor/vtable 0.25.5 → 0.26.0-alpha.1

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 (105) 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 +4 -5
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/dataset/dataset.d.ts +20 -15
  10. package/cjs/dataset/dataset.js +88 -62
  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/event/listener/table-group.js +3 -10
  16. package/cjs/event/listener/table-group.js.map +1 -1
  17. package/cjs/index.d.ts +1 -1
  18. package/cjs/index.js +1 -1
  19. package/cjs/index.js.map +1 -1
  20. package/cjs/layout/chart-helper/get-chart-spec.d.ts +2 -1
  21. package/cjs/layout/chart-helper/get-chart-spec.js +3 -3
  22. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  23. package/cjs/layout/layout-helper.d.ts +12 -0
  24. package/cjs/layout/layout-helper.js +52 -4
  25. package/cjs/layout/layout-helper.js.map +1 -1
  26. package/cjs/layout/pivot-header-layout.d.ts +4 -3
  27. package/cjs/layout/pivot-header-layout.js +43 -47
  28. package/cjs/layout/pivot-header-layout.js.map +1 -1
  29. package/cjs/layout/tree-helper.d.ts +2 -0
  30. package/cjs/layout/tree-helper.js +19 -11
  31. package/cjs/layout/tree-helper.js.map +1 -1
  32. package/cjs/state/cell-move/adjust-header.js +1 -1
  33. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  34. package/cjs/state/resize/update-resize-column.js +1 -1
  35. package/cjs/state/resize/update-resize-column.js.map +1 -1
  36. package/cjs/state/resize/update-resize-row.js +5 -4
  37. package/cjs/state/resize/update-resize-row.js.map +1 -1
  38. package/cjs/tools/get-data-path/create-dataset.d.ts +9 -1
  39. package/cjs/tools/get-data-path/create-dataset.js +19 -8
  40. package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
  41. package/cjs/tools/get-data-path/index.js +12 -3
  42. package/cjs/tools/get-data-path/index.js.map +1 -1
  43. package/cjs/ts-types/base-table.d.ts +6 -4
  44. package/cjs/ts-types/base-table.js.map +1 -1
  45. package/cjs/ts-types/common.d.ts +2 -0
  46. package/cjs/ts-types/common.js.map +1 -1
  47. package/cjs/ts-types/menu.d.ts +1 -1
  48. package/cjs/ts-types/menu.js.map +1 -1
  49. package/cjs/ts-types/table-engine.d.ts +1 -0
  50. package/cjs/ts-types/table-engine.js.map +1 -1
  51. package/cjs/vrender.js.map +1 -1
  52. package/dist/vtable.js +902 -566
  53. package/dist/vtable.min.js +2 -2
  54. package/es/PivotChart.d.ts +9 -0
  55. package/es/PivotChart.js +97 -29
  56. package/es/PivotChart.js.map +1 -1
  57. package/es/PivotTable.d.ts +5 -2
  58. package/es/PivotTable.js +188 -148
  59. package/es/PivotTable.js.map +1 -1
  60. package/es/core/BaseTable.js +4 -5
  61. package/es/core/BaseTable.js.map +1 -1
  62. package/es/dataset/dataset.d.ts +20 -15
  63. package/es/dataset/dataset.js +89 -61
  64. package/es/dataset/dataset.js.map +1 -1
  65. package/es/dataset/statistics-helper.d.ts +13 -2
  66. package/es/dataset/statistics-helper.js +22 -27
  67. package/es/dataset/statistics-helper.js.map +1 -1
  68. package/es/event/listener/table-group.js +2 -11
  69. package/es/event/listener/table-group.js.map +1 -1
  70. package/es/index.d.ts +1 -1
  71. package/es/index.js +1 -1
  72. package/es/index.js.map +1 -1
  73. package/es/layout/chart-helper/get-chart-spec.d.ts +2 -1
  74. package/es/layout/chart-helper/get-chart-spec.js +3 -3
  75. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  76. package/es/layout/layout-helper.d.ts +12 -0
  77. package/es/layout/layout-helper.js +50 -0
  78. package/es/layout/layout-helper.js.map +1 -1
  79. package/es/layout/pivot-header-layout.d.ts +4 -3
  80. package/es/layout/pivot-header-layout.js +41 -46
  81. package/es/layout/pivot-header-layout.js.map +1 -1
  82. package/es/layout/tree-helper.d.ts +2 -0
  83. package/es/layout/tree-helper.js +19 -11
  84. package/es/layout/tree-helper.js.map +1 -1
  85. package/es/state/cell-move/adjust-header.js +1 -1
  86. package/es/state/cell-move/adjust-header.js.map +1 -1
  87. package/es/state/resize/update-resize-column.js +1 -1
  88. package/es/state/resize/update-resize-column.js.map +1 -1
  89. package/es/state/resize/update-resize-row.js +5 -4
  90. package/es/state/resize/update-resize-row.js.map +1 -1
  91. package/es/tools/get-data-path/create-dataset.d.ts +9 -1
  92. package/es/tools/get-data-path/create-dataset.js +20 -7
  93. package/es/tools/get-data-path/create-dataset.js.map +1 -1
  94. package/es/tools/get-data-path/index.js +15 -2
  95. package/es/tools/get-data-path/index.js.map +1 -1
  96. package/es/ts-types/base-table.d.ts +6 -4
  97. package/es/ts-types/base-table.js.map +1 -1
  98. package/es/ts-types/common.d.ts +2 -0
  99. package/es/ts-types/common.js.map +1 -1
  100. package/es/ts-types/menu.d.ts +1 -1
  101. package/es/ts-types/menu.js.map +1 -1
  102. package/es/ts-types/table-engine.d.ts +1 -0
  103. package/es/ts-types/table-engine.js.map +1 -1
  104. package/es/vrender.js.map +1 -1
  105. 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/cjs/PivotChart.js CHANGED
@@ -4,14 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.PivotChart = void 0;
6
6
 
7
- const ts_types_1 = require("./ts-types"), ts_types_2 = require("./ts-types"), pivot_header_layout_1 = require("./layout/pivot-header-layout"), PIVOT_TABLE_EVENT_TYPE_1 = require("./ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE"), helper_1 = require("./tools/helper"), dataset_1 = require("./dataset/dataset"), tableHelper_1 = require("./core/tableHelper"), BaseTable_1 = require("./core/BaseTable"), update_chart_1 = require("./scenegraph/refresh-node/update-chart"), vutils_1 = require("@visactor/vutils"), title_1 = require("./components/title/title"), env_1 = require("./tools/env"), TABLE_EVENT_TYPE_1 = require("./core/TABLE_EVENT_TYPE"), vutil_extension_temp_1 = require("./vutil-extension-temp");
7
+ const ts_types_1 = require("./ts-types"), ts_types_2 = require("./ts-types"), pivot_header_layout_1 = require("./layout/pivot-header-layout"), PIVOT_TABLE_EVENT_TYPE_1 = require("./ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE"), helper_1 = require("./tools/helper"), dataset_1 = require("./dataset/dataset"), tableHelper_1 = require("./core/tableHelper"), BaseTable_1 = require("./core/BaseTable"), update_chart_1 = require("./scenegraph/refresh-node/update-chart"), vutils_1 = require("@visactor/vutils"), title_1 = require("./components/title/title"), env_1 = require("./tools/env"), TABLE_EVENT_TYPE_1 = require("./core/TABLE_EVENT_TYPE"), vutil_extension_temp_1 = require("./vutil-extension-temp"), tree_helper_1 = require("./layout/tree-helper"), global_1 = require("./tools/global"), get_chart_spec_1 = require("./layout/chart-helper/get-chart-spec");
8
8
 
9
9
  class PivotChart extends BaseTable_1.BaseTable {
10
10
  constructor(container, options) {
11
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
11
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
12
+ let columnDimensionTree, rowDimensionTree;
12
13
  "node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
13
14
  container = container.container ? container.container : null), super(container, options),
14
- this._selectedDataItemsInChart = [], this._selectedDimensionInChart = [], this._chartEventMap = {},
15
+ this.layoutNodeId = {
16
+ seqId: 0
17
+ }, this._selectedDataItemsInChart = [], this._selectedDimensionInChart = [], this._chartEventMap = {},
15
18
  options.layout && Object.assign(options, options.layout), this.internalProps.columns = (0,
16
19
  vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0, vutils_1.cloneDeep)(options.rows),
17
20
  this.internalProps.indicators = (0, vutil_extension_temp_1.cloneDeepSpec)(options.indicators),
@@ -22,16 +25,34 @@ class PivotChart extends BaseTable_1.BaseTable {
22
25
  this.internalProps.rowResizeType = null !== (_d = options.rowResizeType) && void 0 !== _d ? _d : "row",
23
26
  this.internalProps.dataConfig = {
24
27
  isPivotChart: !0
25
- }, this._axes = (0, vutils_1.isArray)(options.axes) ? options.axes : [];
26
- 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),
27
- 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),
28
- 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),
29
- keys)), [])) && void 0 !== _k ? _k : [];
30
- this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
28
+ }, this._axes = (0, vutils_1.isArray)(options.axes) ? options.axes : [], options.columnTree && (columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_e = this.internalProps.columnTree) && void 0 !== _e ? _e : [], this.layoutNodeId)),
29
+ options.rowTree && (rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_f = this.internalProps.rowTree) && void 0 !== _f ? _f : [], this.layoutNodeId));
30
+ 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),
31
+ 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),
32
+ 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),
33
+ keys)), [])) && void 0 !== _p ? _p : [];
34
+ if (this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
31
35
  this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules(),
32
36
  this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray(),
33
- this.dataset = new dataset_1.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),
34
- this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset),
37
+ this.dataset = new dataset_1.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),
38
+ this.options.indicatorsAsCol && (0, get_chart_spec_1.checkHasCartesianChart)(this.internalProps.indicators)) {
39
+ const supplyAxisNode = nodes => {
40
+ nodes.forEach((node => {
41
+ var _a;
42
+ (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) ? supplyAxisNode(node.children) : node.children = [ {
43
+ dimensionKey: "axis",
44
+ value: ""
45
+ } ];
46
+ }));
47
+ };
48
+ (null === (_r = this.dataset.rowHeaderTree) || void 0 === _r ? void 0 : _r.length) ? supplyAxisNode(this.dataset.rowHeaderTree) : this.dataset.rowHeaderTree = [ {
49
+ dimensionKey: "axis",
50
+ value: ""
51
+ } ];
52
+ }
53
+ columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_s = this.dataset.colHeaderTree) && void 0 !== _s ? _s : [], this.layoutNodeId),
54
+ rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_t = this.dataset.rowHeaderTree) && void 0 !== _t ? _t : [], this.layoutNodeId),
55
+ this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
35
56
  this.refreshHeader(), this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new title_1.Title(options.title, this),
36
57
  this.scenegraph.resize()), setTimeout((() => {
37
58
  this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
@@ -65,10 +86,13 @@ class PivotChart extends BaseTable_1.BaseTable {
65
86
  return ifCan;
66
87
  }
67
88
  updateOption(options) {
68
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
89
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
69
90
  const internalProps = this.internalProps;
70
- super.updateOption(options), this.internalProps.columns = (0, vutils_1.cloneDeep)(options.columns),
71
- this.internalProps.rows = (0, vutils_1.cloneDeep)(options.rows), this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? (0,
91
+ let columnDimensionTree, rowDimensionTree;
92
+ super.updateOption(options), this.layoutNodeId = {
93
+ seqId: 0
94
+ }, this.internalProps.columns = (0, vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0,
95
+ vutils_1.cloneDeep)(options.rows), this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? (0,
72
96
  vutil_extension_temp_1.cloneDeepSpec)(options.indicators) : [], this.internalProps.columnTree = !options.indicatorsAsCol || (null === (_b = options.columns) || void 0 === _b ? void 0 : _b.length) || options.columnTree ? (0,
73
97
  vutils_1.cloneDeep)(options.columnTree) : [], this.internalProps.rowTree = options.indicatorsAsCol || (null === (_c = options.rows) || void 0 === _c ? void 0 : _c.length) || options.rowTree ? (0,
74
98
  vutils_1.cloneDeep)(options.rowTree) : [], options.records && (this.internalProps.records = options.records),
@@ -76,16 +100,34 @@ class PivotChart extends BaseTable_1.BaseTable {
76
100
  internalProps.rowResizeType = null !== (_e = options.rowResizeType) && void 0 !== _e ? _e : "row",
77
101
  internalProps.dataConfig = {
78
102
  isPivotChart: !0
79
- }, this._axes = (0, vutils_1.isArray)(options.axes) ? options.axes : [];
80
- 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),
81
- 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),
82
- 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),
83
- keys)), [])) && void 0 !== _l ? _l : [];
84
- return this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
103
+ }, this._axes = (0, vutils_1.isArray)(options.axes) ? options.axes : [], options.columnTree && (columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_f = this.internalProps.columnTree) && void 0 !== _f ? _f : [], this.layoutNodeId)),
104
+ options.rowTree && (rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_g = this.internalProps.rowTree) && void 0 !== _g ? _g : [], this.layoutNodeId));
105
+ 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),
106
+ 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),
107
+ 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),
108
+ keys)), [])) && void 0 !== _q ? _q : [];
109
+ if (this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys),
85
110
  this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules(),
86
111
  this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray(),
87
- this.dataset = new dataset_1.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),
88
- internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset),
112
+ this.dataset = new dataset_1.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),
113
+ this.options.indicatorsAsCol && (0, get_chart_spec_1.checkHasCartesianChart)(this.internalProps.indicators)) {
114
+ const supplyAxisNode = nodes => {
115
+ nodes.forEach((node => {
116
+ var _a;
117
+ (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) ? supplyAxisNode(node.children) : node.children = [ {
118
+ dimensionKey: "axis",
119
+ value: ""
120
+ } ];
121
+ }));
122
+ };
123
+ (null === (_t = this.dataset.rowHeaderTree) || void 0 === _t ? void 0 : _t.length) ? supplyAxisNode(this.dataset.rowHeaderTree) : this.dataset.rowHeaderTree = [ {
124
+ dimensionKey: "axis",
125
+ value: ""
126
+ } ];
127
+ }
128
+ return columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_u = this.dataset.colHeaderTree) && void 0 !== _u ? _u : [], this.layoutNodeId),
129
+ rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_v = this.dataset.rowHeaderTree) && void 0 !== _v ? _v : [], this.layoutNodeId),
130
+ internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
89
131
  this.refreshHeader(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
90
132
  var _a;
91
133
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
@@ -154,7 +196,7 @@ class PivotChart extends BaseTable_1.BaseTable {
154
196
  })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
155
197
  var _a;
156
198
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
157
- })), 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));
199
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
158
200
  return aggregator.value ? aggregator.value() : void 0;
159
201
  }
160
202
  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];
@@ -185,7 +227,7 @@ class PivotChart extends BaseTable_1.BaseTable {
185
227
  })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
186
228
  var _a;
187
229
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
188
- })), 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));
230
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
189
231
  return aggregator.value ? aggregator.value() : void 0;
190
232
  }
191
233
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -203,7 +245,7 @@ class PivotChart extends BaseTable_1.BaseTable {
203
245
  var _a;
204
246
  return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
205
247
  }));
206
- 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;
248
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
207
249
  }
208
250
  }
209
251
  getCellRawRecord(col, row) {
@@ -300,6 +342,8 @@ class PivotChart extends BaseTable_1.BaseTable {
300
342
  }
301
343
  _generateCollectValuesConfig(columnKeys, rowKeys) {
302
344
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
345
+ columnKeys = columnKeys.filter((key => key !== global_1.IndicatorDimensionKeyPlaceholder)),
346
+ rowKeys = rowKeys.filter((key => key !== global_1.IndicatorDimensionKeyPlaceholder));
303
347
  const indicators = this.internalProps.indicators, collectValuesBy = {};
304
348
  for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
305
349
  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;
@@ -548,14 +592,17 @@ class PivotChart extends BaseTable_1.BaseTable {
548
592
  }
549
593
  }
550
594
  setRecords(records) {
595
+ var _a, _b;
551
596
  const oldHoverState = {
552
597
  col: this.stateManager.hover.cellPos.col,
553
598
  row: this.stateManager.hover.cellPos.row
554
599
  };
555
600
  this.options.records = this.internalProps.records = records;
556
- this.options;
557
- const internalProps = this.internalProps;
558
- this.dataset.setRecords(records), internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset),
601
+ const options = this.options, internalProps = this.internalProps;
602
+ let columnDimensionTree, rowDimensionTree;
603
+ this.dataset.setRecords(records), columnDimensionTree = options.columnTree ? internalProps.layoutMap.columnDimensionTree : new tree_helper_1.DimensionTree(null !== (_a = this.dataset.colHeaderTree) && void 0 !== _a ? _a : [], this.layoutNodeId),
604
+ rowDimensionTree = options.rowTree ? internalProps.layoutMap.rowDimensionTree : new tree_helper_1.DimensionTree(null !== (_b = this.dataset.rowHeaderTree) && void 0 !== _b ? _b : [], this.layoutNodeId),
605
+ internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
559
606
  this.refreshHeader(), this.scenegraph.clearCells(), this.clearCellStyleCache(),
560
607
  this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
561
608
  this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
@@ -579,6 +626,21 @@ class PivotChart extends BaseTable_1.BaseTable {
579
626
  return !1;
580
627
  }
581
628
  changeRecordOrder(source, target) {}
629
+ getLayoutColumnTree() {
630
+ return this.internalProps.layoutMap.getLayoutColumnTree();
631
+ }
632
+ getLayoutColumnTreeCount() {
633
+ return this.internalProps.layoutMap.getLayoutColumnTreeCount();
634
+ }
635
+ getLayoutRowTree() {
636
+ return this.internalProps.layoutMap.getLayoutRowTree();
637
+ }
638
+ getLayoutRowTreeCount() {
639
+ return this.internalProps.layoutMap.getLayoutRowTreeCount();
640
+ }
641
+ getCellHeaderTreeNodes(col, row) {
642
+ return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
643
+ }
582
644
  }
583
645
 
584
646
  exports.PivotChart = PivotChart;