plotly / plotly/plotly.R

For a categorical colour aesthetic, there appears to be no documented way to use selectedpoints to select individual points.

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

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

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

説明

The following example highlights the first point from each colour group (the first "a" point and the first "b" point):

library(plotly)

d <- data.frame(x = 1:4, c = c("a", "a", "b", "b"))

plot_ly(d) |>
  add_trace(x=~x, y = ~x, color = ~c, type = "scatter", selectedpoints = list(0))

From the plot_ly() documentation, it appears that this code implicitly creates multiple traces, one for each colour, so this behaviour makes sense on this level (even if it's surprising). However, there appears to be no documented way to access individual traces. I've tried a number of permutations

In my opinion, if the code is going to transparently create multiple traces like that, it should also transparently map selectedpoints provided by the user (ideally as 1-based indexes or logical vectors, for consistency with R) to their positions within each trace.

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

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

はじめの一歩

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

調査の方向性

plot_ly() のドキュメントとカテゴリカルカラーの例から始めて、colour がどのように個別の trace を作成し、selectedpoints がどのように渡されるかを追跡します。完了条件は、生成された各 trace 内のポイントを選択するための、文書化された一貫した方法を提供し、提示された例と提案された R-style のインデックス動作をカバーすることです。

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

評価

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

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

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