plotly / plotly/plotly.R

Please implement geom_GeomXsidebar() and related geoms

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

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

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

説明

I tried to use plotly on ggplot graph that used geom_xsidehistogram and geom_ysidehistorgram, but when I did I got a warning that plotly was not yet implemented for geom_GeomXsidebar and geom_GeomYsidebar and suggestion to report it here. It would be lovely if plotly were implemented for these geoms.

My data structure was
master - a data frame containing:

  • region (character)
  • envir_var_elevation (numeric)
  • loggdppc (numeric)
  • value (numeric)
  • reactive_value (numeric)

df_plot - a data frame containing:

  • envir.group (numeric factor)
  • loggdppc.group (numeric factor)
  • value.squish (numeric)
  • reactive_value.mean (numeric)

df_plot was created by taking the data from master binning elevation and loggdppc and then finding the mean in each bin combination.

Here is my plot code

p_elev_income = ggplot(df_plot, aes(x = envir.group, y = loggdppc.group, fill = value.squish,
                                      text = glue("reactive adapt: {reactive_value.mean}"))) + 
    geom_tile() + 
    geom_xsidehistogram(data = master, aes(x = envir_var_elevation, y = after_stat(density)), binwidth = .01, inherit.aes = F) +
    geom_ysidehistogram(data = master, aes(x = after_stat(density), y = loggdppc), binwidth = 0.08, inherit.aes = F) +
    ggside(x.pos = "bottom", y.pos = "left") +
    xlab(xlab_name) +
    ylab("Log GDP per Capita") +
    scale_fill_gradientn(colours = blue_red.colors, 
                         name = scale_name,
                         limits = limits_val,  
                         breaks = breaks_labels_val,
                         labels = breaks_labels_val,
                         values = rescale(rescale_val),
                         na.value = NA
                         ) +
    theme(panel.background = element_rect(fill = 'white', colour = 'grey'),
          ggside.panel.scale.x = 0.2,
          ggside.panel.scale.y = 0.2)

ggplotly(p_elev_income)

Here's what the plot looks like when plotted normally:
Screen Shot 2024-01-11 at 11 11 46 AM

And here's what it looks like when plotted with plotly:
Screen Shot 2024-01-11 at 11 12 18 AM

I was using plotly because I wanted the hover text/tool tip ability, and that functionality did work correctly for me. Unfortunately, the side histograms disappeared. Also for my use case, I only need the hover text/tool tip on the main geom_tile portion of the graphic having it also appear on the side histograms would just be a bonus.

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

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

はじめの一歩

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

調査の方向性

まず、geom_xsidehistogram と geom_ysidehistogram のエントリポイントを含め、ggplotly が geom_GeomXsidebar と geom_GeomYsidebar をどのように処理するかを追跡します。通常の ggplot の出力と変換後のプロットを比較し、既存のメイン geom_tile のホバーテキストを保持したまま、サイドヒストグラムが ggplotly でレンダリングされることを確認します。

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

評価

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

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

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