@visactor/vchart 1.13.13-alpha.1 → 1.13.13-alpha.2
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/es5/index.js +1 -1
- package/build/index.es.js +58 -56
- package/build/index.js +58 -56
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/series/sankey/interface.d.ts +2 -0
- package/cjs/series/sankey/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +6 -6
- package/cjs/series/sankey/sankey.js +34 -41
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/series/sankey/interface.d.ts +2 -0
- package/esm/series/sankey/interface.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +6 -6
- package/esm/series/sankey/sankey.js +34 -35
- package/esm/series/sankey/sankey.js.map +1 -1
- package/package.json +3 -3
package/build/index.es.js
CHANGED
|
@@ -64236,7 +64236,7 @@ const registerVChartCore = () => {
|
|
|
64236
64236
|
};
|
|
64237
64237
|
registerVChartCore();
|
|
64238
64238
|
|
|
64239
|
-
const version = "1.13.13-alpha.
|
|
64239
|
+
const version = "1.13.13-alpha.2";
|
|
64240
64240
|
|
|
64241
64241
|
const addVChartProperty = (data, op) => {
|
|
64242
64242
|
const context = op.beforeCall();
|
|
@@ -86530,33 +86530,35 @@ class SankeySeries extends CartesianSeries {
|
|
|
86530
86530
|
return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
|
|
86531
86531
|
};
|
|
86532
86532
|
this._handleEmphasisElement = (params) => {
|
|
86533
|
-
var _a, _b, _c, _d, _e;
|
|
86533
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
86534
86534
|
const emphasisSpec = (_a = this._spec.emphasis) !== null && _a !== void 0 ? _a : {};
|
|
86535
|
+
const highlightState = (_b = emphasisSpec.highlightState) !== null && _b !== void 0 ? _b : STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS;
|
|
86536
|
+
const blurState = (_c = emphasisSpec.blurState) !== null && _c !== void 0 ? _c : STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE;
|
|
86535
86537
|
const element = params.item;
|
|
86536
86538
|
if (emphasisSpec.effect === 'adjacency') {
|
|
86537
|
-
if (element && element.mark === ((
|
|
86538
|
-
this._handleNodeAdjacencyClick(element);
|
|
86539
|
+
if (element && element.mark === ((_d = this._nodeMark) === null || _d === void 0 ? void 0 : _d.getProduct())) {
|
|
86540
|
+
this._handleNodeAdjacencyClick(element, highlightState, blurState);
|
|
86539
86541
|
}
|
|
86540
|
-
else if (element && element.mark === ((
|
|
86541
|
-
this._handleLinkAdjacencyClick(element);
|
|
86542
|
+
else if (element && element.mark === ((_e = this._linkMark) === null || _e === void 0 ? void 0 : _e.getProduct())) {
|
|
86543
|
+
this._handleLinkAdjacencyClick(element, highlightState, blurState);
|
|
86542
86544
|
}
|
|
86543
86545
|
else {
|
|
86544
|
-
this._handleClearEmpty();
|
|
86546
|
+
this._handleClearEmpty(highlightState, blurState);
|
|
86545
86547
|
}
|
|
86546
86548
|
}
|
|
86547
86549
|
else if (emphasisSpec.effect === 'related') {
|
|
86548
|
-
if (element && element.mark === ((
|
|
86549
|
-
this._handleNodeRelatedClick(element);
|
|
86550
|
+
if (element && element.mark === ((_f = this._nodeMark) === null || _f === void 0 ? void 0 : _f.getProduct())) {
|
|
86551
|
+
this._handleNodeRelatedClick(element, highlightState, blurState);
|
|
86550
86552
|
}
|
|
86551
|
-
else if (element && element.mark === ((
|
|
86552
|
-
this._handleLinkRelatedClick(element);
|
|
86553
|
+
else if (element && element.mark === ((_g = this._linkMark) === null || _g === void 0 ? void 0 : _g.getProduct())) {
|
|
86554
|
+
this._handleLinkRelatedClick(element, highlightState, blurState);
|
|
86553
86555
|
}
|
|
86554
86556
|
else {
|
|
86555
|
-
this._handleClearEmpty();
|
|
86557
|
+
this._handleClearEmpty(highlightState, blurState);
|
|
86556
86558
|
}
|
|
86557
86559
|
}
|
|
86558
86560
|
};
|
|
86559
|
-
this._handleClearEmpty = () => {
|
|
86561
|
+
this._handleClearEmpty = (highlightState, blurState) => {
|
|
86560
86562
|
var _a, _b;
|
|
86561
86563
|
if (!this._needClear) {
|
|
86562
86564
|
return;
|
|
@@ -86569,7 +86571,7 @@ class SankeySeries extends CartesianSeries {
|
|
|
86569
86571
|
if (!allLinkElements || !allLinkElements.length) {
|
|
86570
86572
|
return;
|
|
86571
86573
|
}
|
|
86572
|
-
const states = [
|
|
86574
|
+
const states = [highlightState, blurState];
|
|
86573
86575
|
allNodeElements.forEach(el => {
|
|
86574
86576
|
el.removeState(states);
|
|
86575
86577
|
});
|
|
@@ -86578,7 +86580,7 @@ class SankeySeries extends CartesianSeries {
|
|
|
86578
86580
|
});
|
|
86579
86581
|
this._needClear = false;
|
|
86580
86582
|
};
|
|
86581
|
-
this._handleNodeAdjacencyClick = (element) => {
|
|
86583
|
+
this._handleNodeAdjacencyClick = (element, highlightState, blurState) => {
|
|
86582
86584
|
const nodeDatum = element.getDatum();
|
|
86583
86585
|
const highlightNodes = [nodeDatum.key];
|
|
86584
86586
|
if (this._linkMark) {
|
|
@@ -86592,28 +86594,28 @@ class SankeySeries extends CartesianSeries {
|
|
|
86592
86594
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86593
86595
|
highlightNodes.push(linkDatum.target);
|
|
86594
86596
|
}
|
|
86595
|
-
linkEl.removeState(
|
|
86596
|
-
linkEl.addState(
|
|
86597
|
+
linkEl.removeState(blurState);
|
|
86598
|
+
linkEl.addState(highlightState);
|
|
86597
86599
|
}
|
|
86598
86600
|
else if (linkDatum.target === nodeDatum.key) {
|
|
86599
86601
|
if (!highlightNodes.includes(linkDatum.source)) {
|
|
86600
86602
|
highlightNodes.push(linkDatum.source);
|
|
86601
86603
|
}
|
|
86602
|
-
linkEl.removeState(
|
|
86603
|
-
linkEl.addState(
|
|
86604
|
+
linkEl.removeState(blurState);
|
|
86605
|
+
linkEl.addState(highlightState);
|
|
86604
86606
|
}
|
|
86605
86607
|
else {
|
|
86606
|
-
linkEl.removeState(
|
|
86607
|
-
linkEl.addState(
|
|
86608
|
+
linkEl.removeState(highlightState);
|
|
86609
|
+
linkEl.addState(blurState);
|
|
86608
86610
|
}
|
|
86609
86611
|
});
|
|
86610
86612
|
}
|
|
86611
86613
|
if (this._nodeMark) {
|
|
86612
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86614
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86613
86615
|
}
|
|
86614
86616
|
this._needClear = true;
|
|
86615
86617
|
};
|
|
86616
|
-
this._handleLinkAdjacencyClick = (element) => {
|
|
86618
|
+
this._handleLinkAdjacencyClick = (element, highlightState, blurState) => {
|
|
86617
86619
|
const curLinkDatum = element.getDatum();
|
|
86618
86620
|
const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
|
|
86619
86621
|
if (this._linkMark) {
|
|
@@ -86623,21 +86625,21 @@ class SankeySeries extends CartesianSeries {
|
|
|
86623
86625
|
}
|
|
86624
86626
|
allLinkElements.forEach(linkEl => {
|
|
86625
86627
|
if (linkEl === element) {
|
|
86626
|
-
linkEl.removeState(
|
|
86627
|
-
linkEl.addState(
|
|
86628
|
+
linkEl.removeState(blurState);
|
|
86629
|
+
linkEl.addState(highlightState, { ratio: 1 });
|
|
86628
86630
|
}
|
|
86629
86631
|
else {
|
|
86630
|
-
linkEl.removeState(
|
|
86631
|
-
linkEl.addState(
|
|
86632
|
+
linkEl.removeState(highlightState);
|
|
86633
|
+
linkEl.addState(blurState, { ratio: 1 });
|
|
86632
86634
|
}
|
|
86633
86635
|
});
|
|
86634
86636
|
}
|
|
86635
86637
|
if (this._nodeMark) {
|
|
86636
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86638
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86637
86639
|
}
|
|
86638
86640
|
this._needClear = true;
|
|
86639
86641
|
};
|
|
86640
|
-
this._handleNodeRelatedClick = (element) => {
|
|
86642
|
+
this._handleNodeRelatedClick = (element, highlightState, blurState) => {
|
|
86641
86643
|
var _a;
|
|
86642
86644
|
const nodeDatum = element.getDatum();
|
|
86643
86645
|
const allNodeElements = this._nodeMark.getProductElements();
|
|
@@ -86740,17 +86742,17 @@ class SankeySeries extends CartesianSeries {
|
|
|
86740
86742
|
allLinkElements.forEach((linkEl, i) => {
|
|
86741
86743
|
var _a;
|
|
86742
86744
|
if (highlightLinks.includes((_a = linkEl.getDatum().key) !== null && _a !== void 0 ? _a : linkEl.getDatum().index)) {
|
|
86743
|
-
linkEl.removeState(
|
|
86744
|
-
linkEl.addState(
|
|
86745
|
+
linkEl.removeState(blurState);
|
|
86746
|
+
linkEl.addState(highlightState);
|
|
86745
86747
|
}
|
|
86746
86748
|
else {
|
|
86747
|
-
linkEl.removeState(
|
|
86748
|
-
linkEl.addState(
|
|
86749
|
+
linkEl.removeState(highlightState);
|
|
86750
|
+
linkEl.addState(blurState);
|
|
86749
86751
|
}
|
|
86750
86752
|
});
|
|
86751
86753
|
}
|
|
86752
86754
|
if (this._nodeMark) {
|
|
86753
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86755
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86754
86756
|
}
|
|
86755
86757
|
}
|
|
86756
86758
|
else {
|
|
@@ -86793,8 +86795,8 @@ class SankeySeries extends CartesianSeries {
|
|
|
86793
86795
|
return (sum += d.value);
|
|
86794
86796
|
}, 0);
|
|
86795
86797
|
const ratio = val / linkDatum.value;
|
|
86796
|
-
linkEl.removeState(
|
|
86797
|
-
linkEl.addState(
|
|
86798
|
+
linkEl.removeState(blurState);
|
|
86799
|
+
linkEl.addState(highlightState, { ratio });
|
|
86798
86800
|
return;
|
|
86799
86801
|
}
|
|
86800
86802
|
if (upSelectedLink) {
|
|
@@ -86804,21 +86806,21 @@ class SankeySeries extends CartesianSeries {
|
|
|
86804
86806
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86805
86807
|
highlightNodes.push(linkDatum.target);
|
|
86806
86808
|
}
|
|
86807
|
-
linkEl.removeState(
|
|
86808
|
-
linkEl.addState(
|
|
86809
|
+
linkEl.removeState(blurState);
|
|
86810
|
+
linkEl.addState(highlightState, { ratio: upSelectedLink.value / linkDatum.value });
|
|
86809
86811
|
return;
|
|
86810
86812
|
}
|
|
86811
|
-
linkEl.removeState(
|
|
86812
|
-
linkEl.addState(
|
|
86813
|
+
linkEl.removeState(highlightState);
|
|
86814
|
+
linkEl.addState(blurState);
|
|
86813
86815
|
return;
|
|
86814
86816
|
});
|
|
86815
86817
|
if (this._nodeMark) {
|
|
86816
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86818
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86817
86819
|
}
|
|
86818
86820
|
}
|
|
86819
86821
|
this._needClear = true;
|
|
86820
86822
|
};
|
|
86821
|
-
this._handleLinkRelatedClick = (element) => {
|
|
86823
|
+
this._handleLinkRelatedClick = (element, highlightState, blurState) => {
|
|
86822
86824
|
var _a;
|
|
86823
86825
|
const allNodeElements = this._nodeMark.getProductElements();
|
|
86824
86826
|
if (!allNodeElements || !allNodeElements.length) {
|
|
@@ -86830,7 +86832,7 @@ class SankeySeries extends CartesianSeries {
|
|
|
86830
86832
|
}
|
|
86831
86833
|
const father = ((_a = element.getDatum()) === null || _a === void 0 ? void 0 : _a.parents) ? 'parents' : 'source';
|
|
86832
86834
|
if (father === 'source') {
|
|
86833
|
-
const states = [
|
|
86835
|
+
const states = [highlightState, blurState];
|
|
86834
86836
|
if (this._linkMark) {
|
|
86835
86837
|
allLinkElements.forEach(linkEl => {
|
|
86836
86838
|
linkEl.removeState(states);
|
|
@@ -86872,8 +86874,8 @@ class SankeySeries extends CartesianSeries {
|
|
|
86872
86874
|
const linkDatum = linkEl.getDatum();
|
|
86873
86875
|
const originalDatum = linkDatum.datum;
|
|
86874
86876
|
if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
|
|
86875
|
-
linkEl.removeState(
|
|
86876
|
-
linkEl.addState(
|
|
86877
|
+
linkEl.removeState(blurState);
|
|
86878
|
+
linkEl.addState(highlightState, { ratio: 1 });
|
|
86877
86879
|
return;
|
|
86878
86880
|
}
|
|
86879
86881
|
const selectedDatum = originalDatum
|
|
@@ -86900,8 +86902,8 @@ class SankeySeries extends CartesianSeries {
|
|
|
86900
86902
|
return (sum += d.value);
|
|
86901
86903
|
}, 0);
|
|
86902
86904
|
const ratio = val / linkDatum.value;
|
|
86903
|
-
linkEl.removeState(
|
|
86904
|
-
linkEl.addState(
|
|
86905
|
+
linkEl.removeState(blurState);
|
|
86906
|
+
linkEl.addState(highlightState, { ratio });
|
|
86905
86907
|
return;
|
|
86906
86908
|
}
|
|
86907
86909
|
const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
|
|
@@ -86912,15 +86914,15 @@ class SankeySeries extends CartesianSeries {
|
|
|
86912
86914
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86913
86915
|
highlightNodes.push(linkDatum.target);
|
|
86914
86916
|
}
|
|
86915
|
-
linkEl.removeState(
|
|
86916
|
-
linkEl.addState(
|
|
86917
|
+
linkEl.removeState(blurState);
|
|
86918
|
+
linkEl.addState(highlightState, { ratio: upSelectedLink.value / linkDatum.value });
|
|
86917
86919
|
return;
|
|
86918
86920
|
}
|
|
86919
|
-
linkEl.removeState(
|
|
86920
|
-
linkEl.addState(
|
|
86921
|
+
linkEl.removeState(highlightState);
|
|
86922
|
+
linkEl.addState(blurState);
|
|
86921
86923
|
return;
|
|
86922
86924
|
});
|
|
86923
|
-
this._highLightElements(allNodeElements, highlightNodes);
|
|
86925
|
+
this._highLightElements(allNodeElements, highlightNodes, highlightState, blurState);
|
|
86924
86926
|
}
|
|
86925
86927
|
this._needClear = true;
|
|
86926
86928
|
};
|
|
@@ -87224,17 +87226,17 @@ class SankeySeries extends CartesianSeries {
|
|
|
87224
87226
|
linksSeriesDataUpdate() {
|
|
87225
87227
|
this._linksSeriesData.updateData();
|
|
87226
87228
|
}
|
|
87227
|
-
_highLightElements(vGrammarElements, highlightNodes) {
|
|
87229
|
+
_highLightElements(vGrammarElements, highlightNodes, highlightState, blurState) {
|
|
87228
87230
|
if (!vGrammarElements || !vGrammarElements.length) {
|
|
87229
87231
|
return;
|
|
87230
87232
|
}
|
|
87231
87233
|
vGrammarElements.forEach(el => {
|
|
87232
|
-
el.removeState([
|
|
87234
|
+
el.removeState([blurState, highlightState]);
|
|
87233
87235
|
if (highlightNodes.includes(el.getDatum().key)) {
|
|
87234
|
-
el.addState(
|
|
87236
|
+
el.addState(highlightState);
|
|
87235
87237
|
}
|
|
87236
87238
|
else {
|
|
87237
|
-
el.addState(
|
|
87239
|
+
el.addState(blurState);
|
|
87238
87240
|
}
|
|
87239
87241
|
});
|
|
87240
87242
|
}
|
package/build/index.js
CHANGED
|
@@ -64242,7 +64242,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64242
64242
|
};
|
|
64243
64243
|
registerVChartCore();
|
|
64244
64244
|
|
|
64245
|
-
const version = "1.13.13-alpha.
|
|
64245
|
+
const version = "1.13.13-alpha.2";
|
|
64246
64246
|
|
|
64247
64247
|
const addVChartProperty = (data, op) => {
|
|
64248
64248
|
const context = op.beforeCall();
|
|
@@ -86536,33 +86536,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86536
86536
|
return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
|
|
86537
86537
|
};
|
|
86538
86538
|
this._handleEmphasisElement = (params) => {
|
|
86539
|
-
var _a, _b, _c, _d, _e;
|
|
86539
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
86540
86540
|
const emphasisSpec = (_a = this._spec.emphasis) !== null && _a !== void 0 ? _a : {};
|
|
86541
|
+
const highlightState = (_b = emphasisSpec.highlightState) !== null && _b !== void 0 ? _b : exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS;
|
|
86542
|
+
const blurState = (_c = emphasisSpec.blurState) !== null && _c !== void 0 ? _c : exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE;
|
|
86541
86543
|
const element = params.item;
|
|
86542
86544
|
if (emphasisSpec.effect === 'adjacency') {
|
|
86543
|
-
if (element && element.mark === ((
|
|
86544
|
-
this._handleNodeAdjacencyClick(element);
|
|
86545
|
+
if (element && element.mark === ((_d = this._nodeMark) === null || _d === void 0 ? void 0 : _d.getProduct())) {
|
|
86546
|
+
this._handleNodeAdjacencyClick(element, highlightState, blurState);
|
|
86545
86547
|
}
|
|
86546
|
-
else if (element && element.mark === ((
|
|
86547
|
-
this._handleLinkAdjacencyClick(element);
|
|
86548
|
+
else if (element && element.mark === ((_e = this._linkMark) === null || _e === void 0 ? void 0 : _e.getProduct())) {
|
|
86549
|
+
this._handleLinkAdjacencyClick(element, highlightState, blurState);
|
|
86548
86550
|
}
|
|
86549
86551
|
else {
|
|
86550
|
-
this._handleClearEmpty();
|
|
86552
|
+
this._handleClearEmpty(highlightState, blurState);
|
|
86551
86553
|
}
|
|
86552
86554
|
}
|
|
86553
86555
|
else if (emphasisSpec.effect === 'related') {
|
|
86554
|
-
if (element && element.mark === ((
|
|
86555
|
-
this._handleNodeRelatedClick(element);
|
|
86556
|
+
if (element && element.mark === ((_f = this._nodeMark) === null || _f === void 0 ? void 0 : _f.getProduct())) {
|
|
86557
|
+
this._handleNodeRelatedClick(element, highlightState, blurState);
|
|
86556
86558
|
}
|
|
86557
|
-
else if (element && element.mark === ((
|
|
86558
|
-
this._handleLinkRelatedClick(element);
|
|
86559
|
+
else if (element && element.mark === ((_g = this._linkMark) === null || _g === void 0 ? void 0 : _g.getProduct())) {
|
|
86560
|
+
this._handleLinkRelatedClick(element, highlightState, blurState);
|
|
86559
86561
|
}
|
|
86560
86562
|
else {
|
|
86561
|
-
this._handleClearEmpty();
|
|
86563
|
+
this._handleClearEmpty(highlightState, blurState);
|
|
86562
86564
|
}
|
|
86563
86565
|
}
|
|
86564
86566
|
};
|
|
86565
|
-
this._handleClearEmpty = () => {
|
|
86567
|
+
this._handleClearEmpty = (highlightState, blurState) => {
|
|
86566
86568
|
var _a, _b;
|
|
86567
86569
|
if (!this._needClear) {
|
|
86568
86570
|
return;
|
|
@@ -86575,7 +86577,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86575
86577
|
if (!allLinkElements || !allLinkElements.length) {
|
|
86576
86578
|
return;
|
|
86577
86579
|
}
|
|
86578
|
-
const states = [
|
|
86580
|
+
const states = [highlightState, blurState];
|
|
86579
86581
|
allNodeElements.forEach(el => {
|
|
86580
86582
|
el.removeState(states);
|
|
86581
86583
|
});
|
|
@@ -86584,7 +86586,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86584
86586
|
});
|
|
86585
86587
|
this._needClear = false;
|
|
86586
86588
|
};
|
|
86587
|
-
this._handleNodeAdjacencyClick = (element) => {
|
|
86589
|
+
this._handleNodeAdjacencyClick = (element, highlightState, blurState) => {
|
|
86588
86590
|
const nodeDatum = element.getDatum();
|
|
86589
86591
|
const highlightNodes = [nodeDatum.key];
|
|
86590
86592
|
if (this._linkMark) {
|
|
@@ -86598,28 +86600,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86598
86600
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86599
86601
|
highlightNodes.push(linkDatum.target);
|
|
86600
86602
|
}
|
|
86601
|
-
linkEl.removeState(
|
|
86602
|
-
linkEl.addState(
|
|
86603
|
+
linkEl.removeState(blurState);
|
|
86604
|
+
linkEl.addState(highlightState);
|
|
86603
86605
|
}
|
|
86604
86606
|
else if (linkDatum.target === nodeDatum.key) {
|
|
86605
86607
|
if (!highlightNodes.includes(linkDatum.source)) {
|
|
86606
86608
|
highlightNodes.push(linkDatum.source);
|
|
86607
86609
|
}
|
|
86608
|
-
linkEl.removeState(
|
|
86609
|
-
linkEl.addState(
|
|
86610
|
+
linkEl.removeState(blurState);
|
|
86611
|
+
linkEl.addState(highlightState);
|
|
86610
86612
|
}
|
|
86611
86613
|
else {
|
|
86612
|
-
linkEl.removeState(
|
|
86613
|
-
linkEl.addState(
|
|
86614
|
+
linkEl.removeState(highlightState);
|
|
86615
|
+
linkEl.addState(blurState);
|
|
86614
86616
|
}
|
|
86615
86617
|
});
|
|
86616
86618
|
}
|
|
86617
86619
|
if (this._nodeMark) {
|
|
86618
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86620
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86619
86621
|
}
|
|
86620
86622
|
this._needClear = true;
|
|
86621
86623
|
};
|
|
86622
|
-
this._handleLinkAdjacencyClick = (element) => {
|
|
86624
|
+
this._handleLinkAdjacencyClick = (element, highlightState, blurState) => {
|
|
86623
86625
|
const curLinkDatum = element.getDatum();
|
|
86624
86626
|
const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
|
|
86625
86627
|
if (this._linkMark) {
|
|
@@ -86629,21 +86631,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86629
86631
|
}
|
|
86630
86632
|
allLinkElements.forEach(linkEl => {
|
|
86631
86633
|
if (linkEl === element) {
|
|
86632
|
-
linkEl.removeState(
|
|
86633
|
-
linkEl.addState(
|
|
86634
|
+
linkEl.removeState(blurState);
|
|
86635
|
+
linkEl.addState(highlightState, { ratio: 1 });
|
|
86634
86636
|
}
|
|
86635
86637
|
else {
|
|
86636
|
-
linkEl.removeState(
|
|
86637
|
-
linkEl.addState(
|
|
86638
|
+
linkEl.removeState(highlightState);
|
|
86639
|
+
linkEl.addState(blurState, { ratio: 1 });
|
|
86638
86640
|
}
|
|
86639
86641
|
});
|
|
86640
86642
|
}
|
|
86641
86643
|
if (this._nodeMark) {
|
|
86642
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86644
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86643
86645
|
}
|
|
86644
86646
|
this._needClear = true;
|
|
86645
86647
|
};
|
|
86646
|
-
this._handleNodeRelatedClick = (element) => {
|
|
86648
|
+
this._handleNodeRelatedClick = (element, highlightState, blurState) => {
|
|
86647
86649
|
var _a;
|
|
86648
86650
|
const nodeDatum = element.getDatum();
|
|
86649
86651
|
const allNodeElements = this._nodeMark.getProductElements();
|
|
@@ -86746,17 +86748,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86746
86748
|
allLinkElements.forEach((linkEl, i) => {
|
|
86747
86749
|
var _a;
|
|
86748
86750
|
if (highlightLinks.includes((_a = linkEl.getDatum().key) !== null && _a !== void 0 ? _a : linkEl.getDatum().index)) {
|
|
86749
|
-
linkEl.removeState(
|
|
86750
|
-
linkEl.addState(
|
|
86751
|
+
linkEl.removeState(blurState);
|
|
86752
|
+
linkEl.addState(highlightState);
|
|
86751
86753
|
}
|
|
86752
86754
|
else {
|
|
86753
|
-
linkEl.removeState(
|
|
86754
|
-
linkEl.addState(
|
|
86755
|
+
linkEl.removeState(highlightState);
|
|
86756
|
+
linkEl.addState(blurState);
|
|
86755
86757
|
}
|
|
86756
86758
|
});
|
|
86757
86759
|
}
|
|
86758
86760
|
if (this._nodeMark) {
|
|
86759
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86761
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86760
86762
|
}
|
|
86761
86763
|
}
|
|
86762
86764
|
else {
|
|
@@ -86799,8 +86801,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86799
86801
|
return (sum += d.value);
|
|
86800
86802
|
}, 0);
|
|
86801
86803
|
const ratio = val / linkDatum.value;
|
|
86802
|
-
linkEl.removeState(
|
|
86803
|
-
linkEl.addState(
|
|
86804
|
+
linkEl.removeState(blurState);
|
|
86805
|
+
linkEl.addState(highlightState, { ratio });
|
|
86804
86806
|
return;
|
|
86805
86807
|
}
|
|
86806
86808
|
if (upSelectedLink) {
|
|
@@ -86810,21 +86812,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86810
86812
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86811
86813
|
highlightNodes.push(linkDatum.target);
|
|
86812
86814
|
}
|
|
86813
|
-
linkEl.removeState(
|
|
86814
|
-
linkEl.addState(
|
|
86815
|
+
linkEl.removeState(blurState);
|
|
86816
|
+
linkEl.addState(highlightState, { ratio: upSelectedLink.value / linkDatum.value });
|
|
86815
86817
|
return;
|
|
86816
86818
|
}
|
|
86817
|
-
linkEl.removeState(
|
|
86818
|
-
linkEl.addState(
|
|
86819
|
+
linkEl.removeState(highlightState);
|
|
86820
|
+
linkEl.addState(blurState);
|
|
86819
86821
|
return;
|
|
86820
86822
|
});
|
|
86821
86823
|
if (this._nodeMark) {
|
|
86822
|
-
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
86824
|
+
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes, highlightState, blurState);
|
|
86823
86825
|
}
|
|
86824
86826
|
}
|
|
86825
86827
|
this._needClear = true;
|
|
86826
86828
|
};
|
|
86827
|
-
this._handleLinkRelatedClick = (element) => {
|
|
86829
|
+
this._handleLinkRelatedClick = (element, highlightState, blurState) => {
|
|
86828
86830
|
var _a;
|
|
86829
86831
|
const allNodeElements = this._nodeMark.getProductElements();
|
|
86830
86832
|
if (!allNodeElements || !allNodeElements.length) {
|
|
@@ -86836,7 +86838,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86836
86838
|
}
|
|
86837
86839
|
const father = ((_a = element.getDatum()) === null || _a === void 0 ? void 0 : _a.parents) ? 'parents' : 'source';
|
|
86838
86840
|
if (father === 'source') {
|
|
86839
|
-
const states = [
|
|
86841
|
+
const states = [highlightState, blurState];
|
|
86840
86842
|
if (this._linkMark) {
|
|
86841
86843
|
allLinkElements.forEach(linkEl => {
|
|
86842
86844
|
linkEl.removeState(states);
|
|
@@ -86878,8 +86880,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86878
86880
|
const linkDatum = linkEl.getDatum();
|
|
86879
86881
|
const originalDatum = linkDatum.datum;
|
|
86880
86882
|
if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
|
|
86881
|
-
linkEl.removeState(
|
|
86882
|
-
linkEl.addState(
|
|
86883
|
+
linkEl.removeState(blurState);
|
|
86884
|
+
linkEl.addState(highlightState, { ratio: 1 });
|
|
86883
86885
|
return;
|
|
86884
86886
|
}
|
|
86885
86887
|
const selectedDatum = originalDatum
|
|
@@ -86906,8 +86908,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86906
86908
|
return (sum += d.value);
|
|
86907
86909
|
}, 0);
|
|
86908
86910
|
const ratio = val / linkDatum.value;
|
|
86909
|
-
linkEl.removeState(
|
|
86910
|
-
linkEl.addState(
|
|
86911
|
+
linkEl.removeState(blurState);
|
|
86912
|
+
linkEl.addState(highlightState, { ratio });
|
|
86911
86913
|
return;
|
|
86912
86914
|
}
|
|
86913
86915
|
const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
|
|
@@ -86918,15 +86920,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86918
86920
|
if (!highlightNodes.includes(linkDatum.target)) {
|
|
86919
86921
|
highlightNodes.push(linkDatum.target);
|
|
86920
86922
|
}
|
|
86921
|
-
linkEl.removeState(
|
|
86922
|
-
linkEl.addState(
|
|
86923
|
+
linkEl.removeState(blurState);
|
|
86924
|
+
linkEl.addState(highlightState, { ratio: upSelectedLink.value / linkDatum.value });
|
|
86923
86925
|
return;
|
|
86924
86926
|
}
|
|
86925
|
-
linkEl.removeState(
|
|
86926
|
-
linkEl.addState(
|
|
86927
|
+
linkEl.removeState(highlightState);
|
|
86928
|
+
linkEl.addState(blurState);
|
|
86927
86929
|
return;
|
|
86928
86930
|
});
|
|
86929
|
-
this._highLightElements(allNodeElements, highlightNodes);
|
|
86931
|
+
this._highLightElements(allNodeElements, highlightNodes, highlightState, blurState);
|
|
86930
86932
|
}
|
|
86931
86933
|
this._needClear = true;
|
|
86932
86934
|
};
|
|
@@ -87230,17 +87232,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87230
87232
|
linksSeriesDataUpdate() {
|
|
87231
87233
|
this._linksSeriesData.updateData();
|
|
87232
87234
|
}
|
|
87233
|
-
_highLightElements(vGrammarElements, highlightNodes) {
|
|
87235
|
+
_highLightElements(vGrammarElements, highlightNodes, highlightState, blurState) {
|
|
87234
87236
|
if (!vGrammarElements || !vGrammarElements.length) {
|
|
87235
87237
|
return;
|
|
87236
87238
|
}
|
|
87237
87239
|
vGrammarElements.forEach(el => {
|
|
87238
|
-
el.removeState([
|
|
87240
|
+
el.removeState([blurState, highlightState]);
|
|
87239
87241
|
if (highlightNodes.includes(el.getDatum().key)) {
|
|
87240
|
-
el.addState(
|
|
87242
|
+
el.addState(highlightState);
|
|
87241
87243
|
}
|
|
87242
87244
|
else {
|
|
87243
|
-
el.addState(
|
|
87245
|
+
el.addState(blurState);
|
|
87244
87246
|
}
|
|
87245
87247
|
});
|
|
87246
87248
|
}
|