From bc15d67f898c238782bcfceab70b6c9efd4271d8 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 19 Jun 2023 16:38:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE-=E8=AF=8D=E4=BA=91):=20?= =?UTF-8?q?=E8=AF=8D=E4=BA=91=E6=94=AF=E6=8C=81=E8=81=94=E5=8A=A8=E5=92=8C?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/SettingMenu.vue | 2 -- .../views/chart/chart/wordCloud/word_cloud.js | 3 ++- .../chart/components/ChartComponentG2.vue | 18 +++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/SettingMenu.vue b/frontend/src/components/canvas/components/editor/SettingMenu.vue index 2df0ee17ee..797dcb83e8 100644 --- a/frontend/src/components/canvas/components/editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/editor/SettingMenu.vue @@ -192,7 +192,6 @@ export default { 'gauge', 'text', 'label', - 'word-cloud', 'flow-map', 'bidirectional-bar' ], @@ -202,7 +201,6 @@ export default { 'gauge', 'text', 'label', - 'word-cloud', 'flow-map', 'bidirectional-bar' ], diff --git a/frontend/src/views/chart/chart/wordCloud/word_cloud.js b/frontend/src/views/chart/chart/wordCloud/word_cloud.js index f33f1f3f85..81d507af5c 100644 --- a/frontend/src/views/chart/chart/wordCloud/word_cloud.js +++ b/frontend/src/views/chart/chart/wordCloud/word_cloud.js @@ -38,6 +38,7 @@ export function baseWordCloudOptionAntV(plot, container, chart, action) { plot.destroy() } plot = new WordCloud(container, options) - + plot.off('point:click') + plot.on('point:click', action) return plot } diff --git a/frontend/src/views/chart/components/ChartComponentG2.vue b/frontend/src/views/chart/components/ChartComponentG2.vue index 82c2b3394d..2c32934575 100644 --- a/frontend/src/views/chart/components/ChartComponentG2.vue +++ b/frontend/src/views/chart/components/ChartComponentG2.vue @@ -287,7 +287,7 @@ export default { } } - if (this.myChart && !equalsAny(chart.type ,'liquid','flow-map') && this.searchCount > 0) { + if (this.myChart && !equalsAny(chart.type, 'liquid', 'flow-map') && this.searchCount > 0) { this.myChart.options.animation = false } if (this.myChart?.options?.legend) { @@ -319,10 +319,18 @@ export default { }, antVAction(param) { - if (this.chart.type === 'treemap') { - this.pointParam = param.data.data - } else { - this.pointParam = param.data + switch (this.chart.type) { + case 'treemap': + this.pointParam = param.data.data + break + case 'word-cloud': + this.pointParam = { + data: param.data.data.datum + } + break + default: + this.pointParam = param.data + break } this.linkageActiveParam = { category: this.pointParam.data.category ? this.pointParam.data.category : 'NO_DATA',