Skip to content

Commit ca1cced

Browse files
committed
location -> loc (window global potential confusion)
1 parent 221b124 commit ca1cced

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/traces/contour/plot.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
427427

428428
var maxLabels = Math.min(Math.ceil(pathLen / normLength),
429429
constants.LABELMAX);
430-
var dp, p0, pMax, minCost, location, pMin;
430+
var dp, p0, pMax, minCost, loc, pMin;
431431

432432
for(var i = 0; i < maxLabels; i++) {
433433
// simple optimization by a wide search followed by a binary search
@@ -449,7 +449,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
449449
var newCost = locationCost(newLocation, textOpts, labelData, bounds);
450450
if(newCost < minCost) {
451451
minCost = newCost;
452-
location = newLocation;
452+
loc = newLocation;
453453
pMin = p;
454454
}
455455
}
@@ -463,7 +463,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
463463
}
464464
if(minCost > costConstants.MAXCOST) break;
465465

466-
labelClipPathData += addLabel(location, textOpts, labelData);
466+
labelClipPathData += addLabel(loc, textOpts, labelData);
467467
}
468468
});
469469
});
@@ -517,12 +517,12 @@ function straightClosedPath(pts) {
517517
* - the angle away from horizontal
518518
* - being too close to already placed neighbors
519519
*/
520-
function locationCost(location, textOpts, labelData, bounds) {
520+
function locationCost(loc, textOpts, labelData, bounds) {
521521
var halfWidth = textOpts.width / 2;
522522
var halfHeight = textOpts.height / 2;
523-
var x = location.x;
524-
var y = location.y;
525-
var theta = location.theta;
523+
var x = loc.x;
524+
var y = loc.y;
525+
var theta = loc.theta;
526526
var dx = Math.cos(theta) * halfWidth;
527527
var dy = Math.sin(theta) * halfWidth;
528528

0 commit comments

Comments
 (0)