@visactor/vtable 1.19.9 → 1.19.10-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.
- package/cjs/PivotChart.js +17 -15
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.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 +73 -28
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +19 -9
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -1
- package/cjs/layout/pivot-header-layout.js +4 -4
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +185 -52
- package/dist/vtable.min.js +1 -1
- package/es/PivotChart.js +17 -15
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.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 +73 -28
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +19 -9
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -1
- package/es/layout/pivot-header-layout.js +4 -4
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/cjs/PivotChart.js
CHANGED
|
@@ -368,19 +368,19 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
_generateCollectValuesConfig(columnKeys, rowKeys) {
|
|
371
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
371
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
372
372
|
columnKeys = columnKeys.filter((key => key !== global_1.IndicatorDimensionKeyPlaceholder)),
|
|
373
373
|
rowKeys = rowKeys.filter((key => key !== global_1.IndicatorDimensionKeyPlaceholder));
|
|
374
374
|
const indicators = this.internalProps.indicators, collectValuesBy = {};
|
|
375
375
|
for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
|
|
376
|
-
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) || "
|
|
376
|
+
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) || "funnel" === (null === (_c = indicators[i].chartSpec) || void 0 === _c ? void 0 : _c.type) || "radar" === (null === (_d = indicators[i].chartSpec) || void 0 === _d ? void 0 : _d.type) || "gauge" === (null === (_e = indicators[i].chartSpec) || void 0 === _e ? void 0 : _e.type) || "wordCloud" === (null === (_f = indicators[i].chartSpec) || void 0 === _f ? void 0 : _f.type) || "sunburst" === (null === (_g = indicators[i].chartSpec) || void 0 === _g ? void 0 : _g.type) || "treemap" === (null === (_h = indicators[i].chartSpec) || void 0 === _h ? void 0 : _h.type) || "sankey" === (null === (_j = indicators[i].chartSpec) || void 0 === _j ? void 0 : _j.type) || "circlePacking" === (null === (_k = indicators[i].chartSpec) || void 0 === _k ? void 0 : _k.type)) continue;
|
|
377
377
|
const indicatorDefine = indicators[i], indicatorSpec = indicatorDefine.chartSpec;
|
|
378
378
|
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),
|
|
379
|
-
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
379
|
+
"heatmap" !== (null == indicatorSpec ? void 0 : indicatorSpec.type) && (collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
380
380
|
by: rowKeys,
|
|
381
381
|
range: !0,
|
|
382
|
-
sumBy: (null == indicatorSpec ? void 0 : indicatorSpec.stack) && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField)
|
|
383
|
-
}, indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
382
|
+
sumBy: "histogram" === indicatorSpec.type ? columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField, null == indicatorSpec ? void 0 : indicatorSpec.x2Field) : (null == indicatorSpec ? void 0 : indicatorSpec.stack) && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField)
|
|
383
|
+
}), indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
384
384
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
385
385
|
const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
|
|
386
386
|
collectValuesBy[xField] = {
|
|
@@ -399,29 +399,30 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
399
399
|
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
400
400
|
};
|
|
401
401
|
})); else {
|
|
402
|
-
const xField = "string" == typeof indicatorSpec.xField ? indicatorSpec.xField : indicatorSpec.xField[0];
|
|
402
|
+
const xField = "histogram" === indicatorSpec.type ? indicatorSpec.x2Field : "string" == typeof indicatorSpec.xField ? indicatorSpec.xField : indicatorSpec.xField[0];
|
|
403
403
|
collectValuesBy[xField] = {
|
|
404
404
|
by: columnKeys,
|
|
405
405
|
type: "horizontal" !== indicatorSpec.direction ? "xField" : void 0,
|
|
406
406
|
range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !0),
|
|
407
|
-
sortBy: "horizontal" !== indicatorSpec.direction ? null === (
|
|
407
|
+
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
|
|
408
408
|
}, !1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0);
|
|
409
409
|
const yField = indicatorSpec.yField;
|
|
410
410
|
collectValuesBy[yField] = {
|
|
411
411
|
by: rowKeys,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
type: "horizontal" !== indicatorSpec.direction ? "yField" : void 0,
|
|
413
|
+
range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !1),
|
|
414
|
+
sumBy: "histogram" === indicatorSpec.type ? columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField, null == indicatorSpec ? void 0 : indicatorSpec.x2Field) : indicatorSpec.stack && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField),
|
|
415
|
+
sortBy: "horizontal" === indicatorSpec.direction ? null === (_r = null === (_q = null === (_p = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[yField]) || void 0 === _r ? void 0 : _r.domain : void 0,
|
|
415
416
|
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
416
417
|
};
|
|
417
418
|
} else {
|
|
418
419
|
const indicatorDefine = indicators[i];
|
|
419
420
|
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),
|
|
420
|
-
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
421
|
+
"heatmap" !== (null == indicatorSpec ? void 0 : indicatorSpec.type) && (collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
421
422
|
by: columnKeys,
|
|
422
423
|
range: !0,
|
|
423
424
|
sumBy: (null == indicatorSpec ? void 0 : indicatorSpec.stack) && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField)
|
|
424
|
-
}, indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
425
|
+
}), indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
|
|
425
426
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
426
427
|
const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
|
|
427
428
|
collectValuesBy[yField] = {
|
|
@@ -445,14 +446,15 @@ class PivotChart extends BaseTable_1.BaseTable {
|
|
|
445
446
|
by: rowKeys,
|
|
446
447
|
type: "horizontal" === indicatorSpec.direction ? "yField" : void 0,
|
|
447
448
|
range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !1),
|
|
448
|
-
sortBy: "horizontal" === indicatorSpec.direction ? null === (
|
|
449
|
+
sortBy: "horizontal" === indicatorSpec.direction ? null === (_u = null === (_t = null === (_s = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _s ? void 0 : _s.fields) || void 0 === _t ? void 0 : _t[yField]) || void 0 === _u ? void 0 : _u.domain : void 0
|
|
449
450
|
}, !1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0);
|
|
450
|
-
const xField = indicatorSpec.xField;
|
|
451
|
+
const xField = "histogram" === indicatorSpec.type ? indicatorSpec.x2Field : indicatorSpec.xField;
|
|
451
452
|
collectValuesBy[xField] = {
|
|
452
453
|
by: columnKeys,
|
|
454
|
+
type: "horizontal" === indicatorSpec.direction ? "xField" : void 0,
|
|
453
455
|
range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !0),
|
|
454
456
|
sumBy: indicatorSpec.stack && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField),
|
|
455
|
-
sortBy: "horizontal" !== indicatorSpec.direction ? null === (
|
|
457
|
+
sortBy: "horizontal" !== indicatorSpec.direction ? null === (_x = null === (_w = null === (_v = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _v ? void 0 : _v.fields) || void 0 === _w ? void 0 : _w[xField]) || void 0 === _x ? void 0 : _x.domain : void 0,
|
|
456
458
|
extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
|
|
457
459
|
};
|
|
458
460
|
}
|