-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make frame with nulls clear items & array containers #1118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
69bffe1
4c49755
d21d782
138ac35
d0953a0
174b640
36859f1
66f8bb7
8ed1957
9de2f77
5de6ff0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,13 +102,12 @@ exports.cleanLayout = function(layout) { | |
} | ||
} | ||
|
||
if(layout.annotations !== undefined && !Array.isArray(layout.annotations)) { | ||
Lib.warn('Annotations must be an array.'); | ||
delete layout.annotations; | ||
} | ||
var annotationsLen = (layout.annotations || []).length; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch here. Thanks! The only (I think) case where There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done in 9de2f77 |
||
for(i = 0; i < annotationsLen; i++) { | ||
var ann = layout.annotations[i]; | ||
|
||
if(!Lib.isPlainObject(ann)) continue; | ||
|
||
if(ann.ref) { | ||
if(ann.ref === 'paper') { | ||
ann.xref = 'paper'; | ||
|
@@ -120,17 +119,17 @@ exports.cleanLayout = function(layout) { | |
} | ||
delete ann.ref; | ||
} | ||
|
||
cleanAxRef(ann, 'xref'); | ||
cleanAxRef(ann, 'yref'); | ||
} | ||
|
||
if(layout.shapes !== undefined && !Array.isArray(layout.shapes)) { | ||
Lib.warn('Shapes must be an array.'); | ||
delete layout.shapes; | ||
} | ||
var shapesLen = (layout.shapes || []).length; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done in 9de2f77 |
||
for(i = 0; i < shapesLen; i++) { | ||
var shape = layout.shapes[i]; | ||
|
||
if(!Lib.isPlainObject(shape)) continue; | ||
|
||
cleanAxRef(shape, 'xref'); | ||
cleanAxRef(shape, 'yref'); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit was enough to fix bug discovered in http://codepen.io/etpinard/pen/xRGgwW