Skip to content

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jun 15, 2021

Fixes #5731.

@plotly/plotly_js

@archmoj archmoj added bug something broken status: reviewable labels Jun 15, 2021
@archmoj archmoj added this to the NEXT milestone Jun 15, 2021
@nicolaskruchten
Copy link
Contributor

Behaviour looks good.

@archmoj archmoj requested a review from alexcjohnson June 16, 2021 16:48
@nicolaskruchten
Copy link
Contributor

Interestingly, box and violin don't seem to suffer from this problem even on master ... normal?

@archmoj
Copy link
Contributor Author

archmoj commented Jun 16, 2021

Interestingly, box and violin don't seem to suffer from this problem even on master ... normal?

Positive. Thanks for checking.


var type = (opts.posAxis || {}).type;
if(type === 'category' || type === 'multicategory') {
this.minDiff = Math.min(1, this.minDiff);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a great solution, and simpler than the previous logic. My only question is whether there's actually a benefit of doing Math.min vs just minDiff = 1 in the (multi)category case? There's no way to specify input data that will result in non-integer positions here, is there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Set to one in 6e6bfa6.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

@archmoj archmoj merged commit ebf971e into master Jun 17, 2021
@archmoj archmoj deleted the fix5731-category-bar-width branch June 17, 2021 16:38
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.

bar widths and categoryarray

3 participants