Skip to content
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

Surface additional checks for handling empty z arrays and minimum number of rows and columns #3365

Merged
merged 4 commits into from
Dec 21, 2018

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Dec 21, 2018

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

required minimum 2x2 data for a surface

revised conditions for z

correct z length check

new baseline added
@@ -0,0 +1,33 @@
{
"data": [
Copy link
Contributor

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.

var z = coerce('z');
if(!z) {
if(!z || !z.length ||
(x ? (x.length < 2) : false) ||
Copy link
Contributor

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!

Copy link
Contributor Author

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.

@etpinard
Copy link
Contributor

Nicely done 💃

@archmoj archmoj merged commit cbaae9a into master Dec 21, 2018
@archmoj archmoj deleted the fix3364-surface-check-xyz branch December 21, 2018 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants