Skip to content

Plotly generates artificial data point when using with crosstalk #1406

Closed
@linhai86

Description

@linhai86

When using with crosstalk, plotly generates "new" data point on the scatter plot after selecting and deselecting.

First plot a scatter plot with plotly and crosstalk.
image

Then highlight some points by selecting them.
image

Double click anywhere to deselect. Then these's a "new" data point shows at the lower left corner.
image

If I set color = I("black"), everything works fine.

R 3.4.1, plotly 4.8.0, crosstalk 1.0.0, macOS High Sierra 10.13.6.

library(plotly)
library(crosstalk)
library(tidyverse)

m <- mtcars %>% tibble::rownames_to_column()
d <- SharedData$new(m, ~rowname)

plot_ly(d, x = ~mpg, y = ~disp, color = ~cyl, type="scatter", mode = "markers") %>%
    highlight(on="plotly_selected", off="plotly_deselect")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions