From 8ba42f30a5118dde0d4cb642d7d70caf05417521 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 21 May 2023 20:06:49 +0200 Subject: [PATCH] Interactive color selection box on click --- src/components/charts/PlotIndicator.vue | 38 +++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/charts/PlotIndicator.vue b/src/components/charts/PlotIndicator.vue index 99ef193e..c283b68f 100644 --- a/src/components/charts/PlotIndicator.vue +++ b/src/components/charts/PlotIndicator.vue @@ -13,9 +13,16 @@ -
+
- + + @@ -39,6 +46,7 @@ import { ChartType, IndicatorConfig } from '@/types'; import randomColor from '@/shared/randomColor'; import PlotIndicatorSelect from '@/components/charts/PlotIndicatorSelect.vue'; import { computed, ref, watch } from 'vue'; +import { watchDebounced } from '@vueuse/core'; const props = defineProps({ modelValue: { required: true, type: Object as () => Record }, @@ -94,21 +102,15 @@ watch( }, ); -watch([selColor, graphType, fillTo], () => { - emitIndicator(); -}); +watchDebounced( + [selColor, graphType, fillTo], + () => { + emitIndicator(); + }, + { + debounce: 200, + }, +); - +