From 213da330c23fc4a30b47ca032ee49f9416c099ff Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 16 Jan 2024 19:28:06 +0100 Subject: [PATCH] highlight if a column is not available in the current plot --- src/components/charts/PlotConfigurator.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/charts/PlotConfigurator.vue b/src/components/charts/PlotConfigurator.vue index d177fa75..9af40afb 100644 --- a/src/components/charts/PlotConfigurator.vue +++ b/src/components/charts/PlotConfigurator.vue @@ -196,14 +196,20 @@ const subplots = computed((): string[] => { // Subplot keys (for selection window) return ['main_plot', ...Object.keys(plotStore.editablePlotConfig.subplots)]; }); -const usedColumns = computed((): string[] => { +const usedColumns = computed((): { html: string; value: string }[] => { + let usedCols: string[] = []; if (isMainPlot.value) { - return Object.keys(plotStore.editablePlotConfig.main_plot); + usedCols = Object.keys(plotStore.editablePlotConfig.main_plot); } if (selSubPlot.value in plotStore.editablePlotConfig.subplots) { - return Object.keys(plotStore.editablePlotConfig.subplots[selSubPlot.value]); + usedCols = Object.keys(plotStore.editablePlotConfig.subplots[selSubPlot.value]); } - return []; + return usedCols.map((col) => ({ + value: col, + html: !props.columns.includes(col) + ? `${col} <-- not available in this chart` + : col, + })); }); function addIndicator(newIndicator: Record) { @@ -372,7 +378,7 @@ watch( ); -