plotly / plotly/plotly.R

geom_flow() has yet to be implemented in plotly

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

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

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

説明

I've added a reproducible example here. The plot will work under normal ggplot conditions but not if you send it to ggplotly

library(ggplot2)
library(ggalluvial)
library(tidyverse)

data(vaccinations)
levels(vaccinations$response) <- rev(levels(vaccinations$response))

vaccinations <- vaccinations %>% 
    group_by(survey) %>% 
    mutate(pct = freq / sum(freq)) %>% 
    ungroup() %>% 
    mutate(
        test_color = case_when(
            subject %in% {vaccinations %>% 
                filter(
                    survey == "ms460_NSA" & response %in% "Never"
                ) %>% 
                distinct(subject) %>% 
                pull()} ~ "Yes",
            TRUE        ~ "No"
        )
    )

g <- ggplot(vaccinations,
       aes(x = survey, stratum = response, alluvium = subject,
           y = pct,
           fill = test_color,
           label = response)) +
    scale_x_discrete(expand = c(.1, .1)) +
    scale_y_continuous(label = scales::percent_format()) +
    scale_fill_manual(values = c("Yes" = "cadetblue1", "No" = "grey50")) +
    geom_flow() +
    geom_stratum(alpha = .5) +
    geom_text(aes(label = paste0(..stratum.., "\n", scales::percent(..count.., accuracy = .1))), stat = "stratum", size = 3) +
    theme(legend.position = "none") +
    ggtitle("vaccination survey responses at three points in time")

g
g %>% ggplotly()

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

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

はじめの一歩

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

調査の方向性

まず、提供されたワクチン接種の例を R で再現し、geom_flow() に対する ggplotly() の変換経路を追跡します。レンダリングされた結果を元の ggplot の出力と比較します。geom_flow() が ggplotly() でサポートされ、例で期待されるフローがレンダリングされれば完了です。

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

評価

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

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

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