Skip to content

Commit 38fd2f9

Browse files
committed
Refactor conditional check and update draftlog
1 parent 48e40ec commit 38fd2f9

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

draftlogs/7507_fix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix `histogram` autobin size for single-point traces in `overlay` mode on data updates via `Plotly.react` [[#7507](https://github.com/plotly/plotly.js/pull/7507)]
1+
Fix `histogram` autobin size for single-point traces in `overlay` mode on data updates via `Plotly.react` [[#7507](https://github.com/plotly/plotly.js/pull/7507)], with thanks to @Lexachoc for the contribution!

src/traces/histogram/calc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,9 @@ function calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {
328328
// Edge case: single-valued histogram overlaying others
329329
// Use them all together to calculate the bin size for the single-valued one
330330
// Don't re-calculate bin width if user manually specified it
331-
// Check if bingroup or bin size is defined
332331
if(isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 &&
333332
pa.type !== 'category' && pa.type !== 'multicategory' &&
334-
trace.bingroup === '' && trace._input?.[binAttr]?.size === undefined) {
333+
trace.bingroup === '' && !trace._input[binAttr]?.size) {
335334
// Several single-valued histograms! Stop infinite recursion,
336335
// just return an extra flag that tells handleSingleValueOverlays
337336
// to sort out this trace too

0 commit comments

Comments
 (0)