-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Surface additional checks for handling empty z arrays and minimum number of rows and columns #3365
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
Conversation
required minimum 2x2 data for a surface revised conditions for z correct z length check new baseline added
@@ -0,0 +1,33 @@ | |||
{ | |||
"data": [ |
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.
Could we turn these test cases into jasmine tests instead? This surface_test.js
block
describe('supplyDefaults', function() { |
should be a nice place to test the default logic.
src/traces/surface/defaults.js
Outdated
var z = coerce('z'); | ||
if(!z) { | ||
if(!z || !z.length || | ||
(x ? (x.length < 2) : false) || |
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.
I would prefer keeping things consistent with contour
traces here. 1-item contour traces are (like 1-item surfaces) ill-defined, but still appear as visible: true
in the fullData
(see -> https://codepen.io/etpinard/pen/oJZyEO)
To avoid drawing errors, we should handle the 1-item case in surface/convert.js
. Thanks!
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.
The minimum for rows and columns are set to be one.
And it seems we won't get errors for those 1-item cases.
Nicely done 💃 |
Fixes #3364.
The surface trace would be invisible if the z array is defined but is empty or when the columns/row array includes less than two items.
@etpinard