@@ -119,7 +119,6 @@ var yAnchors = ['top', 'middle', 'bottom'];
119
119
// plot so you can use d3.select('g image').node()
120
120
var aroColor = 'rgb(50, 100, 150)' ;
121
121
122
-
123
122
// acts on an Object representing a aro which could be a line or a rect
124
123
// DEPRECATED
125
124
function aroFromAROPos ( aro , axletter , axnum , aropos ) {
@@ -134,7 +133,6 @@ function aroFromAROPos(aro, axletter, axnum, aropos) {
134
133
}
135
134
}
136
135
137
-
138
136
// {axid} is the axis id, e.g., x2, y, etc.
139
137
// {ref} is ['range'|'domain'|'paper']
140
138
function makeAxRef ( axid , ref ) {
@@ -228,8 +226,20 @@ function annaxscale(ac, c0) {
228
226
// of the arrow doesn't change where the arrow meets the text box.
229
227
// xaxistype can be linear|log, only used if xref has type 'range' or 'domain',
230
228
// same for yaxistype and yref
231
- function annotationTest ( gd , layout , x0 , y0 , ax , ay , xref , yref , axref , ayref ,
232
- xaxistype , yaxistype , xid , yid ) {
229
+ function annotationTest ( gd , layout , opt ) {
230
+ var x0 = opt . x0 ;
231
+ var y0 = opt . y0 ;
232
+ var ax = opt . ax ;
233
+ var ay = opt . ay ;
234
+ var xref = opt . xref ;
235
+ var yref = opt . yref ;
236
+ var axref = opt . axref ;
237
+ var ayref = opt . ayref ;
238
+ var xaxistype = opt . xaxistype ;
239
+ var yaxistype = opt . yaxistype ;
240
+ var xid = opt . xid ;
241
+ var yid = opt . yid ;
242
+
233
243
// Take the log of values corresponding to log axes. This is because the
234
244
// test is designed to make predicting the pixel positions easy, and it's
235
245
// easiest when we work with the logarithm of values on log axes (doubling
@@ -432,7 +442,6 @@ function imageToBBox(layout, img) {
432
442
return bbox ;
433
443
}
434
444
435
-
436
445
function coordsEq ( a , b ) {
437
446
if ( a && b ) {
438
447
return Math . abs ( a - b ) < EQUALITY_TOLERANCE ;
@@ -465,8 +474,20 @@ function findImage(id) {
465
474
return ret ;
466
475
}
467
476
468
- function imageTest ( gd , layout , xaxtype , yaxtype , x , y , sizex , sizey , xanchor ,
469
- yanchor , xref , yref , xid , yid ) {
477
+ function imageTest ( gd , layout , opt ) {
478
+ var xaxtype = opt . xaxtype ;
479
+ var yaxtype = opt . yaxtype ;
480
+ var x = opt . x ;
481
+ var y = opt . y ;
482
+ var sizex = opt . sizex ;
483
+ var sizey = opt . sizey ;
484
+ var xanchor = opt . xanchor ;
485
+ var yanchor = opt . yanchor ;
486
+ var xref = opt . xref ;
487
+ var yref = opt . yref ;
488
+ var xid = opt . xid ;
489
+ var yid = opt . yid ;
490
+
470
491
var image = {
471
492
x : x ,
472
493
y : y ,
@@ -507,16 +528,17 @@ function checkAROPosition(gd, aro) {
507
528
return ret ;
508
529
}
509
530
510
- function testShape (
531
+ function shapeTest (
511
532
gd ,
512
- xAxNum ,
513
- xaxisType ,
514
- xaroPos ,
515
- yAxNum ,
516
- yaxisType ,
517
- yaroPos ,
518
- aroType
519
- ) {
533
+ opt ) {
534
+ var xAxNum = opt . xAxNum ;
535
+ var xaxisType = opt . xaxisType ;
536
+ var xaroPos = opt . xaroPos ;
537
+ var yAxNum = opt . yAxNum ;
538
+ var yaxisType = opt . yaxisType ;
539
+ var yaroPos = opt . yaroPos ;
540
+ var aroType = opt . aroType ;
541
+
520
542
// console.log('gd.layout: ', JSON.stringify(gd.layout));
521
543
var aro = {
522
544
type : aroType ,
@@ -572,7 +594,7 @@ function testShapeCombo(combo, assert, gd) {
572
594
var yAxNum = axispair [ 1 ] . substr ( 1 ) ;
573
595
return Plotly . newPlot ( gd , Lib . extendDeep ( { } , testMock ) )
574
596
. then ( function ( gd ) {
575
- return testShape ( gd , xAxNum , xaxisType , xaroPos , yAxNum , yaxisType , yaroPos ,
597
+ return shapeTest ( gd , xAxNum , xaxisType , xaroPos , yAxNum , yaxisType , yaroPos ,
576
598
shapeType ) ;
577
599
} ) . then ( function ( testRet ) {
578
600
assert ( testRet ) ;
@@ -730,7 +752,6 @@ function annotationTestDescriptions() {
730
752
return comboTestDescriptions ( testCombos , describeAnnotationComboTest ) ;
731
753
}
732
754
733
-
734
755
function imageTestCombos ( ) {
735
756
var testCombos = iterToArray ( iterable . cartesianProduct (
736
757
[
0 commit comments