@visactor/vchart-extension 1.13.21-alpha.8 → 1.13.21-alpha.9

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 (25) hide show
  1. package/build/index.js +10 -6
  2. package/build/index.min.js +1 -1
  3. package/cjs/charts/compare-sankey/compare-sankey-sub-data.d.ts +1 -0
  4. package/cjs/charts/compare-sankey/compare-sankey-sub-data.js +5 -5
  5. package/cjs/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -1
  6. package/cjs/charts/compare-sankey/compare-sankey-transformer.js +3 -3
  7. package/cjs/charts/compare-sankey/compare-sankey-transformer.js.map +1 -1
  8. package/cjs/charts/compare-sankey/compare-sankey.js +3 -2
  9. package/cjs/charts/compare-sankey/compare-sankey.js.map +1 -1
  10. package/cjs/charts/compare-sankey/interface.d.ts +1 -0
  11. package/cjs/charts/compare-sankey/interface.js.map +1 -1
  12. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +0 -1
  13. package/cjs/charts/conversion-funnel/interface.js +2 -1
  14. package/esm/charts/compare-sankey/compare-sankey-sub-data.d.ts +1 -0
  15. package/esm/charts/compare-sankey/compare-sankey-sub-data.js +5 -5
  16. package/esm/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -1
  17. package/esm/charts/compare-sankey/compare-sankey-transformer.js +3 -3
  18. package/esm/charts/compare-sankey/compare-sankey-transformer.js.map +1 -1
  19. package/esm/charts/compare-sankey/compare-sankey.js +3 -2
  20. package/esm/charts/compare-sankey/compare-sankey.js.map +1 -1
  21. package/esm/charts/compare-sankey/interface.d.ts +1 -0
  22. package/esm/charts/compare-sankey/interface.js.map +1 -1
  23. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -2
  24. package/esm/charts/conversion-funnel/interface.js +2 -1
  25. package/package.json +4 -4
package/build/index.js CHANGED
@@ -4277,6 +4277,7 @@
4277
4277
  _getDefaultSeriesSpec(spec) {
4278
4278
  const seriesSpec = super._getDefaultSeriesSpec(spec);
4279
4279
  seriesSpec.subNodeGap = spec.subNodeGap;
4280
+ seriesSpec.subNodeMinSize = spec.subNodeMinSize;
4280
4281
  seriesSpec.compareNodeColor = spec.compareNodeColor;
4281
4282
  seriesSpec.compareLinkColor = spec.compareLinkColor;
4282
4283
  seriesSpec.activeLink = spec.activeLink;
@@ -4405,11 +4406,12 @@
4405
4406
  }
4406
4407
  }
4407
4408
  const compareSankeySubData = (data, opt) => {
4408
- var _a;
4409
+ var _a, _b;
4409
4410
  const viewData = data[0];
4410
4411
  if (!((_a = viewData.latestData) === null || _a === void 0 ? void 0 : _a.length)) {
4411
4412
  return {};
4412
4413
  }
4414
+ const subNodeMinSize = (_b = opt.subNodeMinSize) !== null && _b !== void 0 ? _b : 0;
4413
4415
  const rawDataTree = opt.rawData().latestData[0];
4414
4416
  const subNodeGap = opt.subNodeGap;
4415
4417
  const keyFunc = isFunction$1(opt.nodeKey) ? opt.nodeKey : opt.nodeKey ? field(opt.nodeKey) : null;
@@ -4434,14 +4436,15 @@
4434
4436
  if (!subNode) {
4435
4437
  return;
4436
4438
  }
4437
- const percent = subNode.value / totalValue;
4439
+ const percent = totalValue === 0 ? 0 : subNode.value / totalValue;
4440
+ const dis = Math.max(subNodeMinSize, totalSize * percent);
4438
4441
  subNode.x0 = n.x0;
4439
4442
  subNode.x1 = n.x1;
4440
4443
  subNode.y0 = currentY;
4441
- subNode.y1 = currentY + totalSize * percent;
4444
+ subNode.y1 = currentY + dis;
4442
4445
  subNode.type = sunGroup.type;
4443
4446
  subNode.sourceNode = n;
4444
- currentY += totalSize * percent + subNodeGap;
4447
+ currentY += dis + subNodeGap;
4445
4448
  });
4446
4449
  });
4447
4450
  return subNodeMap;
@@ -4490,7 +4493,7 @@
4490
4493
  };
4491
4494
  }
4492
4495
  initData() {
4493
- var _a;
4496
+ var _a, _b;
4494
4497
  super.initData();
4495
4498
  const { dataSet } = this._option;
4496
4499
  const compareSubData = new DataView(dataSet, { name: `compare-sankey-sub-data-${this.id}-data` });
@@ -4509,7 +4512,8 @@
4509
4512
  rawData: () => this.getRawData(),
4510
4513
  valueField: this._valueField,
4511
4514
  nodeKey: this._spec.nodeKey,
4512
- subNodeGap: (_a = this._spec.subNodeGap) !== null && _a !== void 0 ? _a : 2
4515
+ subNodeGap: (_a = this._spec.subNodeGap) !== null && _a !== void 0 ? _a : 2,
4516
+ subNodeMinSize: (_b = this._spec.subNodeMinSize) !== null && _b !== void 0 ? _b : 0
4513
4517
  }
4514
4518
  });
4515
4519
  vchart.registerDataSetInstanceTransform(this._dataSet, 'compareSankeySubNodes', compareSankeySubNodes);