plotly / plotly/plotly.R

ggplotly() cannot stop geom_text tooltip, geom will not display on all animation frames

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

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

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

説明

  1. Cannot stop geom_text from displaying tooltip.
  2. Animations will not display all geoms on all frames (note that data has differing rownumers
library(ggplot2)
library(plotly)
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout

df_txt <- data.frame(x=1, y=1, label="No tooltip here, please", frame = 1:2)
df_pts <- data.frame(x=rep(c(1, 1), each=2), y=c(.9, .95, .8, .85),
                     tooltip=paste("obs_num: ", 1:2, "tooltip exclusively for points with different dim"),
                     frame = rep(1:2, each=2))

## static plot, no frames
g <- ggplot() +
  geom_text(aes(x,y, label=label), df_txt) +
  geom_point(aes(x,y, tooltip=tooltip), df_pts)
#> Warning: Ignoring unknown aesthetics: tooltip

plotly::ggplotly(g, tooltip = "tooltip")

## Issue 1) geom_text tooltips are unstopable:
plotly::ggplotly(g, tooltip = NULL)

# plotly::ggplotly(g, tooltip = FALSE)
# plotly::ggplotly(g, tooltip = "foobar")

## animation, aes has frame
g_anim <- ggplot() +
  geom_text(aes(x,y, label=label, frame = frame), df_txt) +
  geom_point(aes(x,y, tooltip=tooltip, frame = frame), df_pts)
#> Warning: Ignoring unknown aesthetics: frame
#> Warning: Ignoring unknown aesthetics: tooltip, frame

## Issue 2) seeing common frame 1 issues, where some geoms display only on frame 1.
# then other apeear semi consistently in other frames. 
plotly::ggplotly(g_anim, tooltip = "tooltip")

## Not a tooltip issue as I was worrying.
g_anim2 <- ggplot() +
  geom_text(aes(x,y, label="existential crisis with points and text", frame = frame), df_txt) +
  geom_point(aes(x,y, frame = frame), df_pts)
#> Warning: Ignoring unknown aesthetics: frame
#> Warning: Ignoring unknown aesthetics: frame
plotly::ggplotly(g_anim2)

Created on 2021-10-28 by the reprex package (v2.0.1)

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

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

はじめの一歩

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

調査の方向性

まず、ggplotly()、g、g_anim、g_anim2 用に提供された R の再現例を実行します。tooltip と frame の aesthetics に対する ggplotly() の処理を追跡します。完了条件は、geom_text の tooltip を抑制でき、frame データの行数が異なる場合も含め、すべての geom がすべてのアニメーションフレームに表示されることです。

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

評価

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

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

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