Skip to content

Commit e9c3ef8

Browse files
committed
🔪 obsolete things in Bar.calc
- 🔪 one obsolete comment - use trace.orientation instead using same x/y logic as in supplyDefaults.
1 parent def6aa5 commit e9c3ef8

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/traces/bar/calc.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@ var arraysToCalcdata = require('./arrays_to_calcdata');
1515
var calcSelection = require('../scatter/calc_selection');
1616

1717
module.exports = function calc(gd, trace) {
18-
// depending on bar direction, set position and size axes
19-
// and data ranges
20-
// note: this logic for choosing orientation is
21-
// duplicated in graph_obj->setstyles
18+
var xa = Axes.getFromId(gd, trace.xaxis || 'x');
19+
var ya = Axes.getFromId(gd, trace.yaxis || 'y');
20+
var size, pos;
2221

23-
var xa = Axes.getFromId(gd, trace.xaxis || 'x'),
24-
ya = Axes.getFromId(gd, trace.yaxis || 'y'),
25-
orientation = trace.orientation || ((trace.x && !trace.y) ? 'h' : 'v'),
26-
pos, size, i;
27-
28-
if(orientation === 'h') {
22+
if(trace.orientation === 'h') {
2923
size = xa.makeCalcdata(trace, 'x');
3024
pos = ya.makeCalcdata(trace, 'y');
3125
} else {
@@ -38,7 +32,7 @@ module.exports = function calc(gd, trace) {
3832
var cd = new Array(serieslen);
3933

4034
// set position and size
41-
for(i = 0; i < serieslen; i++) {
35+
for(var i = 0; i < serieslen; i++) {
4236
cd[i] = { p: pos[i], s: size[i] };
4337

4438
if(trace.ids) {

0 commit comments

Comments
 (0)