@@ -103,17 +103,17 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
103
103
} ;
104
104
105
105
// Helper to determine pin color based on KPI score
106
- const getPinColor = ( score , isSelected ) => {
107
- if ( isSelected ) return 'yellow' ; // Highlight selected item with yellow
106
+ const getPinColor = ( score ) => {
108
107
if ( score === null || score === undefined || score <= 0 ) return "gray" ; // Default for missing data
109
108
const normalized = Math . min ( Math . max ( score , 0 ) , 1 ) ; // Normalize to [0, 1]
110
109
return interpolateColor ( normalized ) ;
111
110
} ;
112
111
113
112
// Custom cluster icon
114
- const createClusterCustomIcon = ( cluster , isSelected ) => {
113
+ const createClusterCustomIcon = ( cluster ) => {
115
114
const childCount = cluster . getChildCount ( ) ;
116
115
const childMarkers = cluster . getAllChildMarkers ( ) ;
116
+
117
117
const avgScore = (
118
118
childMarkers
119
119
. map ( ( marker ) => {
@@ -125,8 +125,8 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
125
125
. reduce ( ( sum , score ) => sum + score , 0 ) / childCount
126
126
) . toFixed ( 2 ) ;
127
127
128
- const size = Math . min ( 20 + childCount * 2 , 80 ) ;
129
- const color = getPinColor ( avgScore , isSelected ) ;
128
+ let size = Math . min ( 20 + childCount * 2 , 80 ) ;
129
+ const color = getPinColor ( avgScore ) ;
130
130
131
131
return L . divIcon ( {
132
132
className : "dummy" ,
@@ -182,7 +182,7 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
182
182
showCoverageOnHover = { false }
183
183
spiderfyOnMaxZoom = { false }
184
184
zoomToBoundsOnClick = { false }
185
- iconCreateFunction = { ( cluster ) => createClusterCustomIcon ( cluster , cluster ?. layer ?. getAllChildMarkers ( ) === selectedData || false ) }
185
+ iconCreateFunction = { ( cluster ) => createClusterCustomIcon ( cluster ) }
186
186
eventHandlers = { {
187
187
clusterclick : ( e ) => {
188
188
const cluster = e . layer ;
@@ -203,12 +203,13 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
203
203
} }
204
204
icon = { L . divIcon ( {
205
205
className : "dummy" ,
206
- html : `<div class="custom-pin" style="background-color: ${ getPinColor (
207
- instance [ selectedKPI ] ,
208
- selectedData ?. instanceScore === instance [ selectedKPI ] &&
209
- selectedData ?. orchObj === instance ?. orchObj &&
210
- selectedData ?. instanceObj === instance ?. instanceObj
211
- ) } ; width: 24px; height: 24px; border-radius: 50%;"></div>`,
206
+ html : `<div class="custom-pin" style="background-color: ${ selectedData ?. instanceObj ?. id === instance . id ? "var(--magenta)" :
207
+ getPinColor ( instance [ selectedKPI ] )
208
+ } ; width: ${ selectedData ?. instanceObj ?. id === instance . id ? "36px" :
209
+ "24px"
210
+ } ; height: ${ selectedData ?. instanceObj ?. id === instance . id ? "36px" :
211
+ "24px"
212
+ } ; border-radius: 50%;"></div>`,
212
213
} ) }
213
214
eventHandlers = { {
214
215
click : ( ) => {
0 commit comments