Skip to content

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
@archmoj archmoj added bug something broken status: in progress labels Dec 21, 2018
@@ -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

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants