@@ -72,6 +72,9 @@ interface Props extends VisualizationProps {
7272 properties : XYViewProperties
7373}
7474
75+ // Constants
76+ import { CLOUD } from 'src/shared/constants'
77+
7578export const Graph : FC < Props > = ( {
7679 properties,
7780 annotations,
@@ -244,20 +247,24 @@ export const Graph: FC<Props> = ({
244247 return < EmptyGraphMessage message = { INVALID_DATA_COPY } />
245248 }
246249
247- const memoizedGetColorMappingObjects = memoizeOne ( getColorMappingObjects )
248- const [ , fillColumnMap ] = createGroupIDColumn ( resultState . table , groupKey )
249- const { colorMappingForGiraffe, colorMappingForIDPE, needsToSaveToIDPE} =
250- memoizedGetColorMappingObjects ( fillColumnMap , properties )
251- const colorMapping = colorMappingForGiraffe
250+ let colorMapping = null
251+
252+ if ( CLOUD ) {
253+ const memoizedGetColorMappingObjects = memoizeOne ( getColorMappingObjects )
254+ const [ , fillColumnMap ] = createGroupIDColumn ( resultState . table , groupKey )
255+ const { colorMappingForGiraffe, colorMappingForIDPE, needsToSaveToIDPE} =
256+ memoizedGetColorMappingObjects ( fillColumnMap , properties )
257+ colorMapping = colorMappingForGiraffe
252258
253- // when the view is in a dashboard cell, and there is a need to save to IDPE, save it.
254- // when VEO is open, prevent from saving because it causes state issues. It will be handled in the timemachine code separately.
255- if ( needsToSaveToIDPE && view ?. dashboardID && ! isVeoOpen ) {
256- const newView = { ...view }
257- newView . properties . colorMapping = colorMappingForIDPE
259+ // when the view is in a dashboard cell, and there is a need to save to IDPE, save it.
260+ // when VEO is open, prevent from saving because it causes state issues. It will be handled in the timemachine code separately.
261+ if ( needsToSaveToIDPE && view ?. dashboardID && ! isVeoOpen ) {
262+ const newView = { ...view }
263+ newView . properties . colorMapping = colorMappingForIDPE
258264
259- // save to IDPE
260- dispatch ( updateViewAndVariables ( view . dashboardID , newView ) )
265+ // save to IDPE
266+ dispatch ( updateViewAndVariables ( view . dashboardID , newView ) )
267+ }
261268 }
262269
263270 const config : Config = {
@@ -298,11 +305,13 @@ export const Graph: FC<Props> = ({
298305 ] ,
299306 }
300307
301- const layer = { ...( config . layers [ 0 ] as LineLayerConfig ) }
308+ if ( CLOUD ) {
309+ const layer = { ...( config . layers [ 0 ] as LineLayerConfig ) }
302310
303- layer . colorMapping = colorMapping
311+ layer . colorMapping = colorMapping
304312
305- config . layers [ 0 ] = layer
313+ config . layers [ 0 ] = layer
314+ }
306315
307316 addAnnotationLayer (
308317 config ,
0 commit comments