Skip to content

Commit

Permalink
histogram: improve code readability of calc
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Mar 19, 2020
1 parent ec448f2 commit c387f9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/traces/histogram/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function calc(gd, trace) {
};
}

// stash left and right gaps by group
if(!gd._fullLayout._roundFnOpts) gd._fullLayout._roundFnOpts = {};
var groupName = trace['_' + mainData + 'bingroup'];
var roundFnOpts = {leftGap: Infinity, rightGap: Infinity};
Expand Down Expand Up @@ -140,7 +141,11 @@ function calc(gd, trace) {
roundFn = function(v, isRightEdge) {
return function() {
var roundFnOpts = gd._fullLayout._roundFnOpts[groupName];
return getBinSpanLabelRound(roundFnOpts.leftGap, roundFnOpts.rightGap, binEdges, pa, calendar)(v, isRightEdge);
return getBinSpanLabelRound(
roundFnOpts.leftGap,
roundFnOpts.rightGap,
binEdges, pa, calendar
)(v, isRightEdge);
};
};
}
Expand Down

0 comments on commit c387f9b

Please sign in to comment.