Skip to content

Persistent highlighting should only addTraces() for *new* selections #915

Closed
@cpsievert

Description

@cpsievert

For instance, this example shouldn't keep stacking every time a selection is made:

library(plotly)

mtcars %>%
  dplyr::count(vs) %>%
  crosstalk::SharedData$new(~vs) %>%
  plot_ly(x = ~factor(vs), y = ~n) %>%
  add_bars() %>%
  layout(barmode = "stack") %>%
  highlight("plotly_click", persistent = TRUE)

stack

This will also help avoid the issue reported in plotly/plotly.js#1467

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions