@@ -1151,6 +1151,69 @@ describe('annotation effects', function() {
11511151 . then ( done ) ;
11521152 } ) ;
11531153
1154+ it ( 'works date string data-referenced with no arrow' , function ( done ) {
1155+ gd = createGraphDiv ( ) ;
1156+
1157+ Plotly . newPlot ( gd , [ {
1158+ x : [ '2018-01-01' , '2018-02-02' ] ,
1159+ y : [ '2017-01-03' , '2017-02-04' ] ,
1160+ } ] , {
1161+ annotations : [ {
1162+ showarrow : false ,
1163+ text : 'YO!' ,
1164+ xref : 'x' ,
1165+ yref : 'y' ,
1166+ x : '2018-02-01' ,
1167+ y : '2017-02-05'
1168+ } ] ,
1169+ width : 500 ,
1170+ height : 500 ,
1171+ margin : { l : 100 , r : 100 , t : 100 , b : 100 , pad : 0 } ,
1172+ } , {
1173+ editable : true
1174+ } )
1175+ . then ( function ( ) {
1176+ return dragAndReplot ( textDrag ( ) , - 20 , 20 ) ;
1177+ } )
1178+ . then ( function ( ) {
1179+ expect ( gd . _fullLayout . annotations [ 0 ] . x ) . toBe ( '2018-01-29 13:29:41.4857' ) ;
1180+ expect ( gd . _fullLayout . annotations [ 0 ] . y ) . toBe ( '2017-02-02 13:28:35.6572' ) ;
1181+ } )
1182+ . catch ( failTest )
1183+ . then ( done ) ;
1184+ } ) ;
1185+
1186+ it ( 'works date sting data-referenced with arrow' , function ( done ) {
1187+ gd = createGraphDiv ( ) ;
1188+
1189+ Plotly . newPlot ( gd , [ {
1190+ x : [ '2018-01-01' , '2018-02-02' ] ,
1191+ y : [ '2017-01-03' , '2017-02-04' ] ,
1192+ } ] , {
1193+ annotations : [ {
1194+ text : 'YO!' ,
1195+ xref : 'x' ,
1196+ yref : 'y' ,
1197+ x : '2018-02-01' ,
1198+ y : '2017-02-05'
1199+ } ] ,
1200+ width : 500 ,
1201+ height : 500 ,
1202+ margin : { l : 100 , r : 100 , t : 100 , b : 100 , pad : 0 } ,
1203+ } , {
1204+ editable : true
1205+ } )
1206+ . then ( function ( ) {
1207+ return dragAndReplot ( arrowDrag ( ) , - 20 , 20 ) ;
1208+ } )
1209+ . then ( function ( ) {
1210+ expect ( gd . _fullLayout . annotations [ 0 ] . x ) . toBe ( '2018-01-29 13:29:41.4857' ) ;
1211+ expect ( gd . _fullLayout . annotations [ 0 ] . y ) . toBe ( '2017-02-02 06:36:46.8112' ) ;
1212+ } )
1213+ . catch ( failTest )
1214+ . then ( done ) ;
1215+ } ) ;
1216+
11541217 it ( 'should only make the clippaths it needs and delete others' , function ( done ) {
11551218 makePlot ( [
11561219 { x : 50 , y : 50 , text : 'hi' , width : 50 , ax : 0 , ay : - 20 } ,
0 commit comments