Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/traces/histogram/cross_trace_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
if(!groupName) groupName = fallbackGroupName;

var axType = getAxisType(traceOut, binDir);
var calendar = traceOut[binDir + 'calendar'];
var calendar = traceOut[binDir + 'calendar'] || '';
var binOpts = allBinOpts[groupName];
var needsNewItem = true;

Expand Down
30 changes: 30 additions & 0 deletions test/jasmine/tests/histogram_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var Plotly = require('@lib/index');
var Plots = require('@src/plots/plots');
var Lib = require('@src/lib');
var Registry = require('@src/registry');
var setConvert = require('@src/plots/cartesian/set_convert');

var supplyDefaults = require('@src/traces/histogram/defaults');
Expand Down Expand Up @@ -478,6 +479,35 @@ describe('Test histogram', function() {
);
});

it('should attempt to group traces when the *calendars* module is not registered', function() {
var original = Registry.getComponentMethod;
var cnt = 0;

spyOn(Registry, 'getComponentMethod').and.callFake(function() {
if(arguments[0] === 'calendars') {
cnt++;
return Lib.noop;
} else {
return original.call(arguments);
}
});

gd = {
data: [
{uid: 'a', type: 'histogram', x: [1, 3]},
{uid: 'b', type: 'histogram', x: [1, 20]}
],
layout: {barmode: 'stack'}
};
supplyAllDefaults(gd);

_assert('', [
['xyx', [0, 1]]
]);

expect(cnt).toBe(3, '# of Registry.getComponentMethod calls for *calendars* methods');
});

it('should force traces that "have to match" to have same bingroup (alignmentgroup case)', function() {
var traces;

Expand Down