plotly / plotly/plotly.R

animated ggplotly: geoms contesting visibility when plotted on same mappings

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

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

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

説明

Cannot plot geom_point and geom_line on same mappings in animated ggplotly()

Creating a ggplot object (with frame) and calling in ggplotly(). I expect to be able to view geom_point and geom_text mapped to the variables. I sometimes observe one being displayed on more frames while the other flys in from the top left in one or few frames.

work around: add sub-pixel changes to one or both geoms till working.

library(ggplot2)
library(plotly)

rn <- data.frame(rn = 1:5)
x  <- data.frame(scale(mtcars), lab=abbreviate(rownames(mtcars),2))
x_cross <- merge(x, rn, all = TRUE) # cross join

# Only text or points show, not both 
gg1 <- ggplot() + 
  geom_text(data=x_cross, mapping = aes(x=disp, y=hp, label=lab, frame=rn)) +
  geom_point(data=x_cross, mapping = aes(x=disp,  y=hp, frame=rn),color="red") + 
  theme_void()
gg1
ggplotly(gg1)

# Text and points show for all frames
gg2 <- ggplot() + 
  geom_text(data=x_cross, mapping = aes(x=disp+.1*rn, y=hp, label=lab, frame=rn)) +
  geom_point(data=x_cross, mapping = aes(x=disp+.1*rn,  y=hp, frame=rn),color="red") + 
  theme_void()
gg2
ggplotly(gg2)

# tooltip = "none", changes behaviour, points don't show up.
ggplotly(gg2, tooltip = "none")

Cheers,
Nick

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

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

はじめの一歩

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

調査の方向性

まず、提供された R の再現コードを ggplotly() で実行し、アニメーションする geom_text と geom_point をフレーム間で比較し、tooltip = "none" の場合も比較します。アニメーションする ggplotly の変換およびレンダリング経路を追跡します。完了の条件は、両方の geom がすべてのフレームでサブピクセル単位の座標変更なしに表示され続け、報告された tooltip の動作が把握または修正されていることです。

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

評価

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

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

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