Skip to content

Commit be99b12

Browse files
committed
Achieve compatibility with ES5
1 parent b70ff86 commit be99b12

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/plots/cartesian/axes.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,17 +3782,17 @@ axes.drawLabels = function(gd, ax, opts) {
37823782
var pad = !isAligned ? 0 :
37833783
(ax.tickwidth || 0) + 2 * TEXTPAD;
37843784

3785-
const adjacent = tickSpacing;
3786-
const opposite = maxFontSize * 1.25 * maxLines;
3787-
const hypotenuse = Math.sqrt(Math.pow(adjacent, 2) + Math.pow(opposite, 2));
3785+
var adjacent = tickSpacing;
3786+
var opposite = maxFontSize * 1.25 * maxLines;
3787+
var hypotenuse = Math.sqrt(Math.pow(adjacent, 2) + Math.pow(opposite, 2));
37883788
// sin(angle) = opposite / hypotenuse
3789-
const minAngle = Math.asin(opposite / hypotenuse) * (180 / Math.PI /* to degrees */);
3789+
var minAngle = Math.asin(opposite / hypotenuse) * (180 / Math.PI /* to degrees */);
37903790

3791-
var angle = autoTickAngles.find(angle => Math.abs(angle) >= minAngle);
3791+
var angle = autoTickAngles.find(function(angle) { return Math.abs(angle) >= minAngle; });
37923792
if(angle === undefined) {
37933793
// no angle larger than minAngle, just pick the largest angle
37943794
angle = autoTickAngles.reduce(
3795-
(currentMax, nextAngle) => Math.abs(currentMax) < Math.abs(nextAngle) ? nextAngle : currentMax
3795+
function(currentMax, nextAngle) { return Math.abs(currentMax) < Math.abs(nextAngle) ? nextAngle : currentMax; }
37963796
, autoTickAngles[0]
37973797
);
37983798
}

0 commit comments

Comments
 (0)