File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -1859,6 +1859,7 @@ function _relayout(gd, aobj) {
1859
1859
var layout = gd . layout ,
1860
1860
fullLayout = gd . _fullLayout ,
1861
1861
axes = Axes . list ( gd ) ,
1862
+ eventData = Lib . extendDeepAll ( { } , aobj ) ,
1862
1863
arrayEdits = { } ,
1863
1864
keys ,
1864
1865
arrayStr ,
@@ -2194,7 +2195,7 @@ function _relayout(gd, aobj) {
2194
2195
rangesAltered : rangesAltered ,
2195
2196
undoit : undoit ,
2196
2197
redoit : redoit ,
2197
- eventData : Lib . extendDeep ( { } , redoit )
2198
+ eventData : eventData
2198
2199
} ;
2199
2200
}
2200
2201
Original file line number Diff line number Diff line change @@ -1431,7 +1431,7 @@ describe('legend interaction', function() {
1431
1431
} ) ;
1432
1432
gd . on ( 'plotly_relayout' , function ( d ) {
1433
1433
expect ( typeof d ) . toBe ( 'object' ) ;
1434
- expect ( d . title . text ) . toBe ( 'just clicked on trace #2' ) ;
1434
+ expect ( d . title ) . toBe ( 'just clicked on trace #2' ) ;
1435
1435
done ( ) ;
1436
1436
} ) ;
1437
1437
gd . on ( 'plotly_restyle' , function ( ) {
@@ -1451,7 +1451,7 @@ describe('legend interaction', function() {
1451
1451
} ) ;
1452
1452
gd . on ( 'plotly_relayout' , function ( d ) {
1453
1453
expect ( typeof d ) . toBe ( 'object' ) ;
1454
- expect ( d . title . text ) . toBe ( 'just double clicked on trace #0' ) ;
1454
+ expect ( d . title ) . toBe ( 'just double clicked on trace #0' ) ;
1455
1455
done ( ) ;
1456
1456
} ) ;
1457
1457
gd . on ( 'plotly_restyle' , function ( ) {
Original file line number Diff line number Diff line change @@ -547,6 +547,30 @@ describe('Test plot api', function() {
547
547
. catch ( failTest )
548
548
. then ( done ) ;
549
549
} ) ;
550
+
551
+ it ( 'passes update data back to plotly_relayout unmodified ' +
552
+ 'even if deprecated attributes have been used' , function ( done ) {
553
+ Plotly . newPlot ( gd , [ { y : [ 1 , 3 , 2 ] } ] ) ;
554
+
555
+ gd . on ( 'plotly_relayout' , function ( eventData ) {
556
+ expect ( eventData ) . toEqual ( {
557
+ 'title' : 'Plotly chart' ,
558
+ 'xaxis.title' : 'X' ,
559
+ 'xaxis.titlefont' : { color : 'green' } ,
560
+ 'yaxis.title' : 'Y' ,
561
+ 'polar.radialaxis.title' : 'Radial'
562
+ } ) ;
563
+ done ( ) ;
564
+ } ) ;
565
+
566
+ Plotly . relayout ( gd , {
567
+ 'title' : 'Plotly chart' ,
568
+ 'xaxis.title' : 'X' ,
569
+ 'xaxis.titlefont' : { color : 'green' } ,
570
+ 'yaxis.title' : 'Y' ,
571
+ 'polar.radialaxis.title' : 'Radial'
572
+ } ) ;
573
+ } ) ;
550
574
} ) ;
551
575
552
576
describe ( 'Plotly.relayout subroutines switchboard' , function ( ) {
You can’t perform that action at this time.
0 commit comments