Skip to content

Select multiple groups in a single box select when using "plotly_selected" #974

@talgalili

Description

@talgalili

Example code:

library(plotly)
library(crosstalk)
D <- SharedData$new(iris, key = ~Species) 
scatter <- ggplot(data=D, aes(x = Sepal.Length, y = Sepal.Width)) 
p <- scatter + geom_point(aes(color=Species, shape=Species)) +
  xlab("Sepal Length") +  ylab("Sepal Width") +
  ggtitle("Sepal Length-Width")
highlight(ggplotly(p), on = "plotly_selected")

Now I wish to select two species in one stroke. But when trying to do so, only the first group is selected:

The selection

image

What got selected:

image

Trying to use persistent=TRUE did not help.
Is it possible to add the option for the selection to work on several groups at the same time?

Thanks.

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