Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

histogram: remove gap when barmode is relative #3652

Merged
merged 3 commits into from
Mar 19, 2019
Merged

histogram: remove gap when barmode is relative #3652

merged 3 commits into from
Mar 19, 2019

Conversation

antoinerg
Copy link
Contributor

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

cc @nicolaskruchten

@@ -46,7 +48,6 @@ module.exports = function(layoutIn, layoutOut, fullData) {

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.

@@ -46,7 +46,10 @@ module.exports = function(layoutIn, layoutOut, fullData) {
}
}

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
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
Member

Thanks guys!

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

Successfully merging this pull request may close these issues.

None yet

4 participants