plotly / plotly/plotly.R

color/symbol mapping breaks `transforms` filter

未關閉
#1,502 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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")))

Screen Shot 2019-03-21 at 3 58 58 pm

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")))

Screen Shot 2019-03-21 at 3 59 35 pm

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 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

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。