File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,19 @@ class UnconnectedMarkerColor extends Component {
106
106
let adjustedColors = colors ;
107
107
108
108
if ( colorscaleType !== 'categorical' ) {
109
- adjustedColors = adjustColorscale ( colors , numberOfTraces ) ;
109
+ adjustedColors = adjustColorscale ( colors , numberOfTraces , colorscaleType ) ;
110
110
}
111
111
112
112
if (
113
113
adjustedColors . every ( c => c === adjustedColors [ 0 ] ) ||
114
114
colorscaleType === 'categorical'
115
115
) {
116
- adjustedColors = adjustColorscale ( colors , numberOfTraces , { repeat : true } ) ;
116
+ adjustedColors = adjustColorscale (
117
+ colors ,
118
+ numberOfTraces ,
119
+ colorscaleType ,
120
+ { repeat : true }
121
+ ) ;
117
122
}
118
123
119
124
const updates = adjustedColors . map ( color => ( {
Original file line number Diff line number Diff line change @@ -182,7 +182,11 @@ function adjustColorscale(
182
182
colorscaleType ,
183
183
config
184
184
) {
185
- if ( config . repeat ) {
185
+ if ( config && config . repeat ) {
186
+ if ( numberOfNeededColors < colorscale . length ) {
187
+ return colorscale . slice ( 0 , numberOfNeededColors ) ;
188
+ }
189
+
186
190
const repetitions = Math . ceil ( numberOfNeededColors / colorscale . length ) ;
187
191
const newArray = new Array ( repetitions ) . fill ( colorscale ) ;
188
192
return newArray
You can’t perform that action at this time.
0 commit comments