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

ignore invalid trace indices in restyle and update #3114

Merged
merged 2 commits into from Oct 16, 2018

Conversation

Projects
None yet
3 participants
@antoinerg
Copy link
Collaborator

commented Oct 16, 2018

Fixes #3113

@@ -490,6 +490,9 @@ exports.coerceTraceIndices = function(gd, traceIndices) {
else if(!Array.isArray(traceIndices) || !traceIndices.length) {
return gd.data.map(function(_, i) { return i; });
}
else if(Array.isArray(traceIndices)) {
return traceIndices.filter(function(i) {return i < gd.data.length;});
}

This comment has been minimized.

Copy link
@antoinerg

antoinerg Oct 16, 2018

Author Collaborator

Should I do a Lib.warn('trace indice is not number or is out of bound')?

This comment has been minimized.

Copy link
@alexcjohnson

alexcjohnson Oct 16, 2018

Contributor

That's a good idea - should help users debug, since this really shouldn't happen normally.

indice index is not a number or is out of bounds

Also I guess while we're at it we should filter out non-integers and negative numbers. Oh hey lib.isIndex - accepts strings too but those seem to be OK, ie a=[1,2,3]; a['1']===2

This comment has been minimized.

Copy link
@antoinerg

antoinerg Oct 16, 2018

Author Collaborator

Hooray for lib.isIndex. I really should spend some time to find out all the functions we have in lib!

@alexcjohnson

This comment has been minimized.

Copy link
Contributor

commented Oct 16, 2018

Thanks for the quick fix @antoinerg ! 🚀 Very nice tests.
💃

@antoinerg antoinerg merged commit 5468d6a into master Oct 16, 2018

6 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test-image Your tests passed on CircleCI!
Details
ci/circleci: test-image2 Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine2 Your tests passed on CircleCI!
Details
ci/circleci: test-syntax Your tests passed on CircleCI!
Details

@antoinerg antoinerg self-assigned this Oct 17, 2018

@etpinard etpinard added the type: bug label Oct 23, 2018

@etpinard

This comment has been minimized.

Copy link
Member

commented Oct 23, 2018

🆘 delete branch alert 🆘

@etpinard etpinard deleted the 3113-restyle-invalid-trace branch Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.