From eeb1f4b2001a61b8bb677d6b88d512823f220abf Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Sun, 4 Feb 2024 18:20:49 +0800 Subject: [PATCH] [Core] [DataSet] [Chart] Support word cloud diagram (close #614) --- .../datacap-web/src/components/visual/Type.ts | 1 + .../src/components/visual/VisualEditor.vue | 7 +- .../src/components/visual/VisualView.vue | 9 ++- .../visual/components/VisualWordCloud.vue | 81 +++++++++++++++++++ core/datacap-web/src/fontawesome.ts | 2 + core/datacap-web/src/i18n/langs/en/dataset.ts | 1 + .../src/i18n/langs/zhCn/dataset.ts | 1 + .../src/views/admin/dataset/DatasetAdhoc.vue | 14 ++++ .../adhoc/DatasetVisualConfigureWordCloud.vue | 71 ++++++++++++++++ 9 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 core/datacap-web/src/components/visual/components/VisualWordCloud.vue create mode 100644 core/datacap-web/src/views/admin/dataset/components/adhoc/DatasetVisualConfigureWordCloud.vue diff --git a/core/datacap-web/src/components/visual/Type.ts b/core/datacap-web/src/components/visual/Type.ts index 50ef021534..81d075eef4 100644 --- a/core/datacap-web/src/components/visual/Type.ts +++ b/core/datacap-web/src/components/visual/Type.ts @@ -6,4 +6,5 @@ export enum Type AREA = ('AREA'), PIE = ('PIE'), HISTOGRAM = ('HISTOGRAM'), + WORDCLOUD= ('WORDCLOUD'), } diff --git a/core/datacap-web/src/components/visual/VisualEditor.vue b/core/datacap-web/src/components/visual/VisualEditor.vue index 8998d07307..bd8b8909c3 100644 --- a/core/datacap-web/src/components/visual/VisualEditor.vue +++ b/core/datacap-web/src/components/visual/VisualEditor.vue @@ -37,6 +37,10 @@ :configuration="configuration" @commitOptions="handlerCommit"> + + @@ -49,6 +53,7 @@ import VisualBar from "@/components/visual/components/VisualBar.vue"; import VisualArea from "@/components/visual/components/VisualArea.vue"; import VisualPie from "@/components/visual/components/VisualPie.vue"; import VisualHistogram from "@/components/visual/components/VisualHistogram.vue"; +import VisualWordCloud from "@/components/visual/components/VisualWordCloud.vue"; export default { name: 'VisualEditor', @@ -58,7 +63,7 @@ export default { return Type } }, - components: {VisualHistogram, VisualPie, VisualArea, VisualBar, VisualLine, VisualTable}, + components: {VisualWordCloud, VisualHistogram, VisualPie, VisualArea, VisualBar, VisualLine, VisualTable}, props: { configuration: { type: Configuration diff --git a/core/datacap-web/src/components/visual/VisualView.vue b/core/datacap-web/src/components/visual/VisualView.vue index cd7a666eb0..73232f061a 100644 --- a/core/datacap-web/src/components/visual/VisualView.vue +++ b/core/datacap-web/src/components/visual/VisualView.vue @@ -40,6 +40,12 @@ :width="width" :height="height"> + + @@ -55,6 +61,7 @@ import CircularLoading from "@/components/loading/CircularLoading.vue"; import VisualArea from "@/components/visual/components/VisualArea.vue"; import VisualPie from "@/components/visual/components/VisualPie.vue"; import VisualHistogram from "@/components/visual/components/VisualHistogram.vue"; +import VisualWordCloud from "@/components/visual/components/VisualWordCloud.vue"; export default { name: 'VisualView', @@ -64,7 +71,7 @@ export default { return Type } }, - components: {VisualHistogram, VisualPie, VisualArea, CircularLoading, VisualBar, VisualLine, VisualTable}, + components: {VisualWordCloud, VisualHistogram, VisualPie, VisualArea, CircularLoading, VisualBar, VisualLine, VisualTable}, props: { configuration: { type: Configuration diff --git a/core/datacap-web/src/components/visual/components/VisualWordCloud.vue b/core/datacap-web/src/components/visual/components/VisualWordCloud.vue new file mode 100644 index 0000000000..d0dded137f --- /dev/null +++ b/core/datacap-web/src/components/visual/components/VisualWordCloud.vue @@ -0,0 +1,81 @@ + + diff --git a/core/datacap-web/src/fontawesome.ts b/core/datacap-web/src/fontawesome.ts index 40b9373c2d..d0051ba96f 100644 --- a/core/datacap-web/src/fontawesome.ts +++ b/core/datacap-web/src/fontawesome.ts @@ -56,6 +56,7 @@ import { faUpload } from '@fortawesome/free-solid-svg-icons' import {faChartSimple} from "@fortawesome/free-solid-svg-icons/faChartSimple"; +import {faCloud} from "@fortawesome/free-solid-svg-icons/faCloud"; /** * Creates icons for the given app. @@ -65,6 +66,7 @@ import {faChartSimple} from "@fortawesome/free-solid-svg-icons/faChartSimple"; const createIcons = (app: any) => { library.add(faArrowRight, faPen, + faCloud, faChartSimple, faCirclePlus, faCirclePlay, diff --git a/core/datacap-web/src/i18n/langs/en/dataset.ts b/core/datacap-web/src/i18n/langs/en/dataset.ts index 725619c89e..41d30db0b2 100644 --- a/core/datacap-web/src/i18n/langs/en/dataset.ts +++ b/core/datacap-web/src/i18n/langs/en/dataset.ts @@ -48,6 +48,7 @@ export default { visualTypeArea: 'Area', visualTypePie: 'Pie', visualTypeHistogram: 'Histogram', + visualTypeWordCloud: 'Word Cloud', visualConfigure: 'Visual Configure', visualConfigureNotSpecified: 'No configuration items are available', visualConfigureXAxis: 'X Axis', diff --git a/core/datacap-web/src/i18n/langs/zhCn/dataset.ts b/core/datacap-web/src/i18n/langs/zhCn/dataset.ts index ad5f603ac9..e7aba8fb5f 100644 --- a/core/datacap-web/src/i18n/langs/zhCn/dataset.ts +++ b/core/datacap-web/src/i18n/langs/zhCn/dataset.ts @@ -48,6 +48,7 @@ export default { visualTypeArea: '面积图', visualTypePie: '饼图', visualTypeHistogram: '直方图', + visualTypeWordCloud: '词云图', visualConfigure: '可视化配置', visualConfigureNotSpecified: '暂无可用配置项', visualConfigureXAxis: 'X轴', diff --git a/core/datacap-web/src/views/admin/dataset/DatasetAdhoc.vue b/core/datacap-web/src/views/admin/dataset/DatasetAdhoc.vue index 32688bd7ae..6566a26f4d 100644 --- a/core/datacap-web/src/views/admin/dataset/DatasetAdhoc.vue +++ b/core/datacap-web/src/views/admin/dataset/DatasetAdhoc.vue @@ -222,6 +222,14 @@ + + + + + + + +