plotly / plotly/plotly.R

ggplotly: problems with facet_grid/axes

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

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

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

説明

I'm trying to display some block-matrix-like plot, and there are a few regressions when converting from ggplot to ggplotly conversion (ranked by severity):

  • degenerated (1 value) discrete axes are implicitly converted into continuous numeric axis centered around 1, original labels not displayed
  • switch="both" and strip.placement = "outside" options ignored (here it's important because with ggplot I am able to have sort-of 2-level hierarchy for X and Y axes, which ggplotly breaks)
  • some subplots with missing data are displayed (at 3x3 position), some don't (2x2 position)
  • the margins for the X labels are too small (is the text rotation considered when calculating the necessary space?)
  • space="free" option ignored
  • within my shiny application the diagonal subplots miss the fill color. It's an important issue, but I cannot make a small reproducible example (screenshot attached).

ggplot2
capza1_ggplot_render

ggplotly
capza1_plotly_render

ggplotly from Shiny app
capza1_plotly_shiny_render

The code

require(readr)
require(plotly)
require(ggplot2)

peakXpepmod.df <-  read_tsv("CAPZA1_example.txt",
                            col_types = list("pepmod_id"="c", "peak_id"="c", "proteoform_id"="c", "pmgroup_id"="c")) %>%
  dplyr::mutate(pepmod_id = factor(pepmod_id),
                peak_id = factor(peak_id),
                proteoform_id = factor(proteoform_id),
                pmgroup_id = factor(pmgroup_id))

p <- ggplot(peakXpepmod.df) +
  geom_point(aes(x = pepmod_id, y = peak_id,
                 color = proteoform_id), shape=15, size=8) +
  geom_point(aes(x = pepmod_id, y = peak_id,
                 shape = pmgroup_id), size=5) +
  scale_x_discrete("Pepmods") + scale_y_discrete("Peaks") +
  theme( axis.line = element_line(colour = "gray80"),
         axis.ticks = element_line(colour = "gray80"),
         axis.text.x = element_text(angle = 90, hjust = 1),
        strip.background = element_rect(colour="gray"),
        strip.placement = "outside") +
  facet_grid(proteoform_id ~ pmgroup_id, switch="both", scales = "free", space = "free")

# ggplot
p

# ggplotly
ggplotly(p)

The dataset
CAPZA1_example.txt

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

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

はじめの一歩

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

調査の方向性

CAPZA1_example.txt を使って提供された R の例を実行し、p と ggplotly(p) を比較して、facet_grid の変換に重点を置くことで、報告を再現します。プロジェクトファイルやテストは指定されていません。完了とは、一覧に挙げられた軸、ストリップ、欠落したサブプロット、マージン、間隔、塗りつぶし色に関するリグレッションに対処し、特に再現可能なケースに注意を払うことを意味します。

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

評価

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

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

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