Skip to content

Commit 16cb035

Browse files
my-tienstephprobst
authored andcommitted
Fix handleGroupingDefaults calls outside of bar/defaults.js
1 parent a3fbabf commit 16cb035

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/traces/bar/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function crossTraceDefaults(fullData, fullLayout) {
8080
traceOut.marker.cornerradius = validateCornerradius(r);
8181
}
8282

83-
handleGroupingDefaults(fullLayout.barmode, traceIn, traceOut, fullLayout, coerce);
83+
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, fullLayout.barmode);
8484
}
8585
}
8686
}

src/traces/scatter/grouping_defaults.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var getAxisGroup = require('../../plots/cartesian/constraints').getAxisGroup;
44

5-
module.exports = function handleGroupingDefaults(barmode, traceIn, traceOut, fullLayout, coerce) {
5+
module.exports = function handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, barmode) {
66
var orientation = traceOut.orientation;
77
// N.B. grouping is done across all trace types that support it
88
var posAxId = traceOut[{v: 'x', h: 'y'}[orientation] + 'axis'];
@@ -31,7 +31,8 @@ module.exports = function handleGroupingDefaults(barmode, traceIn, traceOut, ful
3131
var offsetGroupOpts = offsetGroups[offsetgroup];
3232
// in barmode 'group', traces without offsetgroup receive their own offsetgroup
3333
// in other barmodes, traces without offsetgroup are assigned to the same offset group
34-
if(barmode !== 'group' || offsetgroup) {
34+
var isBarTrace = traceOut.type === 'bar' || traceOut.type === 'waterfall';
35+
if((isBarTrace && barmode !== 'group') || offsetgroup) {
3536
if(!offsetGroupOpts) {
3637
offsetGroupOpts = offsetGroups[offsetgroup] = {
3738
offsetIndex: Object.keys(offsetGroups).length

0 commit comments

Comments
 (0)