From eee67763b5de43ed70767fce61b3580c46512061 Mon Sep 17 00:00:00 2001 From: lana-k Date: Tue, 10 Dec 2024 21:41:07 +0100 Subject: [PATCH] plotly in pivot --- .../Tabs/Tab/DataView/Chart/index.vue | 42 ++++++------ .../Tabs/Tab/DataView/Pivot/PivotUi/index.vue | 23 +------ .../Tabs/Tab/DataView/Pivot/index.vue | 64 ++++++++++++------- .../Tabs/Tab/DataView/Pivot/pivotHelper.js | 11 +--- src/views/Main/Workspace/Tabs/Tab/index.vue | 1 + 5 files changed, 67 insertions(+), 74 deletions(-) diff --git a/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue b/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue index 2968fea..171c35b 100644 --- a/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue +++ b/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue @@ -3,23 +3,24 @@
There is no data to build a chart. Run your SQL query and make sure the result is not empty.
- +
+ +
@@ -105,11 +106,10 @@ export default { } }, methods: { - handleResize () { + async handleResize () { this.visible = false - this.$nextTick(() => { - this.visible = true - }) + await this.$nextTick() + this.visible = true }, onRender (data, layout, frames) { // TODO: check changes and enable Save button if needed diff --git a/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/PivotUi/index.vue b/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/PivotUi/index.vue index a8dbc7d..cc68a7d 100644 --- a/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/PivotUi/index.vue +++ b/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/PivotUi/index.vue @@ -140,13 +140,11 @@ import $ from 'jquery' import Multiselect from 'vue-multiselect' import PivotSortBtn from './PivotSortBtn' import { renderers, aggregators, zeroValAggregators, twoValAggregators } from '../pivotHelper' -import Chart from '@/views/Main/Workspace/Tabs/Tab/DataView/Chart' -import { createApp } from 'vue' export default { name: 'pivotUi', props: ['keyNames', 'modelValue'], - emits: ['loadingCustomChartImageCompleted', 'update:modelValue', 'update'], + emits: ['update:modelValue', 'update'], components: { Multiselect, PivotSortBtn @@ -163,13 +161,7 @@ export default { val1: (this.modelValue && this.modelValue.vals && this.modelValue.vals[0]) || '', val2: (this.modelValue && this.modelValue.vals && this.modelValue.vals[1]) || '', colOrder: (this.modelValue && this.modelValue.colOrder) || 'key_a_to_z', - rowOrder: (this.modelValue && this.modelValue.rowOrder) || 'key_a_to_z', - customChartComponent: - ( - this.modelValue && - this.modelValue.rendererOptions && - this.modelValue.rendererOptions.customChartComponent - ) || createApp(Chart) + rowOrder: (this.modelValue && this.modelValue.rowOrder) || 'key_a_to_z' } }, computed: { @@ -223,12 +215,6 @@ export default { this.returnValue() } }, - created () { - this.customChartComponent.onUpdate = () => { this.$emit('update') } - this.customChartComponent.onLoadingImageCompleted = () => { - this.$emit('loadingCustomChartImageCompleted') - } - }, methods: { returnValue () { const vals = [] @@ -245,11 +231,6 @@ export default { aggregatorName: this.aggregator.name, renderer: this.renderer.fun, rendererName: this.renderer.name, - rendererOptions: this.renderer.name !== 'Custom chart' - ? undefined - : { - customChartComponent: this.customChartComponent - }, vals }) } diff --git a/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/index.vue b/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/index.vue index f2cca67..0db18e2 100644 --- a/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/index.vue +++ b/src/views/Main/Workspace/Tabs/Tab/DataView/Pivot/index.vue @@ -7,14 +7,24 @@ :key-names="columns" v-model="pivotOptions" @update="$emit('update')" - @loadingCustomChartImageCompleted="$emit('loadingImageCompleted')" />
+
+ +