Skip to content

Conversation

antoinerg
Copy link
Contributor

Fixes #3649 but I am not sure this is what @alexcjohnson had in mind!

cc @nicolaskruchten

}
}

if(!hasBars) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should

delete layoutOut.barmode;

when hasBars is false, so that it doesn't pollute fullLayout.


if(!hasBars) return;
if(!hasBars) {
delete layoutOut.barmode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ a jasmine test in bar_test.js plz 😏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a jasmine test that checks _fullLayout doesn't have a barmode?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that and the converse. Similar to

it('should not include alignementgroup/offsetgroup when barmode is not *group*', function() {
var gd = {
data: [{type: 'bar', y: [1], alignmentgroup: 'a', offsetgroup: '1'}],
layout: {barmode: 'group'}
};
supplyAllDefaults(gd);
expect(gd._fullData[0].alignmentgroup).toBe('a', 'alignementgroup');
expect(gd._fullData[0].offsetgroup).toBe('1', 'offsetgroup');
gd.layout.barmode = 'stack';
supplyAllDefaults(gd);
expect(gd._fullData[0].alignmentgroup).toBe(undefined, 'alignementgroup');
expect(gd._fullData[0].offsetgroup).toBe(undefined, 'offsetgroup');
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in bc3890b

@alexcjohnson
Copy link
Collaborator

That's exactly what I had in mind, thx!

@etpinard etpinard added bug something broken status: reviewable labels Mar 19, 2019
@etpinard etpinard added this to the v1.46.0 milestone Mar 19, 2019
@etpinard
Copy link
Contributor

Ok, let's start merging things for 1.46.0

💃 💃 💃

@antoinerg antoinerg merged commit 5270abb into master Mar 19, 2019
@antoinerg antoinerg deleted the fix-3649 branch March 19, 2019 20:22
@nicolaskruchten
Copy link
Contributor

Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants