@@ -292,10 +292,9 @@ const createScatterplot = (initialProperties = {}) => {
292292 if ( pointConnectionColor === 'inherit' ) {
293293 pointConnectionColor = [ ...pointColor ] ;
294294 } else {
295- pointConnectionColor =
296- pointConnectionColor === isMultipleColors ( pointConnectionColor )
297- ? [ ...pointConnectionColor ]
298- : [ pointConnectionColor ] ;
295+ pointConnectionColor = isMultipleColors ( pointConnectionColor )
296+ ? [ ...pointConnectionColor ]
297+ : [ pointConnectionColor ] ;
299298 pointConnectionColor = pointConnectionColor . map ( ( color ) =>
300299 toRgba ( color , true )
301300 ) ;
@@ -304,11 +303,9 @@ const createScatterplot = (initialProperties = {}) => {
304303 if ( pointConnectionColorActive === 'inherit' ) {
305304 pointConnectionColorActive = [ ...pointColorActive ] ;
306305 } else {
307- pointConnectionColorActive =
308- pointConnectionColorActive ===
309- isMultipleColors ( pointConnectionColorActive )
310- ? [ ...pointConnectionColorActive ]
311- : [ pointConnectionColorActive ] ;
306+ pointConnectionColorActive = isMultipleColors ( pointConnectionColorActive )
307+ ? [ ...pointConnectionColorActive ]
308+ : [ pointConnectionColorActive ] ;
312309 pointConnectionColorActive = pointConnectionColorActive . map ( ( color ) =>
313310 toRgba ( color , true )
314311 ) ;
@@ -317,10 +314,9 @@ const createScatterplot = (initialProperties = {}) => {
317314 if ( pointConnectionColorHover === 'inherit' ) {
318315 pointConnectionColorHover = [ ...pointColorHover ] ;
319316 } else {
320- pointConnectionColorHover =
321- pointConnectionColorHover === isMultipleColors ( pointConnectionColorHover )
322- ? [ ...pointConnectionColorHover ]
323- : [ pointConnectionColorHover ] ;
317+ pointConnectionColorHover = isMultipleColors ( pointConnectionColorHover )
318+ ? [ ...pointConnectionColorHover ]
319+ : [ pointConnectionColorHover ] ;
324320 pointConnectionColorHover = pointConnectionColorHover . map ( ( color ) =>
325321 toRgba ( color , true )
326322 ) ;
@@ -2027,7 +2023,8 @@ const createScatterplot = (initialProperties = {}) => {
20272023 return lassoInitiatorParentElement ;
20282024 if ( property === 'keyMap' ) return { ...keyMap } ;
20292025 if ( property === 'mouseMode' ) return mouseMode ;
2030- if ( property === 'opacity' ) return opacity ;
2026+ if ( property === 'opacity' )
2027+ return opacity . length === 1 ? opacity [ 0 ] : opacity ;
20312028 if ( property === 'opacityBy' ) return opacityBy ;
20322029 if ( property === 'pointColor' )
20332030 return pointColor . length === 1 ? pointColor [ 0 ] : pointColor ;
@@ -2040,22 +2037,36 @@ const createScatterplot = (initialProperties = {}) => {
20402037 ? pointColorHover [ 0 ]
20412038 : pointColorHover ;
20422039 if ( property === 'pointOutlineWidth' ) return pointOutlineWidth ;
2043- if ( property === 'pointSize' ) return pointSize ;
2040+ if ( property === 'pointSize' )
2041+ return pointSize . length === 1 ? pointSize [ 0 ] : pointSize ;
20442042 if ( property === 'pointSizeSelected' ) return pointSizeSelected ;
20452043 if ( property === 'pointSizeMouseDetection' ) return pointSizeMouseDetection ;
20462044 if ( property === 'showPointConnections' ) return showPointConnections ;
2047- if ( property === 'pointConnectionColor' ) return pointConnectionColor ;
2045+ if ( property === 'pointConnectionColor' )
2046+ return pointConnectionColor . length === 1
2047+ ? pointConnectionColor [ 0 ]
2048+ : pointConnectionColor ;
20482049 if ( property === 'pointConnectionColorActive' )
2049- return pointConnectionColorActive ;
2050+ return pointConnectionColorActive . length === 1
2051+ ? pointConnectionColorActive [ 0 ]
2052+ : pointConnectionColorActive ;
20502053 if ( property === 'pointConnectionColorHover' )
2051- return pointConnectionColorHover ;
2054+ return pointConnectionColorHover . length === 1
2055+ ? pointConnectionColorHover [ 0 ]
2056+ : pointConnectionColorHover ;
20522057 if ( property === 'pointConnectionColorBy' ) return pointConnectionColorBy ;
2053- if ( property === 'pointConnectionOpacity' ) return pointConnectionOpacity ;
2058+ if ( property === 'pointConnectionOpacity' )
2059+ return pointConnectionOpacity . length === 1
2060+ ? pointConnectionOpacity [ 0 ]
2061+ : pointConnectionOpacity ;
20542062 if ( property === 'pointConnectionOpacityBy' )
20552063 return pointConnectionOpacityBy ;
20562064 if ( property === 'pointConnectionOpacityActive' )
20572065 return pointConnectionOpacityActive ;
2058- if ( property === 'pointConnectionSize' ) return pointConnectionSize ;
2066+ if ( property === 'pointConnectionSize' )
2067+ return pointConnectionSize . length === 1
2068+ ? pointConnectionSize [ 0 ]
2069+ : pointConnectionSize ;
20592070 if ( property === 'pointConnectionSizeActive' )
20602071 return pointConnectionSizeActive ;
20612072 if ( property === 'pointConnectionSizeBy' ) return pointConnectionSizeBy ;
0 commit comments