From 30e50ee6ad46e35ab6fb12df66525d7f69371b54 Mon Sep 17 00:00:00 2001 From: DuLinRain Date: Mon, 21 Jun 2021 11:48:20 +0800 Subject: [PATCH 1/2] fix(sankey): fix dragger bug for sankey fix dragger bug for sankey when series data key name is nodes --- src/chart/sankey/SankeySeries.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chart/sankey/SankeySeries.ts b/src/chart/sankey/SankeySeries.ts index 64825cb1f6..a915ef6bdd 100644 --- a/src/chart/sankey/SankeySeries.ts +++ b/src/chart/sankey/SankeySeries.ts @@ -204,7 +204,8 @@ class SankeySeriesModel extends SeriesModel { } setNodePosition(dataIndex: number, localPosition: number[]) { - const dataItem = this.option.data[dataIndex]; + const nodes = this.option.data || this.option.nodes; + const dataItem = nodes[dataIndex]; dataItem.localX = localPosition[0]; dataItem.localY = localPosition[1]; } From 32297064ce3a3f994f29d071a0e8248fad33a8e3 Mon Sep 17 00:00:00 2001 From: DuLinRain Date: Mon, 21 Jun 2021 11:58:05 +0800 Subject: [PATCH 2/2] test(sankey): add test case for sankey chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add test case for sankey chart of the case when series data key name is nodes。 in the no fixed version, when series data key name is "nodes"(which is supported according to official docs), the draggable effect is only applied to nodes, and the node is splited from edges --- test/sankey-series-nodes.html | 79 +++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 test/sankey-series-nodes.html diff --git a/test/sankey-series-nodes.html b/test/sankey-series-nodes.html new file mode 100644 index 0000000000..7d40be3c11 --- /dev/null +++ b/test/sankey-series-nodes.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + + +
+ + + \ No newline at end of file