color/symbol mapping breaks `transforms` filter
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Issue
transforms filter plus color/symbol mapping seems to break the transforms filter.
Reprex
Sample data
df <- data.frame(
x = c(1:10, 1:10),
y = c(1:10, 10:1),
z = c(rep("up", 10), rep("down", 10)))
The idea is to only show data where z = "up" through a transforms filter.
Case 1: transforms filter without color mapping
This works
plot_ly(
df,
x = ~x, y = ~y, text = ~z,
type = "scatter", mode = "markers+text",
marker = list(size = 10, opacity = 0.8),
transforms = list(
list(
type = "filter",
target = ~z,
operation = "=",
value = "up")))

Case 2: transforms filter with color mapping
This does not work
plot_ly(
df,
x = ~x, y = ~y, text = ~z, color = ~z,
type = "scatter", mode = "markers+text",
marker = list(size = 10, opacity = 0.8),
transforms = list(
list(
type = "filter",
target = ~z,
operation = "=",
value = "up")))

Summary
In both cases the transforms filter is the same and should select only those entries where z = "up"; however, when a color (or symbol) mapping is added, for some reason only entries where z = "down" are shown.
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
Start with the two plot_ly() reprexes in the issue and compare the generated behavior with and without color = ~z or symbol mapping. Reproduce the transforms filter using the supplied data, then trace the relevant plotly.R mapping and transform handling; done means the filter consistently shows only rows where z = "up" with color or symbol mapping enabled.
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
- 38/100