@@ -74,6 +74,36 @@ const deckContainer = computed(() => deck3DConfigStore.deckContainer)
7474
7575async function onMainYDataSelectionChange(_newValue : string []) {
7676 logger .debug (' Main Y Data changed' , { newValue: _newValue })
77+
78+ // Reset color caches when Y data selection changes
79+ // This is necessary because the column order in the data array changes when Y data selection changes,
80+ // and the cached index in color functions becomes stale
81+ const api = recTreeStore .findApiForReqId (props .reqId )
82+ if (api === ' atl03x' || api === ' atl03s' || api === ' atl03sp' ) {
83+ const { useAtl03CnfColorMapStore } = await import (' @/stores/atl03CnfColorMapStore' )
84+ const atl03CnfStore = await useAtl03CnfColorMapStore (props .reqId .toString ())
85+ atl03CnfStore .resetColorCache ()
86+ logger .debug (' Reset atl03_cnf color cache due to Y data selection change' )
87+ }
88+ if (
89+ api === ' atl03x' ||
90+ api === ' atl03s' ||
91+ api === ' atl03sp' ||
92+ api === ' atl08' ||
93+ api === ' atl08p'
94+ ) {
95+ const { useAtl08ClassColorMapStore } = await import (' @/stores/atl08ClassColorMapStore' )
96+ const atl08ClassStore = await useAtl08ClassColorMapStore (props .reqId .toString ())
97+ atl08ClassStore .resetAtl08ClassColorCaches ()
98+ logger .debug (' Reset atl08_class color cache due to Y data selection change' )
99+ }
100+ if (api === ' atl03x' || api .includes (' atl24' )) {
101+ const { useAtl24ClassColorMapStore } = await import (' @/stores/atl24ClassColorMapStore' )
102+ const atl24ClassStore = await useAtl24ClassColorMapStore (props .reqId .toString ())
103+ atl24ClassStore .resetAtl24ClassColorCaches ()
104+ logger .debug (' Reset atl24_class color cache due to Y data selection change' )
105+ }
106+
77107 await callPlotUpdateDebounced (' from onMainYDataSelectionChange' )
78108}
79109
0 commit comments