plotly / plotly/plotly.R

pies and subplot not working as expected

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

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

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

説明

Based on this StackOverflow post, it seems pie charts are not working as I would expect with subplot. I will admit though that this is my first ever attempt at pie charts in Plotly. I did verify by inspecting DOM that both pies do exist in the examples below.

    # devtools::install_github('ropensci/plotly")

    library(plotly)
    ds_r <- data.frame(labels1 = c("Baseline", "DTC", "Detailing", "Flex"),
                       values1 = c(63.5, 8.5, 20.6, 7.4))

    ds_l <- data.frame(labels2 = c("Baseline"),
                       values2 = c(100))

    p <- plot_ly(
      ds_r, labels = ~labels1, values = ~values1, type = "pie", 
      showlegend = F
    )

    p2 <- plot_ly(
      ds_l,labels = ~labels2, values = ~values2, type = "pie", 
      showlegend = F
    )


    subplot(p, p2, nrows = 1)

image

empty axes

    # devtools::install_github('ropensci/plotly")
    # an "empty" plotlyjs axis for layout
    emptyAxis <- list(
      title = "", 
      zeroline = FALSE,
      showline = FALSE, 
      showticklabels = FALSE, 
      showgrid = FALSE
    )

    p <- plot_ly(
      ds_r, labels = ~labels1, values = ~values1, type = "pie", 
      showlegend = F
    ) %>% layout(xaxis = emptyAxis, yaxis  = emptyAxis)

    p2 <- plot_ly(
      ds_l,labels = ~labels2, values = ~values2, type = "pie", 
      showlegend = F
    ) %>% layout(xaxis = emptyAxis, yaxis  = emptyAxis)


    subplot(p, p2, nrows = 1)

image

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

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

はじめの一歩

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

調査の方向性

まず、plot_ly() と subplot() を使用して、空の軸レイアウトありとなしの 2 つの再現可能な例を実行します。subplot() が pie トレースと軸をどのように割り当てるかを追跡します。空の軸を必要とせずに、両方の円グラフが横並びで正しくレンダリングされれば完了です。

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

評価

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

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

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