Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da77d21

Browse files
committed
revert minExtend and patch line.color in legend style
1 parent c960d0d commit da77d21

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/legend/style.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,13 @@ module.exports = function style(s, gd) {
461461
if(pts.size()) {
462462
var cont = (trace.marker || {}).line;
463463
var lw = boundLineWidth(pieCastOption(cont.width, d0.pts), cont, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH);
464+
464465
var tMod = Lib.minExtend(trace, {marker: {line: {width: lw}}});
466+
// since minExtend do not slice more than 3 items we need to patch line.color here
467+
tMod.marker.line.color = cont.color;
468+
465469
var d0Mod = Lib.minExtend(d0, {trace: tMod});
470+
466471
stylePie(pts, d0Mod, tMod);
467472
}
468473
}

src/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ lib.minExtend = function(obj1, obj2) {
644644
if(k.charAt(0) === '_' || typeof v === 'function') continue;
645645
else if(k === 'module') objOut[k] = v;
646646
else if(Array.isArray(v)) {
647-
if(k === 'color' || k === 'colorscale') {
647+
if(k === 'colorscale') {
648648
objOut[k] = v.slice();
649649
} else {
650650
objOut[k] = v.slice(0, arrayLen);

0 commit comments

Comments
 (0)