color/symbol mapping breaks `transforms` filter
未关闭
还没有人认领这个 Issue。
bug
difficulty: medium
priority: medium
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中的两个 plot_ly() reprex 开始,比较启用和不启用 color = ~z 或 symbol 映射时生成的行为。使用提供的数据重现 transforms 过滤器,然后跟踪相关的 plotly.R 映射和 transforms 处理;完成的标准是:启用 color 或 symbol 映射时,过滤器始终只显示 z = "up" 的行。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100