Skip to content

Properly retain original opacity of 0 #1407

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

Merged
merged 1 commit into from
Nov 20, 2018
Merged

Properly retain original opacity of 0 #1407

merged 1 commit into from
Nov 20, 2018

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Nov 15, 2018

Closes #1406.

The bug in #1406 happens because of the hidden trace that is used to render the colorbar. That trace has an opacity of 0, but 0 || 1 evaluates to 1 in JavaScript, so this client-side logic used to store the original opacity (needed for 'clearing' a crosstalk event) was incorrectly storing 1 (instead of 0), making that invisible trace visible when clearing the brush.

Testing notes

Install (devtools::install_github("ropensci/plotly#1407")) then make sure the behavior outlined in #1406 is fixed (i.e. a marker in the lower-left should not appear after click&drag over points and double-clicking to clear the highlight)

@schloerke
Copy link
Contributor

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators

However, the && and || operators actually return the value of one of the specified operands, so if these operators are used with non-Boolean values, they may return a non-Boolean value.

@cpsievert cpsievert merged commit 0acffce into master Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plotly generates artificial data point when using with crosstalk
2 participants