File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,12 @@ exports.cleanLayout = function(layout) {
102
102
}
103
103
}
104
104
105
- if ( layout . annotations !== undefined && ! Array . isArray ( layout . annotations ) ) {
106
- Lib . warn ( 'Annotations must be an array.' ) ;
107
- delete layout . annotations ;
108
- }
109
105
var annotationsLen = ( layout . annotations || [ ] ) . length ;
110
106
for ( i = 0 ; i < annotationsLen ; i ++ ) {
111
107
var ann = layout . annotations [ i ] ;
108
+
109
+ if ( ! Lib . isPlainObject ( ann ) ) continue ;
110
+
112
111
if ( ann . ref ) {
113
112
if ( ann . ref === 'paper' ) {
114
113
ann . xref = 'paper' ;
@@ -120,17 +119,17 @@ exports.cleanLayout = function(layout) {
120
119
}
121
120
delete ann . ref ;
122
121
}
122
+
123
123
cleanAxRef ( ann , 'xref' ) ;
124
124
cleanAxRef ( ann , 'yref' ) ;
125
125
}
126
126
127
- if ( layout . shapes !== undefined && ! Array . isArray ( layout . shapes ) ) {
128
- Lib . warn ( 'Shapes must be an array.' ) ;
129
- delete layout . shapes ;
130
- }
131
127
var shapesLen = ( layout . shapes || [ ] ) . length ;
132
128
for ( i = 0 ; i < shapesLen ; i ++ ) {
133
129
var shape = layout . shapes [ i ] ;
130
+
131
+ if ( ! Lib . isPlainObject ( shape ) ) continue ;
132
+
134
133
cleanAxRef ( shape , 'xref' ) ;
135
134
cleanAxRef ( shape , 'yref' ) ;
136
135
}
You can’t perform that action at this time.
0 commit comments