Skip to content

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

Closed
@cpsievert

Description

@cpsievert
Collaborator

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @cpsievert

        Issue actions

          Persistent highlighting should only addTraces() for *new* selections · Issue #915 · plotly/plotly.R