@visactor/vtable 0.23.1 → 0.23.2-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.
- package/cjs/PivotChart.js +58 -56
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +1 -0
- package/cjs/core/tableHelper.js +29 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset.js +6 -2
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/listener/table-group.js +7 -3
- package/cjs/event/listener/table-group.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/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/style/corner-cell.js +1 -1
- package/cjs/scenegraph/style/corner-cell.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +1 -1
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +1 -0
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +143 -80
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.js +59 -55
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +1 -0
- package/es/core/tableHelper.js +26 -0
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset.js +6 -2
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/listener/table-group.js +7 -3
- package/es/event/listener/table-group.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/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/style/corner-cell.js +1 -1
- package/es/scenegraph/style/corner-cell.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +1 -1
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +1 -0
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/cjs/PivotChart.js
CHANGED
|
@@ -4,7 +4,7 @@ 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"), 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");
|
|
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");
|
|
8
8
|
|
|
9
9
|
class PivotChart extends BaseTable_1.BaseTable {
|
|
10
10
|
constructor(container, options) {
|
|
@@ -306,65 +306,65 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
_generateCollectValuesConfig(columnKeys, rowKeys) {
|
|
309
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
309
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
310
310
|
const indicators = this.internalProps.indicators, collectValuesBy = {};
|
|
311
311
|
for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
|
|
312
312
|
if ("pie" === (null === (_a = indicators[i].chartSpec) || void 0 === _a ? void 0 : _a.type)) continue;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
const indicatorDefine = indicators[i], indicatorSpec = indicatorDefine.chartSpec;
|
|
314
|
+
if (!1 === this.options.indicatorsAsCol) if (!1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0),
|
|
315
|
+
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
316
|
+
by: rowKeys,
|
|
317
|
+
range: !0,
|
|
318
|
+
sumBy: (null == indicatorSpec ? void 0 : indicatorSpec.stack) && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField)
|
|
319
|
+
}, indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
320
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
321
|
+
const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
|
|
322
|
+
collectValuesBy[xField] = {
|
|
323
|
+
by: columnKeys,
|
|
324
|
+
type: "horizontal" !== chartSeries.direction ? "xField" : void 0,
|
|
325
|
+
range: "horizontal" === chartSeries.direction,
|
|
326
|
+
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 === (_g = null === (_f = null === (_e = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _e ? void 0 : _e.fields) || void 0 === _f ? void 0 : _f[xField]) || void 0 === _g ? void 0 : _g.domain : void 0
|
|
327
|
+
};
|
|
328
|
+
const yField = chartSeries.yField;
|
|
329
|
+
!1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
|
|
330
|
+
collectValuesBy[yField] = {
|
|
317
331
|
by: rowKeys,
|
|
318
|
-
range:
|
|
319
|
-
sumBy:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
collectValuesBy[xField] = {
|
|
340
|
-
by: columnKeys,
|
|
341
|
-
type: "horizontal" !== indicatorDefine.chartSpec.direction ? "xField" : void 0,
|
|
342
|
-
range: "horizontal" === indicatorDefine.chartSpec.direction,
|
|
343
|
-
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
|
|
344
|
-
}, !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);
|
|
345
|
-
const yField = indicatorDefine.chartSpec.yField;
|
|
346
|
-
collectValuesBy[yField] = {
|
|
347
|
-
by: rowKeys,
|
|
348
|
-
range: "horizontal" !== indicators[i].chartSpec.direction,
|
|
349
|
-
sumBy: indicatorDefine.chartSpec.stack && columnKeys.concat(null === (_p = indicatorDefine.chartSpec) || void 0 === _p ? void 0 : _p.xField),
|
|
350
|
-
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
|
|
351
|
-
};
|
|
352
|
-
}
|
|
332
|
+
range: "horizontal" !== chartSeries.direction,
|
|
333
|
+
sumBy: chartSeries.stack && columnKeys.concat(null == chartSeries ? void 0 : chartSeries.xField),
|
|
334
|
+
sortBy: "horizontal" === chartSeries.direction ? null !== (_l = null === (_k = null === (_j = null === (_h = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _h ? void 0 : _h.fields) || void 0 === _j ? void 0 : _j[yField]) || void 0 === _k ? void 0 : _k.domain) && void 0 !== _l ? _l : null === (_p = null === (_o = null === (_m = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _m ? void 0 : _m.fields) || void 0 === _o ? void 0 : _o[yField]) || void 0 === _p ? void 0 : _p.domain : void 0,
|
|
335
|
+
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
336
|
+
};
|
|
337
|
+
})); else {
|
|
338
|
+
const xField = "string" == typeof indicatorSpec.xField ? indicatorSpec.xField : indicatorSpec.xField[0];
|
|
339
|
+
collectValuesBy[xField] = {
|
|
340
|
+
by: columnKeys,
|
|
341
|
+
type: "horizontal" !== indicatorSpec.direction ? "xField" : void 0,
|
|
342
|
+
range: "horizontal" === indicatorSpec.direction,
|
|
343
|
+
sortBy: "horizontal" !== indicatorSpec.direction ? null === (_d = null === (_c = null === (_b = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _b ? void 0 : _b.fields) || void 0 === _c ? void 0 : _c[xField]) || void 0 === _d ? void 0 : _d.domain : void 0
|
|
344
|
+
}, !1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0);
|
|
345
|
+
const yField = indicatorSpec.yField;
|
|
346
|
+
collectValuesBy[yField] = {
|
|
347
|
+
by: rowKeys,
|
|
348
|
+
range: "horizontal" !== indicatorSpec.direction,
|
|
349
|
+
sumBy: indicatorSpec.stack && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField),
|
|
350
|
+
sortBy: "horizontal" === indicatorSpec.direction ? null === (_g = null === (_f = null === (_e = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _e ? void 0 : _e.fields) || void 0 === _f ? void 0 : _f[yField]) || void 0 === _g ? void 0 : _g.domain : void 0,
|
|
351
|
+
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
352
|
+
};
|
|
353
353
|
} else {
|
|
354
354
|
const indicatorDefine = indicators[i];
|
|
355
|
-
if (!1 !== (null
|
|
355
|
+
if (!1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0),
|
|
356
356
|
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
357
357
|
by: columnKeys,
|
|
358
358
|
range: !0,
|
|
359
|
-
sumBy: (null
|
|
360
|
-
},
|
|
361
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
359
|
+
sumBy: (null == indicatorSpec ? void 0 : indicatorSpec.stack) && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField)
|
|
360
|
+
}, indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
361
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
362
362
|
const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
|
|
363
363
|
collectValuesBy[yField] = {
|
|
364
364
|
by: rowKeys,
|
|
365
365
|
type: "horizontal" === chartSeries.direction ? "yField" : void 0,
|
|
366
366
|
range: "horizontal" !== chartSeries.direction,
|
|
367
|
-
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 === (
|
|
367
|
+
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 === (_g = null === (_f = null === (_e = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _e ? void 0 : _e.fields) || void 0 === _f ? void 0 : _f[yField]) || void 0 === _g ? void 0 : _g.domain : void 0
|
|
368
368
|
};
|
|
369
369
|
const xField = chartSeries.xField;
|
|
370
370
|
!1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
|
|
@@ -372,22 +372,24 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
372
372
|
by: columnKeys,
|
|
373
373
|
range: "horizontal" === chartSeries.direction,
|
|
374
374
|
sumBy: chartSeries.stack && rowKeys.concat(null == chartSeries ? void 0 : chartSeries.yField),
|
|
375
|
-
sortBy: "horizontal" !== chartSeries.direction ? null !== (
|
|
375
|
+
sortBy: "horizontal" !== chartSeries.direction ? null !== (_l = null === (_k = null === (_j = null === (_h = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _h ? void 0 : _h.fields) || void 0 === _j ? void 0 : _j[xField]) || void 0 === _k ? void 0 : _k.domain) && void 0 !== _l ? _l : null === (_p = null === (_o = null === (_m = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _m ? void 0 : _m.fields) || void 0 === _o ? void 0 : _o[xField]) || void 0 === _p ? void 0 : _p.domain : void 0,
|
|
376
|
+
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
376
377
|
};
|
|
377
378
|
})); else {
|
|
378
|
-
const yField = "string" == typeof
|
|
379
|
+
const yField = "string" == typeof indicatorSpec.yField ? indicatorSpec.yField : indicatorSpec.yField[0];
|
|
379
380
|
collectValuesBy[yField] = {
|
|
380
381
|
by: rowKeys,
|
|
381
|
-
type: "horizontal" ===
|
|
382
|
-
range: "horizontal" !==
|
|
383
|
-
sortBy: "horizontal" ===
|
|
384
|
-
}, !1 !== (null
|
|
385
|
-
const xField =
|
|
382
|
+
type: "horizontal" === indicatorSpec.direction ? "yField" : void 0,
|
|
383
|
+
range: "horizontal" !== indicatorSpec.direction,
|
|
384
|
+
sortBy: "horizontal" === indicatorSpec.direction ? null === (_k = null === (_j = null === (_h = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _h ? void 0 : _h.fields) || void 0 === _j ? void 0 : _j[yField]) || void 0 === _k ? void 0 : _k.domain : void 0
|
|
385
|
+
}, !1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0);
|
|
386
|
+
const xField = indicatorSpec.xField;
|
|
386
387
|
collectValuesBy[xField] = {
|
|
387
388
|
by: columnKeys,
|
|
388
|
-
range: "horizontal" ===
|
|
389
|
-
sumBy:
|
|
390
|
-
sortBy: "horizontal" !==
|
|
389
|
+
range: "horizontal" === indicatorSpec.direction,
|
|
390
|
+
sumBy: indicatorSpec.stack && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField),
|
|
391
|
+
sortBy: "horizontal" !== indicatorSpec.direction ? null === (_o = null === (_m = null === (_l = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _l ? void 0 : _l.fields) || void 0 === _m ? void 0 : _m[xField]) || void 0 === _o ? void 0 : _o.domain : void 0,
|
|
392
|
+
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
391
393
|
};
|
|
392
394
|
}
|
|
393
395
|
}
|