plotly / plotly/plotly.R

layout.shapes.legendgroup is unexpectedly non-functional

オープン
#2,290 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

layout.shapes.legendgroup is non-functional although included in the official reference (https://plotly.com/r/reference/layout/shapes/)

In the below reprex, I have set all objects to the same legendgroup. I would expect them all to disappear when clicking on the legend but this does not happen.

library(plotly)
x <- seq(-2 * pi, 2 * pi, length.out = 1000)
df <- data.frame(x, y1 = sin(x), y2 = cos(x))

fig <-
  plot_ly(df, x = ~x) %>%
  add_lines(y = ~y1, name = "A", legendgroup = "B") %>%
  add_lines(y = ~y2, name = "B", legendgroup = "B")

fig %>% 
  plotly::layout(shapes = 
                   list(
                     list(type = "rect",
                          fillcolor = "blue", line = list(color = "blue"), opacity = 0.3,
                          x0 = -1, x1 = 1, xref = "x",
                          y0 = -0.5, y1 = 0.5, yref = "y", legendgroup = "B")))

Example adapted from https://plotly.com/r/dropdowns/

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供されている R reprex を実行し、shape の legendgroup の動作を 2 つの line trace と比較します。期待される動作として layout.shapes のリファレンスを使用します。共有されている凡例項目をクリックすると、グループ化された trace と一緒に shape が非表示および表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。