Skip to content

Commit 6093c14

Browse files
committed
fix issue where some scatter traces would lose fill after series of hide/show operations in legend
1 parent 27a23e1 commit 6093c14

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/traces/scatter/plot.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ function createFills(gd, traceJoin, plotinfo) {
8383

8484
var trace = d[0].trace;
8585

86+
// Clear any existing fill element references to ensure clean state
87+
// This prevents stale references when fill configuration changes
88+
trace._ownFill = null;
89+
trace._nextFill = null;
90+
8691
var fillData = [];
8792
if(trace._ownfill) fillData.push('_ownFill');
8893
if(trace._nexttrace) fillData.push('_nextFill');
@@ -91,9 +96,7 @@ function createFills(gd, traceJoin, plotinfo) {
9196

9297
fillJoin.enter().append('g');
9398

94-
fillJoin.exit()
95-
.each(function(d) { trace[d] = null; })
96-
.remove();
99+
fillJoin.exit().remove();
97100

98101
fillJoin.order().each(function(d) {
99102
// make a path element inside the fill group, just so

0 commit comments

Comments
 (0)