diff --git a/packages/client/hmi-client/src/components/workflow/ops/simulate-ciemss/tera-simulate-ciemss-drilldown.vue b/packages/client/hmi-client/src/components/workflow/ops/simulate-ciemss/tera-simulate-ciemss-drilldown.vue index 4c55c379e1..031543f554 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/simulate-ciemss/tera-simulate-ciemss-drilldown.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/simulate-ciemss/tera-simulate-ciemss-drilldown.vue @@ -354,7 +354,6 @@ const preparedCharts = computed(() => { const result = runResults.value[selectedRunId.value]; const resultSummary = runResultsSummary.value[selectedRunId.value]; - const reverseMap: Record = {}; Object.keys(pyciemssMap).forEach((key) => { reverseMap[`${pyciemssMap[key]}_mean`] = key; diff --git a/packages/client/hmi-client/src/services/charts.ts b/packages/client/hmi-client/src/services/charts.ts index 47df499cc2..a3ce8be937 100644 --- a/packages/client/hmi-client/src/services/charts.ts +++ b/packages/client/hmi-client/src/services/charts.ts @@ -1,5 +1,5 @@ import { percentile } from '@/utils/math'; -import { isEmpty } from 'lodash'; +import { isEmpty, pick } from 'lodash'; import { VisualizationSpec } from 'vega-embed'; import { v4 as uuidv4 } from 'uuid'; import { ChartAnnotation, Intervention } from '@/types/Types'; @@ -398,8 +398,12 @@ export function createForecastChart( // Helper function to capture common layer structure const newLayer = (layer: ForecastChartLayer, markType: string) => { + const selectedFields = layer.variables.concat([layer.timeField]); + if (layer.groupField) selectedFields.push(layer.groupField); + + const data = Array.isArray(layer.data) ? { values: layer.data.map((d) => pick(d, selectedFields)) } : layer.data; const header = { - data: Array.isArray(layer.data) ? { values: layer.data } : layer.data, + data, transform: [ { fold: layer.variables,