@visactor/vtable 1.19.10-alpha.2 → 1.19.10-alpha.4

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 (37) hide show
  1. package/cjs/PivotChart.js +15 -17
  2. package/cjs/PivotChart.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/dataset/dataset-pivot-table.js +2 -1
  6. package/cjs/dataset/flatDataToObject.js +1 -2
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/layout/chart-helper/get-axis-config.js +28 -73
  11. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  12. package/cjs/layout/chart-helper/get-chart-spec.js +9 -19
  13. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  14. package/cjs/layout/pivot-header-layout.d.ts +1 -1
  15. package/cjs/layout/pivot-header-layout.js +8 -8
  16. package/cjs/layout/pivot-header-layout.js.map +1 -1
  17. package/cjs/vrender.js.map +1 -1
  18. package/dist/vtable.js +1479 -256
  19. package/dist/vtable.min.js +2 -2
  20. package/es/PivotChart.js +15 -17
  21. package/es/PivotChart.js.map +1 -1
  22. package/es/core/BaseTable.js +1 -1
  23. package/es/core/BaseTable.js.map +1 -1
  24. package/es/dataset/dataset-pivot-table.js +2 -1
  25. package/es/dataset/flatDataToObject.js +1 -2
  26. package/es/index.d.ts +1 -1
  27. package/es/index.js +1 -1
  28. package/es/index.js.map +1 -1
  29. package/es/layout/chart-helper/get-axis-config.js +28 -73
  30. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  31. package/es/layout/chart-helper/get-chart-spec.js +9 -19
  32. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  33. package/es/layout/pivot-header-layout.d.ts +1 -1
  34. package/es/layout/pivot-header-layout.js +8 -8
  35. package/es/layout/pivot-header-layout.js.map +1 -1
  36. package/es/vrender.js.map +1 -1
  37. package/package.json +8 -8
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, _t, _u, _v, _w, _x;
371
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
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) || "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;
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) || "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;
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
- "heatmap" !== (null == indicatorSpec ? void 0 : indicatorSpec.type) && (collectValuesBy[indicatorDefine.indicatorKey] = {
379
+ collectValuesBy[indicatorDefine.indicatorKey] = {
380
380
  by: rowKeys,
381
381
  range: !0,
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 => {
382
+ sumBy: (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,30 +399,29 @@ class PivotChart extends BaseTable_1.BaseTable {
399
399
  extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
400
400
  };
401
401
  })); else {
402
- const xField = "histogram" === indicatorSpec.type ? indicatorSpec.x2Field : "string" == typeof indicatorSpec.xField ? indicatorSpec.xField : indicatorSpec.xField[0];
402
+ const xField = "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 === (_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
407
+ sortBy: "horizontal" !== indicatorSpec.direction ? null === (_h = null === (_g = null === (_f = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[xField]) || void 0 === _h ? void 0 : _h.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
- 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,
412
+ range: "horizontal" !== indicatorSpec.direction,
413
+ sumBy: indicatorSpec.stack && columnKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.xField),
414
+ sortBy: "horizontal" === indicatorSpec.direction ? null === (_l = null === (_k = null === (_j = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[yField]) || void 0 === _l ? void 0 : _l.domain : void 0,
416
415
  extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
417
416
  };
418
417
  } else {
419
418
  const indicatorDefine = indicators[i];
420
419
  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),
421
- "heatmap" !== (null == indicatorSpec ? void 0 : indicatorSpec.type) && (collectValuesBy[indicatorDefine.indicatorKey] = {
420
+ collectValuesBy[indicatorDefine.indicatorKey] = {
422
421
  by: columnKeys,
423
422
  range: !0,
424
423
  sumBy: (null == indicatorSpec ? void 0 : indicatorSpec.stack) && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField)
425
- }), indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
424
+ }, indicatorSpec.series) indicatorSpec.series.forEach((chartSeries => {
426
425
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
427
426
  const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
428
427
  collectValuesBy[yField] = {
@@ -446,15 +445,14 @@ class PivotChart extends BaseTable_1.BaseTable {
446
445
  by: rowKeys,
447
446
  type: "horizontal" === indicatorSpec.direction ? "yField" : void 0,
448
447
  range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !1),
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
448
+ sortBy: "horizontal" === indicatorSpec.direction ? 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
450
449
  }, !1 !== (null == indicatorSpec ? void 0 : indicatorSpec.stack) && ("bar" === (null == indicatorSpec ? void 0 : indicatorSpec.type) || "area" === (null == indicatorSpec ? void 0 : indicatorSpec.type)) && (indicatorSpec.stack = !0);
451
- const xField = "histogram" === indicatorSpec.type ? indicatorSpec.x2Field : indicatorSpec.xField;
450
+ const xField = indicatorSpec.xField;
452
451
  collectValuesBy[xField] = {
453
452
  by: columnKeys,
454
- type: "horizontal" === indicatorSpec.direction ? "xField" : void 0,
455
453
  range: (0, get_axis_config_1.hasLinearAxis)(indicatorSpec, this._axes, "horizontal" === indicatorSpec.direction, !0),
456
454
  sumBy: indicatorSpec.stack && rowKeys.concat(null == indicatorSpec ? void 0 : indicatorSpec.yField),
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,
455
+ sortBy: "horizontal" !== indicatorSpec.direction ? null === (_s = null === (_r = null === (_q = null == indicatorSpec ? void 0 : indicatorSpec.data) || void 0 === _q ? void 0 : _q.fields) || void 0 === _r ? void 0 : _r[xField]) || void 0 === _s ? void 0 : _s.domain : void 0,
458
456
  extendRange: (0, tableHelper_1.parseMarkLineGetExtendRange)(indicatorSpec.markLine)
459
457
  };
460
458
  }