Skip to content

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

3 participants