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

Fix scattergl unselected marker opacity for array marker opacity traces #2503

Merged
merged 2 commits into from
Mar 27, 2018

Conversation

etpinard
Copy link
Contributor

fixes #2500 by handling the case where marker.opacity is an array and no [un]selected attributes are set (more info here). To be merged in #2499 to not have to regenerate the baselines once in master.

cc @dfcreative @alexcjohnson

@etpinard etpinard added bug something broken status: reviewable labels Mar 27, 2018
"size": 20,
"opacity": [0.9, 0.8, 0.7, 1, 0.6, 0.8]
},
"selectedpoints": [1, 4, 2]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On master, this gives

image

where selectedpoints is essentially ignored.


if(Array.isArray(trace.marker.opacity)) {
var mo = trace.marker.opacity;
opts.unselected.opacity = new Array(mo.length);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if trace.unselected.marker.opacity is already defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that would override it. Good eye. Thanks!

},
"unselected": {
"marker": {
"opacity": 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this commit, this gave:

image

that is unselected.marker.opacity was overrode.

@alexcjohnson
Copy link
Collaborator

Looks great 💃

@etpinard etpinard merged commit 95b9f3e into point-cluster-dev Mar 27, 2018
@etpinard etpinard deleted the fix-unselected-mo-for-array-mo-traces branch March 27, 2018 18: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