8000 Rename variables for readability · leetcode/flot-plugin-collection@8ef0ab5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ef0ab5

Browse files
committed
Rename variables for readability
1 parent 5ca9068 commit 8ef0ab5

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/flot/jquery.flot.autoscale.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@
77
function init(plot) {
88

99
plot.autoScale = function () {
10-
var opts = plot.getYAxes()[0].options;
11-
var optsx = plot.getXAxes()[0].options;
10+
var optsY = plot.getYAxes()[0].options;
11+
var optsX = plot.getXAxes()[0].options;
1212
var data = plot.getData();
13-
var maxx = 0, maxy = 0;
13+
var maxX = 0, maxY = 0;
1414

1515
$.each(data, function (index, s) {
1616
var max = autoScale(plot, s, s.data, s.datapoints);
17-
maxx = Math.max(maxx, max['maxx']);
18-
maxy = Math.max(maxy, max['maxy']);
17+
maxX = Math.max(maxX, max['maxX']);
18+
maxY = Math.max(maxY, max['maxY']);
1919
});
2020

21-
optsx.min = 0;
22-
optsx.max = maxx;
23-
opts.min = 0;
24-
opts.max = maxy;
21+
optsX.min = 0;
22+
optsX.max = maxX;
23+
optsY.min = 0;
24+
optsY.max = maxY;
2525

2626
plot.setupGrid();
2727
plot.draw();
2828

2929
return {
30-
min: opts.min,
31-
max: opts.max
30+
min: optsY.min,
31+
max: optsY.max
3232
};
3333
}
3434

@@ -37,24 +37,24 @@
3737

3838
// limit to visible serie
3939
if (series.lines.show || series.points.show || series.bars.show) {
40-
var maxx = Number.NEGATIVE_INFINITY;
41-
var maxy = Number.NEGATIVE_INFINITY;
40+
var maxX = Number.NEGATIVE_INFINITY;
41+
var maxY = Number.NEGATIVE_INFINITY;
4242

4343
for (var i = 0; i < data.length; i++) {
44-
maxx = Math.max(maxx, data[i][0]);
45-
maxy = Math.max(maxy, data[i][1]);
44+
maxX = Math.max(maxX, data[i][0]);
45+
maxY = Math.max(maxY, data[i][1]);
4646
}
4747

48-
maxx += 2;
49-
maxy += maxy * options.yaxis.autoscaleMargin * 10;
48+
maxX += 2;
49+
maxY += maxY * options.yaxis.autoscaleMargin * 10;
5050
return {
51-
maxx: maxx,
52-
maxy: maxy
51+
maxX: maxX,
52+
maxY: maxY
5353
};
5454
} else {
5555
return {
56-
maxx: 0,
57-
maxy: 0
56+
maxX: 0,
57+
maxY: 0
5858
};
5959
}
6060
}

0 commit comments

Comments
 (0)
0