Skip to content

highlight() selectize payload isn't correct when non-crosstalk traces appear before crosstalk traces #2218

Closed
@cpsievert

Description

@cpsievert

For example, this results in an empty payload, when it should be populated

p <- plot_ly() %>%
  add_lines(data = mtcars, x = ~wt, y = ~mpg) %>%
  add_markers(
    data = highlight_key(mtcars, ~cyl, "Choose cylinder"),
    x = ~wt, y = ~mpg
  ) %>%
  highlight(selectize = TRUE)

plotly_build(p)$x$selectize
NULL

Interestingly, if you remove the add_lines() trace, you get the correct result of:

$a5634ffecff7b115d858cad5b9126e93
$a5634ffecff7b115d858cad5b9126e93$items
  value label
1     6     6
2     4     4
3     8     8

$a5634ffecff7b115d858cad5b9126e93$group
[1] "Choose cylinder"

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