Skip to content

Commit c960d0d

Browse files
committed
keep arraLen 3 as before - add extra condition for color similar to colorscale
1 parent b0b4250 commit c960d0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ lib.getTargetArray = function(trace, transformOpts) {
634634
lib.minExtend = function(obj1, obj2) {
635635
var objOut = {};
636636
if(typeof obj2 !== 'object') obj2 = {};
637+
var arrayLen = 3;
637638
var keys = Object.keys(obj1);
638639
var i, k, v;
639640

@@ -643,7 +644,11 @@ lib.minExtend = function(obj1, obj2) {
643644
if(k.charAt(0) === '_' || typeof v === 'function') continue;
644645
else if(k === 'module') objOut[k] = v;
645646
else if(Array.isArray(v)) {
646-
objOut[k] = v.slice();
647+
if(k === 'color' || k === 'colorscale') {
648+
objOut[k] = v.slice();
649+
} else {
650+
objOut[k] = v.slice(0, arrayLen);
651+
}
647652
} else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);
648653
else objOut[k] = v;
649654
}

0 commit comments

Comments
 (0)