File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
test/jasmine/bundle_tests Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 6
6
* LICENSE file in the root directory of this source tree.
7
7
*/
8
8
9
-
10
9
'use strict' ;
11
10
12
11
var Registry = require ( '../registry' ) ;
@@ -517,6 +516,15 @@ function getTraceAttributes(type) {
517
516
out . layoutAttributes = formatAttributes ( layoutAttributes ) ;
518
517
}
519
518
519
+ // drop anim:true in non-animatable modules
520
+ if ( ! _module . animatable ) {
521
+ exports . crawl ( out , function ( attr ) {
522
+ if ( exports . isValObject ( attr ) && 'anim' in attr ) {
523
+ delete attr . anim ;
524
+ }
525
+ } ) ;
526
+ }
527
+
520
528
return out ;
521
529
}
522
530
Original file line number Diff line number Diff line change @@ -377,6 +377,22 @@ describe('plot schema', function() {
377
377
expect ( traces . parcoords . attributes . hoverinfo ) . toBe ( undefined , 'no hover attrs for parcoords' ) ;
378
378
expect ( traces . scatter3d . attributes . selectedpoints ) . toBe ( undefined , 'no selectedpoints for gl3d traces' ) ;
379
379
} ) ;
380
+
381
+ it ( 'traces that are not animatable should not list `anim:true` attributes' , function ( ) {
382
+ var notAnimatable = Object . keys ( plotSchema . traces ) . filter ( function ( traceType ) {
383
+ return ! plotSchema . traces [ traceType ] . animatable ;
384
+ } ) ;
385
+
386
+ notAnimatable . forEach ( function ( traceType ) {
387
+ Plotly . PlotSchema . crawl ( plotSchema . traces [ traceType ] . attributes , function ( ) {
388
+ var attr = arguments [ 0 ] ;
389
+ var astr = arguments [ 4 ] ;
390
+ if ( Plotly . PlotSchema . isValObject ( attr ) && 'anim' in attr ) {
391
+ fail ( 'Trace module ' + traceType + ' sets *' + astr + '* with anim:true' ) ;
392
+ }
393
+ } ) ;
394
+ } ) ;
395
+ } ) ;
380
396
} ) ;
381
397
382
398
describe ( 'getTraceValObject' , function ( ) {
You can’t perform that action at this time.
0 commit comments