@@ -427,7 +427,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
427
427
428
428
var maxLabels = Math . min ( Math . ceil ( pathLen / normLength ) ,
429
429
constants . LABELMAX ) ;
430
- var dp , p0 , pMax , minCost , location , pMin ;
430
+ var dp , p0 , pMax , minCost , loc , pMin ;
431
431
432
432
for ( var i = 0 ; i < maxLabels ; i ++ ) {
433
433
// simple optimization by a wide search followed by a binary search
@@ -449,7 +449,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
449
449
var newCost = locationCost ( newLocation , textOpts , labelData , bounds ) ;
450
450
if ( newCost < minCost ) {
451
451
minCost = newCost ;
452
- location = newLocation ;
452
+ loc = newLocation ;
453
453
pMin = p ;
454
454
}
455
455
}
@@ -463,7 +463,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
463
463
}
464
464
if ( minCost > costConstants . MAXCOST ) break ;
465
465
466
- labelClipPathData += addLabel ( location , textOpts , labelData ) ;
466
+ labelClipPathData += addLabel ( loc , textOpts , labelData ) ;
467
467
}
468
468
} ) ;
469
469
} ) ;
@@ -517,12 +517,12 @@ function straightClosedPath(pts) {
517
517
* - the angle away from horizontal
518
518
* - being too close to already placed neighbors
519
519
*/
520
- function locationCost ( location , textOpts , labelData , bounds ) {
520
+ function locationCost ( loc , textOpts , labelData , bounds ) {
521
521
var halfWidth = textOpts . width / 2 ;
522
522
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 ;
526
526
var dx = Math . cos ( theta ) * halfWidth ;
527
527
var dy = Math . sin ( theta ) * halfWidth ;
528
528
0 commit comments