Skip to content

Commit 3287ada

Browse files
committed
Fix - Reset mutable config in config watcher
1 parent a9db65b commit 3287ada

30 files changed

+131
-1
lines changed

src/components/vue-ui-3d-bar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ watch(() => props.config, (_newCfg) => {
100100
prepareChart();
101101
titleStep.value += 1;
102102
tableStep.value += 1;
103+
104+
// Reset mutable config
105+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
103106
}, { deep: true });
104107
105108
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-age-pyramid.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ watch(() => props.config, (_newCfg) => {
9999
prepareChart();
100100
titleStep.value += 1;
101101
tableStep.value += 1;
102+
103+
// Reset mutable config
104+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
105+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.tooltip.show;
102106
}, { deep: true });
103107
104108
const resizeObserver = ref(null);

src/components/vue-ui-candlestick.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ watch(() => props.config, (_newCfg) => {
127127
slicerStep.value += 1;
128128
titleStep.value += 1;
129129
tableStep.value += 1;
130+
131+
// Reset mutable config
132+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
133+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.tooltip.show;
130134
}, { deep: true });
131135
132136
watch(() => props.dataset, (newDs) => {

src/components/vue-ui-chestnut.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ function prepareConfig() {
9292
watch(() => props.config, (_newCfg) => {
9393
FINAL_CONFIG.value = prepareConfig();
9494
userOptionsVisible.value = !FINAL_CONFIG.value.showOnChartHover;
95+
96+
// Reset mutable config
97+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
98+
9599
prepareChart();
96100
}, { deep: true });
97101

src/components/vue-ui-donut-evolution.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ watch(() => props.config, (_newCfg) => {
212212
titleStep.value += 1;
213213
tableStep.value += 1;
214214
legendStep.value += 1;
215+
216+
// Reset mutable config
217+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
215218
}, { deep: true });
216219
217220
watch(() => props.dataset, (_) => {

src/components/vue-ui-donut.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ watch(() => props.config, (_newCfg) => {
175175
titleStep.value += 1;
176176
tableStep.value += 1;
177177
legendStep.value += 1;
178+
179+
// Reset mutable config
180+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.layout.labels.dataLabels.show;
181+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
182+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
178183
}, { deep: true });
179184
180185
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-dumbbell.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ watch(() => props.config, (_newCfg) => {
107107
legendStep.value += 1;
108108
baseRowHeight.value = FINAL_CONFIG.value.style.chart.rowHeight;
109109
baseWidth.value = FINAL_CONFIG.value.style.chart.width;
110+
111+
// Reset mutable config
112+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
110113
}, { deep: true });
111114
112115
watch(() => props.dataset, (_) => {

src/components/vue-ui-flow.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ watch(() => props.config, (_newCfg) => {
108108
userOptionsVisible.value = !FINAL_CONFIG.value.showOnChartHover;
109109
prepareChart();
110110
titleStep.value += 1;
111+
112+
// Reset mutable config
113+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
111114
}, { deep: true });
112115
113116
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-funnel.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ watch(() => props.config, (_newCfg) => {
170170
fontSizes.value.names = FINAL_CONFIG.value.style.chart.bars.dataLabels.name.fontSize;
171171
fontSizes.value.values = FINAL_CONFIG.value.style.chart.bars.dataLabels.value.fontSize;
172172
173+
// Reset mutable config
174+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
173175
}, { deep: true });
174176
175177
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-galaxy.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ watch(() => props.config, (_newCfg) => {
129129
titleStep.value += 1;
130130
tableStep.value += 1;
131131
legendStep.value += 1;
132+
133+
// Reset mutable config
134+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.layout.labels.dataLabels.show;
135+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
136+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
132137
}, { deep: true });
133138
134139
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-heatmap.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ watch(() => props.config, (_newCfg) => {
120120
userOptionsVisible.value = !FINAL_CONFIG.value.showOnChartHover;
121121
prepareChart();
122122
titleStep.value += 1;
123+
124+
// Reset mutable config
125+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
126+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.tooltip.show;
123127
}, { deep: true });
124128
125129
watch(() => props.dataset, () => {

src/components/vue-ui-history-plot.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ watch(() => props.config, (_newCfg) => {
266266
sizes.value.xAxisName = FINAL_CONFIG.value.style.chart.axes.x.name.fontSize;
267267
sizes.value.yAxisLabels = FINAL_CONFIG.value.style.chart.axes.y.labels.fontSize;
268268
sizes.value.yAxisName = FINAL_CONFIG.value.style.chart.axes.y.name.fontSize;
269+
270+
// Reset mutable config
271+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
272+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
269273
}, { deep: true });
270274
271275
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-molecule.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ watch(() => props.config, (_newCfg) => {
115115
prepareChart();
116116
titleStep.value += 1;
117117
tableStep.value += 1;
118+
119+
// Reset mutable config
120+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
121+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
118122
}, { deep: true });
119123
120124
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-mood-radar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ watch(() => props.config, (_newCfg) => {
107107
titleStep.value += 1;
108108
tableStep.value += 1;
109109
legendStep.value += 1;
110+
111+
// Reset mutable config
112+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
110113
}, { deep: true });
111114
112115
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-nested-donuts.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ watch(() => props.config, (_newCfg) => {
116116
titleStep.value += 1;
117117
tableStep.value += 1;
118118
legendStep.value += 1;
119+
120+
// Reset mutable config
121+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.layout.labels.dataLabels.show;
122+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
123+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
119124
}, { deep: true });
120125
121126
const resizeObserver = ref(null);

src/components/vue-ui-onion.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ watch(() => props.config, (_newCfg) => {
105105
titleStep.value += 1;
106106
tableStep.value += 1;
107107
legendStep.value += 1;
108+
109+
// Reset mutable config
110+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
111+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
108112
}, { deep: true });
109113
110114
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-parallel-coordinate-plot.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ watch(() => props.config, (_newCfg) => {
119119
titleStep.value += 1;
120120
tableStep.value += 1;
121121
legendStep.value += 1;
122+
123+
// Reset mutable config
124+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.yAxis.labels.datapoints.show;
125+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
126+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
122127
}, { deep: true });
123128
124129
const resizeObserver = ref(null);

src/components/vue-ui-quadrant.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ watch(() => props.config, (_newCfg) => {
112112
titleStep.value += 1;
113113
tableStep.value += 1;
114114
legendStep.value += 1;
115+
116+
// Reset mutable config
117+
mutableConfig.value.plotLabels.show = FINAL_CONFIG.value.style.chart.layout.labels.plotLabels.show;
118+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
119+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
115120
}, { deep: true });
116121
117122
const resizeObserver = ref(null);

src/components/vue-ui-quick-chart.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ watch(() => props.config, (_newCfg) => {
132132
defaultSizes.value.height = FINAL_CONFIG.value.height;
133133
userOptionsVisible.value = !FINAL_CONFIG.value.showUserOptionsOnChartHover;
134134
prepareChart();
135+
136+
// Reset mutable config
137+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.showTooltip;
135138
}, { deep: true });
136139
137140
watch(() => props.dataset, (_) => {

src/components/vue-ui-radar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ watch(() => props.config, (_newCfg) => {
111111
titleStep.value += 1;
112112
tableStep.value += 1;
113113
legendStep.value += 1;
114+
115+
// Reset mutable config
116+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.layout.labels.dataLabels.show;
117+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
118+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tootlip.show;
114119
}, { deep: true });
115120
116121
const resizeObserver = ref(null);

src/components/vue-ui-rings.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ watch(() => props.config, (_newCfg) => {
114114
titleStep.value += 1;
115115
tableStep.value += 1;
116116
legendStep.value += 1;
117+
118+
// Reset mutable config
119+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
120+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
117121
}, { deep: true });
118122
119123
const resizeObserver = ref(null);

src/components/vue-ui-scatter.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ watch(() => props.config, (_newCfg) => {
111111
titleStep.value += 1;
112112
tableStep.value += 1;
113113
legendStep.value += 1;
114+
115+
// Reset mutable config
116+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
117+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.tooltip.show;
114118
}, { deep: true });
115119
116120
const resizeObserver = ref(null);

src/components/vue-ui-stackbar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ watch(() => props.config, (_newCfg) => {
163163
titleStep.value += 1;
164164
tableStep.value += 1;
165165
legendStep.value += 1;
166+
167+
// Reset mutable config
168+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.bars.dataLabels.show;
169+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
170+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
166171
}, { deep: true });
167172
168173
watch(() => props.dataset, (_) => {

src/components/vue-ui-strip-plot.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ watch(() => props.config, (_newCfg) => {
114114
prepareChart();
115115
titleStep.value += 1;
116116
tableStep.value += 1;
117+
118+
// Reset mutable config
119+
mutableConfig.value.dataLabels.show = FINAL_CONFIG.value.style.chart.labels.bestPlotLabel.show;
120+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
121+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
117122
}, { deep: true });
118123
119124
const resizeObserver = ref(null);

src/components/vue-ui-treemap.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ watch(() => props.config, (_newCfg) => {
122122
titleStep.value += 1;
123123
tableStep.value += 1;
124124
legendStep.value += 1;
125+
126+
// Reset mutable config
127+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
128+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
125129
}, { deep: true });
126130
127131
const { isPrinting, isImaging, generatePdf, generateImage } = usePrinter({

src/components/vue-ui-vertical-bar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ watch(() => props.config, (_newCfg) => {
113113
legendStep.value += 1;
114114
barHeight.value = FINAL_CONFIG.value.style.chart.layout.bars.height;
115115
barGap.value = FINAL_CONFIG.value.style.chart.layout.bars.gap;
116+
117+
// Reset mutable config
118+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
119+
mutableConfig.value.sortDesc = FINAL_CONFIG.value.style.chart.layout.bars.sort === "desc";
120+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
116121
}, { deep: true });
117122
118123
watch(() => props.dataset, recalculateHeight, { deep: true });

src/components/vue-ui-waffle.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ watch(() => props.config, (_newCfg) => {
114114
titleStep.value += 1;
115115
tableStep.value += 1;
116116
legendStep.value += 1;
117+
118+
// Reset mutable config
119+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
120+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
117121
}, { deep: true });
118122
119123
const resizeObserver = ref(null);

src/components/vue-ui-word-cloud.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ watch(() => props.config, (_newCfg) => {
107107
titleStep.value += 1;
108108
tableStep.value += 1;
109109
refreshSlicer();
110+
111+
// Reset mutable config
112+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
113+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
110114
}, { deep: true });
111115
112116
const chartSlicer = ref(null);

src/components/vue-ui-xy-canvas.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
downloadCsv,
2121
error,
2222
functionReturnsString,
23+
hasDeepProperty,
2324
isFunction,
2425
lightenHexColor,
2526
largestTriangleThreeBucketsArray,
@@ -28,7 +29,6 @@ import {
2829
sanitizeArray,
2930
setOpacity,
3031
themePalettes,
31-
hasDeepProperty,
3232
} from "../lib";
3333
import { throttle } from "../canvas-lib";
3434
import {
@@ -182,6 +182,12 @@ watch(() => props.config, (_newCfg) => {
182182
titleStep.value += 1;
183183
tableStep.value += 1;
184184
legendStep.value += 1;
185+
186+
// Reset mutable config
187+
mutableConfig.value.showTable = FINAL_CONFIG.value.table.show;
188+
mutableConfig.value.showDataLabels = FINAL_CONFIG.value.style.chart.dataLabels.show;
189+
mutableConfig.value.stacked = FINAL_CONFIG.value.style.chart.stacked;
190+
mutableConfig.value.showTooltip = FINAL_CONFIG.value.style.chart.tooltip.show;
185191
}, { deep: true });
186192
187193
watch(() => props.dataset, () => {

src/components/vue-ui-xy.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,17 @@ export default {
14431443
this.prepareChart();
14441444
this.titleStep += 1;
14451445
this.tableStep += 1;
1446+
1447+
// Reset mutable config
1448+
this.mutableConfig = {
1449+
dataLabels: {
1450+
show: true,
1451+
},
1452+
showTooltip: this.FINAL_CONFIG.chart.tooltip.show === true,
1453+
showTable: this.FINAL_CONFIG.showTable === true,
1454+
isStacked: this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked,
1455+
useIndividualScale: this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale
1456+
}
14461457
},
14471458
deep: true
14481459
}

0 commit comments

Comments
 (0)