Highlighting doesn't work after filtering on the same variable as the plot coloring
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
From @micahdh:
The problem occurs when you select a species from the dropdown and then lasso one graph -- the other graph doesn't change. When you only filter by other_factor (or don't filter at all) highlighting occurs as normal.
For what it's worth this issue occurs in my own script when I filter on any column -- regardless of if it's used for coloring or anything else. I only noticed that it matters which column you filter on while I was reproducing the problem.
Thank you for an otherwise amazing package!
require(crosstalk)
require(plotly)
iris$other_factor <- sample(x = c("a", "b", "c"), size = nrow(iris), replace = T)
iris_shared <- SharedData$new(iris)
bscols(widths = c(6, 6, 6, 6),
filter_select("species", "species", iris_shared, ~Species, multiple = T),
filter_select("otherfactor", "other factor", iris_shared, ~other_factor, multiple = T),
plot_ly(data = iris_shared, x = ~Sepal.Length, y = ~Sepal.Width, color = ~Species) %>%
add_markers() %>%
layout(dragmode = "lasso") %>%
highlight(on = "plotly_selected", off = "plotly_deselect"),
plot_ly(data = iris_shared, x = ~Petal.Length, y = ~Petal.Width, color = ~Species) %>%
add_markers() %>%
layout(dragmode = "lasso") %>%
highlight(on = "plotly_selected", off = "plotly_deselect")
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the supplied R reproduction using iris, SharedData, filter_select(), plot_ly(), and highlight(). Compare lasso selection behavior after filtering by species or other_factor; done means selecting points in one graph updates the other graph regardless of which column was filtered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100