diff --git a/packages/libs/eda/src/lib/map/analysis/hooks/defaultOverlayConfig.ts b/packages/libs/eda/src/lib/map/analysis/hooks/defaultOverlayConfig.ts index 9d691b1632..17e9d751c1 100644 --- a/packages/libs/eda/src/lib/map/analysis/hooks/defaultOverlayConfig.ts +++ b/packages/libs/eda/src/lib/map/analysis/hooks/defaultOverlayConfig.ts @@ -43,7 +43,7 @@ export async function getDefaultOverlayConfig( entityId: overlayEntity.id, }; - if (overlayVariable.vocabulary) { + if (overlayVariable.dataShape === 'categorical') { // categorical const overlayValues = await getMostFrequentValues({ studyId: studyId, diff --git a/packages/libs/eda/src/lib/map/analysis/hooks/standaloneMapMarkers.tsx b/packages/libs/eda/src/lib/map/analysis/hooks/standaloneMapMarkers.tsx index 19c3267183..f19806642c 100644 --- a/packages/libs/eda/src/lib/map/analysis/hooks/standaloneMapMarkers.tsx +++ b/packages/libs/eda/src/lib/map/analysis/hooks/standaloneMapMarkers.tsx @@ -289,11 +289,14 @@ export function useStandaloneMapMarkers( overlayType === 'categorical' ? ColorPaletteDefault[vocabulary.indexOf(binLabel)] : gradientSequentialColorscaleMap( - vocabulary.indexOf(binLabel) / (vocabulary.length - 1) + vocabulary.length > 1 + ? vocabulary.indexOf(binLabel) / + (vocabulary.length - 1) + : 0.5 ), })) : []; - + console.log({ donutData, overlayType, vocabulary }); // TO DO: address diverging colorscale (especially if there are use-cases) // now reorder the data, adding zeroes if necessary. @@ -382,7 +385,9 @@ export function useStandaloneMapMarkers( ? ColorPaletteDefault[vocabulary.indexOf(label)] : overlayType === 'continuous' ? gradientSequentialColorscaleMap( - vocabulary.indexOf(label) / (vocabulary.length - 1) + vocabulary.length > 1 + ? vocabulary.indexOf(label) / (vocabulary.length - 1) + : 0.5 ) : undefined, // has any geo-facet got an array of overlay data