Skip to content

Commit c2994e7

Browse files
committed
More carefully track legend trace isolation indices
1 parent 728a6f4 commit c2994e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/legend/draw.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ function handleClick(g, gd, numClicks) {
512512

513513
for(i = 0; i < fullData.length; i++) {
514514
allTraces.push(i);
515+
// Allow the legendonly state through for *all* trace types (including
516+
// carpet for which it's overridden with true/false in supplyDefaults)
515517
traceVisibility.push('legendonly');
516518
}
517519

@@ -542,7 +544,11 @@ function handleClick(g, gd, numClicks) {
542544
if(sameAsLast) {
543545
traceVisibility = true;
544546
}
545-
Plotly.restyle(gd, 'visible', traceVisibility, allTraces);
547+
var visibilityUpdates = [];
548+
for(i = 0; i < fullData.length; i++) {
549+
visibilityUpdates.push(allTraces[i]);
550+
}
551+
Plotly.restyle(gd, 'visible', traceVisibility, visibilityUpdates);
546552
}
547553
}
548554
}

0 commit comments

Comments
 (0)