-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: in hover labels, harmonize start/end values of shared bins #4662
Conversation
src/traces/histogram/calc.js
Outdated
roundFn = function(v, isRightEdge) { | ||
return function() { | ||
var roundFnOpts = gd._fullLayout._roundFnOpts[groupName]; | ||
return getBinSpanLabelRound(roundFnOpts.leftGap, roundFnOpts.rightGap, binEdges, pa, calendar)(v, isRightEdge); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is getting little too long. Maybe:
return getBinSpanLabelRound(
roundFnOpts.leftGap,
roundFnOpts.rightGap,
binEdges, pa, calendar
)(v, isRightEdge);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in c387f9b
var roundFnOpts = {leftGap: Infinity, rightGap: Infinity}; | ||
if(groupName) { | ||
if(!gd._fullLayout._roundFnOpts[groupName]) gd._fullLayout._roundFnOpts[groupName] = roundFnOpts; | ||
roundFnOpts = gd._fullLayout._roundFnOpts[groupName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking,
We could rewrite this:
if(!gd._fullLayout._roundFnOpts[groupName]) {
gd._fullLayout._roundFnOpts[groupName] = roundFnOpts;
}
roundFnOpts = gd._fullLayout._roundFnOpts[groupName];
to make it easier to read 3 gd._fullLayout._roundFnOpts[groupName]
.
This branch is little behind the master. |
Is there anything that landed on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 LGTM!
Fixes #4648
Codepen: https://codepen.io/antoinerg/pen/LYVrJoZ
cc @nicolaskruchten | @plotly/plotly_js