Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3356c9e

Browse files
committed
refactor histogram calc - use variable
1 parent 7433f7a commit 3356c9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/traces/histogram/calc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ var getBinSpanLabelRound = require('./bin_label_vals');
1515
function calc(gd, trace) {
1616
var pos = [];
1717
var size = [];
18-
var pa = Axes.getFromId(gd, trace.orientation === 'h' ? trace.yaxis : trace.xaxis);
19-
var mainData = trace.orientation === 'h' ? 'y' : 'x';
18+
var isHorizontal = trace.orientation === 'h';
19+
var pa = Axes.getFromId(gd, isHorizontal ? trace.yaxis : trace.xaxis);
20+
var mainData = isHorizontal ? 'y' : 'x';
2021
var counterData = {x: 'y', y: 'x'}[mainData];
2122
var calendar = trace[mainData + 'calendar'];
2223
var cumulativeSpec = trace.cumulative;

0 commit comments

Comments
 (0)