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) {
18591859 var layout = gd . layout ,
18601860 fullLayout = gd . _fullLayout ,
18611861 axes = Axes . list ( gd ) ,
1862+ eventData = Lib . extendDeepAll ( { } , aobj ) ,
18621863 arrayEdits = { } ,
18631864 keys ,
18641865 arrayStr ,
@@ -2194,7 +2195,7 @@ function _relayout(gd, aobj) {
21942195 rangesAltered : rangesAltered ,
21952196 undoit : undoit ,
21962197 redoit : redoit ,
2197- eventData : Lib . extendDeep ( { } , redoit )
2198+ eventData : eventData
21982199 } ;
21992200}
22002201
Original file line number Diff line number Diff line change @@ -1431,7 +1431,7 @@ describe('legend interaction', function() {
14311431 } ) ;
14321432 gd . on ( 'plotly_relayout' , function ( d ) {
14331433 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' ) ;
14351435 done ( ) ;
14361436 } ) ;
14371437 gd . on ( 'plotly_restyle' , function ( ) {
@@ -1451,7 +1451,7 @@ describe('legend interaction', function() {
14511451 } ) ;
14521452 gd . on ( 'plotly_relayout' , function ( d ) {
14531453 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' ) ;
14551455 done ( ) ;
14561456 } ) ;
14571457 gd . on ( 'plotly_restyle' , function ( ) {
Original file line number Diff line number Diff line change @@ -547,6 +547,30 @@ describe('Test plot api', function() {
547547 . catch ( failTest )
548548 . then ( done ) ;
549549 } ) ;
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+ } ) ;
550574 } ) ;
551575
552576 describe ( 'Plotly.relayout subroutines switchboard' , function ( ) {
You can’t perform that action at this time.
0 commit comments