plotly / plotly/plotly.R

Better support for trellis displays

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

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

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

説明

There are a few different ways to do a trellis display currently, but these are all a bit esoteric

one_plot <- function(d) {
  plot_ly(d, x = ~wt, y = ~mpg)
}

mtcars %>%
  group_by(vs) %>%
  do(plot = one_plot(.)) %>%
  subplot(nrows = NROW(.))

plot_ly(mtcars, x = ~wt, y = ~mpg, color = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
  subplot(nrows = 2)

plot_ly(mtcars, x = ~wt, y = ~mpg, split = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
  subplot(nrows = 2)

#726 implements a trellis argument, which essentially maps that variable to sensible trace anchors, then uses subplot()'s machinery to populate axis objects. The problem is, we have guarantee a subplot is returned if we want a sensible result for:

plot_ly(mtcars, x = ~wt, y = ~mpg, trellis = ~vs)

Thus, we lose the ability to specify the number of rows in that subplot

It'd be better to have trellis() function:

trellis <- function(p, formula, ...) {
  # do some stuff here
  subplot(p, ...)
}

Ideally, the trellising would work a lot like ggplot2 facets (trellising variables should not appear in legends, and appear as annotations instead). This is what we do in ggplotly() via clever use of showlegend and legendgroup.

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

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

はじめの一歩

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

調査の方向性

まず、#726 で提案されている trellis 引数と、既存の subplot() の仕組みを確認してください。完成した解決策では、subplot の行を制御でき、ggplot2 のような動作をサポートする trellis() 関数を提供する必要があります。これには、trellising 変数を凡例から除外し、注釈として表示することも含まれます。

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

評価

技術スタック
r
領域
data-visualization
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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