@visactor/vtable 0.18.0-alpha.3 → 0.18.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.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +50 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +102 -83
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +4 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +3 -1
- package/cjs/data/DataSource.js +27 -7
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.js +2 -2
- package/cjs/event/pivot-chart/axis-click.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.js +5 -5
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.d.ts +3 -0
- package/cjs/layout/chart-helper/get-chart-spec.js +43 -7
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +4 -3
- package/cjs/layout/pivot-header-layout.js +41 -21
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +5 -0
- package/cjs/scenegraph/component/custom.js +20 -3
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +6 -3
- package/cjs/scenegraph/group-creater/cell-helper.js +38 -36
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +11 -7
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.d.ts +2 -1
- package/cjs/scenegraph/layout/move-cell.js +15 -27
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +21 -17
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +40 -17
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -2
- package/cjs/scenegraph/scenegraph.js +10 -7
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js +4 -0
- package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +3 -3
- package/cjs/scenegraph/utils/text-icon-layout.js +12 -10
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +4 -2
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/themes/ARCO.js +2 -1
- package/cjs/themes/BRIGHT.js +1 -2
- package/cjs/ts-types/table-engine.d.ts +5 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1562 -1204
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +49 -2
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +102 -83
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +4 -4
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +3 -1
- package/es/data/DataSource.js +27 -7
- package/es/data/DataSource.js.map +1 -1
- package/es/event/pivot-chart/axis-click.js +2 -2
- package/es/event/pivot-chart/axis-click.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.js +5 -5
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.d.ts +3 -0
- package/es/layout/chart-helper/get-chart-spec.js +38 -4
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +4 -3
- package/es/layout/pivot-header-layout.js +36 -21
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +5 -0
- package/es/scenegraph/component/custom.js +18 -0
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +6 -3
- package/es/scenegraph/group-creater/cell-helper.js +36 -35
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +6 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +11 -6
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/es/scenegraph/layout/move-cell.d.ts +2 -1
- package/es/scenegraph/layout/move-cell.js +12 -20
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +20 -16
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +39 -16
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -2
- package/es/scenegraph/scenegraph.js +9 -6
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-cell-merge.js +4 -0
- package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.d.ts +3 -3
- package/es/scenegraph/utils/text-icon-layout.js +10 -10
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +4 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/themes/ARCO.js +2 -1
- package/es/themes/BRIGHT.js +1 -2
- package/es/ts-types/table-engine.d.ts +5 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/cjs/PivotChart.js
CHANGED
|
@@ -131,10 +131,18 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
131
131
|
return layoutMap.getBodyIndexByCol(col);
|
|
132
132
|
}
|
|
133
133
|
getCellValue(col, row) {
|
|
134
|
-
var _a;
|
|
134
|
+
var _a, _b, _c;
|
|
135
135
|
const customMergeText = this.getCustomMergeValue(col, row);
|
|
136
136
|
if (customMergeText) return customMergeText;
|
|
137
137
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
138
|
+
if (this.internalProps.layoutMap.isBottomFrozenRow(col, row) || this.internalProps.layoutMap.isRightFrozenColumn(col, row)) {
|
|
139
|
+
const indicatorKeys = this.internalProps.layoutMap.getIndicatorKeyInChartSpec(col, row);
|
|
140
|
+
let indicatorInfo;
|
|
141
|
+
return null == indicatorKeys || indicatorKeys.forEach((key => {
|
|
142
|
+
const info = this.internalProps.layoutMap.getIndicatorInfo(key);
|
|
143
|
+
info && (indicatorInfo = info);
|
|
144
|
+
})), null !== (_b = null !== (_a = null == indicatorInfo ? void 0 : indicatorInfo.title) && void 0 !== _a ? _a : null == indicatorInfo ? void 0 : indicatorInfo.indicatorKey) && void 0 !== _b ? _b : "";
|
|
145
|
+
}
|
|
138
146
|
const {title: title, fieldFormat: fieldFormat} = this.internalProps.layoutMap.getHeader(col, row);
|
|
139
147
|
return "function" == typeof fieldFormat ? fieldFormat(title, col, row, this) : title;
|
|
140
148
|
}
|
|
@@ -148,16 +156,24 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
148
156
|
})), 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));
|
|
149
157
|
return aggregator.value ? aggregator.value() : void 0;
|
|
150
158
|
}
|
|
151
|
-
const {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row), rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col), dataValue = null === (
|
|
159
|
+
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];
|
|
152
160
|
if ("function" == typeof fieldFormat) {
|
|
153
161
|
return fieldFormat(dataValue, col, row, this);
|
|
154
162
|
}
|
|
155
163
|
return dataValue;
|
|
156
164
|
}
|
|
157
165
|
getCellOriginValue(col, row) {
|
|
158
|
-
var _a;
|
|
166
|
+
var _a, _b, _c;
|
|
159
167
|
const table = this;
|
|
160
168
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
169
|
+
if (this.internalProps.layoutMap.isBottomFrozenRow(col, row) || this.internalProps.layoutMap.isRightFrozenColumn(col, row)) {
|
|
170
|
+
const indicatorKeys = this.internalProps.layoutMap.getIndicatorKeyInChartSpec(col, row);
|
|
171
|
+
let indicatorInfo;
|
|
172
|
+
return null == indicatorKeys || indicatorKeys.forEach((key => {
|
|
173
|
+
const info = this.internalProps.layoutMap.getIndicatorInfo(key);
|
|
174
|
+
info && (indicatorInfo = info);
|
|
175
|
+
})), null !== (_b = null !== (_a = null == indicatorInfo ? void 0 : indicatorInfo.title) && void 0 !== _a ? _a : null == indicatorInfo ? void 0 : indicatorInfo.indicatorKey) && void 0 !== _b ? _b : "";
|
|
176
|
+
}
|
|
161
177
|
const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
|
|
162
178
|
return "function" == typeof title ? title() : title;
|
|
163
179
|
}
|
|
@@ -172,7 +188,7 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
172
188
|
return aggregator.value ? aggregator.value() : void 0;
|
|
173
189
|
}
|
|
174
190
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
175
|
-
return null === (
|
|
191
|
+
return null === (_c = this.records[rowIndex]) || void 0 === _c ? void 0 : _c[colIndex];
|
|
176
192
|
}
|
|
177
193
|
getCellRawValue(col, row) {
|
|
178
194
|
return this.getCellOriginValue(col, row);
|
|
@@ -284,87 +300,90 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
284
300
|
};
|
|
285
301
|
}
|
|
286
302
|
_generateCollectValuesConfig(columnKeys, rowKeys) {
|
|
287
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
288
304
|
const indicators = this.internalProps.indicators, collectValuesBy = {};
|
|
289
|
-
for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec)
|
|
290
|
-
|
|
291
|
-
if (!1
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
sumBy: (null === (_d = indicatorDefine.chartSpec) || void 0 === _d ? void 0 : _d.stack) && columnKeys.concat(null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.xField)
|
|
296
|
-
}, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
|
|
297
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
298
|
-
const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
|
|
299
|
-
collectValuesBy[xField] = {
|
|
300
|
-
by: columnKeys,
|
|
301
|
-
type: "horizontal" !== chartSeries.direction ? "xField" : void 0,
|
|
302
|
-
range: "horizontal" === chartSeries.direction,
|
|
303
|
-
sortBy: "horizontal" !== chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[xField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[xField]) || void 0 === _h ? void 0 : _h.domain : void 0
|
|
304
|
-
};
|
|
305
|
-
const yField = chartSeries.yField;
|
|
306
|
-
!1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
|
|
307
|
-
collectValuesBy[yField] = {
|
|
308
|
-
by: rowKeys,
|
|
309
|
-
range: "horizontal" !== chartSeries.direction,
|
|
310
|
-
sumBy: chartSeries.stack && columnKeys.concat(null == chartSeries ? void 0 : chartSeries.xField),
|
|
311
|
-
sortBy: "horizontal" === chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[yField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[yField]) || void 0 === _r ? void 0 : _r.domain : void 0
|
|
312
|
-
};
|
|
313
|
-
})); else {
|
|
314
|
-
const xField = "string" == typeof indicatorDefine.chartSpec.xField ? indicatorDefine.chartSpec.xField : indicatorDefine.chartSpec.xField[0];
|
|
315
|
-
collectValuesBy[xField] = {
|
|
316
|
-
by: columnKeys,
|
|
317
|
-
type: "horizontal" !== indicatorDefine.chartSpec.direction ? "xField" : void 0,
|
|
318
|
-
range: "horizontal" === indicatorDefine.chartSpec.direction,
|
|
319
|
-
sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_j = null === (_h = null === (_g = null === (_f = indicatorDefine.chartSpec) || void 0 === _f ? void 0 : _f.data) || void 0 === _g ? void 0 : _g.fields) || void 0 === _h ? void 0 : _h[xField]) || void 0 === _j ? void 0 : _j.domain : void 0
|
|
320
|
-
}, !1 !== (null === (_k = indicatorDefine.chartSpec) || void 0 === _k ? void 0 : _k.stack) && ("bar" === (null === (_l = indicatorDefine.chartSpec) || void 0 === _l ? void 0 : _l.type) || "area" === (null === (_m = indicatorDefine.chartSpec) || void 0 === _m ? void 0 : _m.type)) && (indicatorDefine.chartSpec.stack = !0);
|
|
321
|
-
const yField = indicatorDefine.chartSpec.yField;
|
|
322
|
-
collectValuesBy[yField] = {
|
|
305
|
+
for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
|
|
306
|
+
if ("pie" === (null === (_a = indicators[i].chartSpec) || void 0 === _a ? void 0 : _a.type)) continue;
|
|
307
|
+
if (!1 === this.options.indicatorsAsCol) {
|
|
308
|
+
const indicatorDefine = indicators[i];
|
|
309
|
+
if (!1 !== (null === (_b = indicatorDefine.chartSpec) || void 0 === _b ? void 0 : _b.stack) && ("bar" === (null === (_c = indicatorDefine.chartSpec) || void 0 === _c ? void 0 : _c.type) || "area" === (null === (_d = indicatorDefine.chartSpec) || void 0 === _d ? void 0 : _d.type)) && (indicatorDefine.chartSpec.stack = !0),
|
|
310
|
+
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
323
311
|
by: rowKeys,
|
|
324
|
-
range:
|
|
325
|
-
sumBy: indicatorDefine.chartSpec.stack && columnKeys.concat(null === (
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
collectValuesBy[
|
|
312
|
+
range: !0,
|
|
313
|
+
sumBy: (null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.stack) && columnKeys.concat(null === (_f = indicatorDefine.chartSpec) || void 0 === _f ? void 0 : _f.xField)
|
|
314
|
+
}, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
|
|
315
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
316
|
+
const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
|
|
317
|
+
collectValuesBy[xField] = {
|
|
318
|
+
by: columnKeys,
|
|
319
|
+
type: "horizontal" !== chartSeries.direction ? "xField" : void 0,
|
|
320
|
+
range: "horizontal" === chartSeries.direction,
|
|
321
|
+
sortBy: "horizontal" !== chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[xField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[xField]) || void 0 === _h ? void 0 : _h.domain : void 0
|
|
322
|
+
};
|
|
323
|
+
const yField = chartSeries.yField;
|
|
324
|
+
!1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
|
|
325
|
+
collectValuesBy[yField] = {
|
|
326
|
+
by: rowKeys,
|
|
327
|
+
range: "horizontal" !== chartSeries.direction,
|
|
328
|
+
sumBy: chartSeries.stack && columnKeys.concat(null == chartSeries ? void 0 : chartSeries.xField),
|
|
329
|
+
sortBy: "horizontal" === chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[yField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[yField]) || void 0 === _r ? void 0 : _r.domain : void 0
|
|
330
|
+
};
|
|
331
|
+
})); else {
|
|
332
|
+
const xField = "string" == typeof indicatorDefine.chartSpec.xField ? indicatorDefine.chartSpec.xField : indicatorDefine.chartSpec.xField[0];
|
|
333
|
+
collectValuesBy[xField] = {
|
|
334
|
+
by: columnKeys,
|
|
335
|
+
type: "horizontal" !== indicatorDefine.chartSpec.direction ? "xField" : void 0,
|
|
336
|
+
range: "horizontal" === indicatorDefine.chartSpec.direction,
|
|
337
|
+
sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_k = null === (_j = null === (_h = null === (_g = indicatorDefine.chartSpec) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h.fields) || void 0 === _j ? void 0 : _j[xField]) || void 0 === _k ? void 0 : _k.domain : void 0
|
|
338
|
+
}, !1 !== (null === (_l = indicatorDefine.chartSpec) || void 0 === _l ? void 0 : _l.stack) && ("bar" === (null === (_m = indicatorDefine.chartSpec) || void 0 === _m ? void 0 : _m.type) || "area" === (null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.type)) && (indicatorDefine.chartSpec.stack = !0);
|
|
339
|
+
const yField = indicatorDefine.chartSpec.yField;
|
|
340
|
+
collectValuesBy[yField] = {
|
|
341
|
+
by: rowKeys,
|
|
342
|
+
range: "horizontal" !== indicators[i].chartSpec.direction,
|
|
343
|
+
sumBy: indicatorDefine.chartSpec.stack && columnKeys.concat(null === (_p = indicatorDefine.chartSpec) || void 0 === _p ? void 0 : _p.xField),
|
|
344
|
+
sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_t = null === (_s = null === (_r = null === (_q = indicatorDefine.chartSpec) || void 0 === _q ? void 0 : _q.data) || void 0 === _r ? void 0 : _r.fields) || void 0 === _s ? void 0 : _s[yField]) || void 0 === _t ? void 0 : _t.domain : void 0
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
const indicatorDefine = indicators[i];
|
|
349
|
+
if (!1 !== (null === (_u = indicatorDefine.chartSpec) || void 0 === _u ? void 0 : _u.stack) && ("bar" === (null === (_v = indicatorDefine.chartSpec) || void 0 === _v ? void 0 : _v.type) || "area" === (null === (_w = indicatorDefine.chartSpec) || void 0 === _w ? void 0 : _w.type)) && (indicatorDefine.chartSpec.stack = !0),
|
|
350
|
+
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
363
351
|
by: columnKeys,
|
|
364
|
-
range:
|
|
365
|
-
sumBy: indicatorDefine.chartSpec.stack && rowKeys.concat(null === (
|
|
366
|
-
|
|
367
|
-
|
|
352
|
+
range: !0,
|
|
353
|
+
sumBy: (null === (_x = indicatorDefine.chartSpec) || void 0 === _x ? void 0 : _x.stack) && rowKeys.concat(null === (_y = indicatorDefine.chartSpec) || void 0 === _y ? void 0 : _y.yField)
|
|
354
|
+
}, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
|
|
355
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
356
|
+
const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
|
|
357
|
+
collectValuesBy[yField] = {
|
|
358
|
+
by: rowKeys,
|
|
359
|
+
type: "horizontal" === chartSeries.direction ? "yField" : void 0,
|
|
360
|
+
range: "horizontal" !== chartSeries.direction,
|
|
361
|
+
sortBy: "horizontal" === chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[yField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[yField]) || void 0 === _h ? void 0 : _h.domain : void 0
|
|
362
|
+
};
|
|
363
|
+
const xField = chartSeries.xField;
|
|
364
|
+
!1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
|
|
365
|
+
collectValuesBy[xField] = {
|
|
366
|
+
by: columnKeys,
|
|
367
|
+
range: "horizontal" === chartSeries.direction,
|
|
368
|
+
sumBy: chartSeries.stack && rowKeys.concat(null == chartSeries ? void 0 : chartSeries.yField),
|
|
369
|
+
sortBy: "horizontal" !== chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[xField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[xField]) || void 0 === _r ? void 0 : _r.domain : void 0
|
|
370
|
+
};
|
|
371
|
+
})); else {
|
|
372
|
+
const yField = "string" == typeof indicatorDefine.chartSpec.yField ? indicatorDefine.chartSpec.yField : indicatorDefine.chartSpec.yField[0];
|
|
373
|
+
collectValuesBy[yField] = {
|
|
374
|
+
by: rowKeys,
|
|
375
|
+
type: "horizontal" === indicatorDefine.chartSpec.direction ? "yField" : void 0,
|
|
376
|
+
range: "horizontal" !== indicatorDefine.chartSpec.direction,
|
|
377
|
+
sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_2 = null === (_1 = null === (_0 = null === (_z = indicatorDefine.chartSpec) || void 0 === _z ? void 0 : _z.data) || void 0 === _0 ? void 0 : _0.fields) || void 0 === _1 ? void 0 : _1[yField]) || void 0 === _2 ? void 0 : _2.domain : void 0
|
|
378
|
+
}, !1 !== (null === (_3 = indicatorDefine.chartSpec) || void 0 === _3 ? void 0 : _3.stack) && ("bar" === (null === (_4 = indicatorDefine.chartSpec) || void 0 === _4 ? void 0 : _4.type) || "area" === (null === (_5 = indicatorDefine.chartSpec) || void 0 === _5 ? void 0 : _5.type)) && (indicatorDefine.chartSpec.stack = !0);
|
|
379
|
+
const xField = indicatorDefine.chartSpec.xField;
|
|
380
|
+
collectValuesBy[xField] = {
|
|
381
|
+
by: columnKeys,
|
|
382
|
+
range: "horizontal" === indicators[i].chartSpec.direction,
|
|
383
|
+
sumBy: indicatorDefine.chartSpec.stack && rowKeys.concat(null === (_6 = indicatorDefine.chartSpec) || void 0 === _6 ? void 0 : _6.yField),
|
|
384
|
+
sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_10 = null === (_9 = null === (_8 = null === (_7 = indicatorDefine.chartSpec) || void 0 === _7 ? void 0 : _7.data) || void 0 === _8 ? void 0 : _8.fields) || void 0 === _9 ? void 0 : _9[xField]) || void 0 === _10 ? void 0 : _10.domain : void 0
|
|
385
|
+
};
|
|
386
|
+
}
|
|
368
387
|
}
|
|
369
388
|
}
|
|
370
389
|
return collectValuesBy;
|
|
@@ -477,7 +496,7 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
477
496
|
if (chartNode.attribute.chartInstance) {
|
|
478
497
|
chartInstance = chartNode.attribute.chartInstance;
|
|
479
498
|
const {dataId: dataId, data: data, axes: axes, spec: spec} = chartNode.attribute, viewBox = chartNode.getViewBox();
|
|
480
|
-
if (axes.forEach(((axis, index) => {
|
|
499
|
+
if (null == axes || axes.forEach(((axis, index) => {
|
|
481
500
|
var _a, _b, _c, _d;
|
|
482
501
|
"linear" === axis.type ? chartInstance.updateModelSpecSync({
|
|
483
502
|
type: "axes",
|