Skip to content

Commit 21ce92b

Browse files
authored
Merge pull request #7811 from plotly/cam/7791/box-to-violin-plot-fix
fix: Handle `react` call going from box to violin plot
2 parents dbefbad + 2875585 commit 21ce92b

3 files changed

Lines changed: 621 additions & 452 deletions

File tree

draftlogs/7811_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Update box plot defaults to handle situation where `Plotly.react` is called to switch from box to violin plot [[#7811](https://github.com/plotly/plotly.js/pull/7811)]

src/traces/box/defaults.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
9797

9898
traceOut._hasPreCompStats = q1 && q1.length && median && median.length && q3 && q3.length;
9999
sLen = Math.min(Lib.minRowLength(q1), Lib.minRowLength(median), Lib.minRowLength(q3));
100+
} else {
101+
// Non-box (violin) traces don't support pre-computed stats; set explicitly
102+
// so Plotly.react's relinkPrivateKeys can't carry over a stale truthy value.
103+
traceOut._hasPreCompStats = false;
100104
}
101105

102106
var yDims = getDims(y);

0 commit comments

Comments
 (0)