plotly / plotly/plotly.R

Can you implement geom_GeomTextNpc() in plotly ?

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

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

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

説明

Hi,
I'm using the package ggpmisc to display on ggplot graphique the R² and equation of regression thanks to ggpmisc::stat_poly_eq().
This is working well when I am plotting the ggplot graphic. But when I want to use the function ggplotly() to display the graphic, the R² and the equation disappear.
I receive this messages :
Warning message: In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) : geom_GeomTextNpc() has yet to be implemented in plotly. If you'd like to see this geom implemented, Please open an issue with your example code at https://github.com/ropensci/plotly/issues

If you have the time, and the desire to implement geom_GeomTextNpc() in plotly, it could be super nice.

I give you a small code to reproduce the problem

#Data cration

df<-tibble(a=c(2,6,3,4,10),
           b=c(3,6,9,12,15))
df

#relation
myFormula<- y ~ poly(x,2,raw = TRUE)

#ggplot
df_plot<-ggplot(data = df,aes(x = a,y = b))+
  geom_point()+
  geom_smooth(method = lm,
              formula = myFormula)+
  ggtitle("polynomial 2")+
    #from here problem with ggplotly
  ggpmisc::stat_poly_eq(
    aes(label=paste("atop(",stat(rr.label),",",
                    stat(eq.label),")",
                    sep="")),
    formula = myFormula,parse = TRUE)

df_plot

#plotly
ggplotly(df_plot)

The ggplot graphic :
ggplot_with_equation

And here the graphic with plotly:
ggplotly

Thank you for creating and implementing plotly 👍
Best,
Fanny

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

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

はじめの一歩

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

調査の方向性

geom_GeomTextNpc() に対する geom2trace.default 警告から始め、提供されている ggplotly(df_plot) の再現コードを実行します。ggplotly によって ggplot2 のレイヤーがどのように変換されるかを追跡し、そのうえでこの geom に必要な実装を特定します。警告がなくなり、インタラクティブなプロットに R² と回帰方程式が表示されれば完了です。

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

評価

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

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

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