@visactor/vchart-extension 1.13.21-alpha.7 → 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.
- package/build/index.js +14 -7
- package/build/index.min.js +1 -1
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.d.ts +1 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js +5 -5
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -1
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js +3 -3
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js.map +1 -1
- package/cjs/charts/compare-sankey/compare-sankey.d.ts +1 -0
- package/cjs/charts/compare-sankey/compare-sankey.js +7 -3
- package/cjs/charts/compare-sankey/compare-sankey.js.map +1 -1
- package/cjs/charts/compare-sankey/interface.d.ts +1 -0
- package/cjs/charts/compare-sankey/interface.js.map +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +0 -1
- package/cjs/charts/conversion-funnel/interface.js +2 -1
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +2 -1
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +1 -2
- package/esm/charts/compare-sankey/compare-sankey-sub-data.d.ts +1 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js +5 -5
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -1
- package/esm/charts/compare-sankey/compare-sankey-transformer.js +3 -3
- package/esm/charts/compare-sankey/compare-sankey-transformer.js.map +1 -1
- package/esm/charts/compare-sankey/compare-sankey.d.ts +1 -0
- package/esm/charts/compare-sankey/compare-sankey.js +7 -3
- package/esm/charts/compare-sankey/compare-sankey.js.map +1 -1
- package/esm/charts/compare-sankey/interface.d.ts +1 -0
- package/esm/charts/compare-sankey/interface.js.map +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -2
- package/esm/charts/conversion-funnel/interface.js +2 -1
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +2 -1
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +1 -2
- 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 +
|
|
4444
|
+
subNode.y1 = currentY + dis;
|
|
4442
4445
|
subNode.type = sunGroup.type;
|
|
4443
4446
|
subNode.sourceNode = n;
|
|
4444
|
-
currentY +=
|
|
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);
|
|
@@ -4582,7 +4586,7 @@
|
|
|
4582
4586
|
const nodeDatums = allNodeElements.map(el => getDatumOfGraphic(el));
|
|
4583
4587
|
const pickNodeDatums = nodeDatums.filter(d => d.key === nodeDatum.key);
|
|
4584
4588
|
const highlightLinksData = [];
|
|
4585
|
-
const highlightNodeKeys =
|
|
4589
|
+
const highlightNodeKeys = pickNodeDatums.map(d => d.key);
|
|
4586
4590
|
this._activeTargetLink(nodeDatum, pickNodeDatums, allNodeElements, allLinkElements, highlightNodeKeys, highlightLinksData, highlightState, blurState);
|
|
4587
4591
|
this._activeSourceLink(nodeDatum, pickNodeDatums, nodeDatums, allNodeElements, highlightNodeKeys, highlightLinksData, highlightState, blurState);
|
|
4588
4592
|
this._highLightElements(allNodeElements, highlightNodeKeys, highlightState, blurState);
|
|
@@ -4668,6 +4672,9 @@
|
|
|
4668
4672
|
});
|
|
4669
4673
|
}
|
|
4670
4674
|
}
|
|
4675
|
+
getSubNodeDatum(filter) {
|
|
4676
|
+
return this._nodeMark.getProductElements().filter((n) => filter(n.data[0]));
|
|
4677
|
+
}
|
|
4671
4678
|
}
|
|
4672
4679
|
CompareSankeySeries.type = 'compareSankey';
|
|
4673
4680
|
const registerCompareSankeyChart = (option) => {
|