plotly / plotly/plotly.R

Multicategory axis support

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

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

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

説明

Hi,

I am trying to use multicategory axes and get very inconsistent behavior. This is what I tested so far:

Bar charts:

I need to manually supply type = "multicategory" to the axis. This is opposed to what I have read for the python api, where this will happen automatically if your traces have arrays. see here

reprex

library(plotly)
two_f <- rbind(
  c("BB+", "BB+", "BB+", "BB", "BB", "BB"),
  c(16, 17, 18, 16, 17, 18)
)
p <- plot_ly() %>% 
  add_bars(x=two_f,y=c(1,2,3,4,5,6)) %>% 
  layout(barmode="relative")
p # no multicategory axis
p_multi <- p %>% layout(xaxis=list(side = "top", type = "multicategory"))
p_multi # multicategory axis on top

Heatmaps:

Thanks to michaelbabyn, I know how to create a multicategory x-axis for a heatmap. However, as opposed to bar charts, making a multicategory y-axis crashes, and trying to move the x-axis on top of the chart also crashes.

reprex

library(plotly)
q <- plot_ly() %>% 
  add_heatmap(
    x=rbind(c('aa', 'aa', 'bb', 'bb', 'cc', 'cc'), c(1,2,3,4,5,6)),
    y=c(1,2,3,4,5,6),
    z = array(seq(1,10, length.out = 36), c(6,6)))
q # this works
q_y <- plot_ly() %>% 
  add_heatmap(
    x=c(1,2,3,4,5,6),
    y=rbind(c('aa', 'aa', 'bb', 'bb', 'cc', 'cc'), c(1,2,3,4,5,6)),
    z = array(seq(1,10, length.out = 36), c(6,6))) 
## this would crash the Rstudio session:
## it should render something like https://codepen.io/michaelbabyn/pen/pMOOwM?editors=0010
# q_y

## this also breaks the session:
qx_top <- q %>% layout(xaxis=list(side = "top"))
# qx_top

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

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

はじめの一歩

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

調査の方向性

まず、提供されている plot_ly()、add_bars()、add_heatmap()、layout() の再現コードを RStudio で実行し、棒グラフとヒートマップのケースを比較します。x 軸と y 軸のマルチカテゴリ軸の処理を追跡します。完了の条件は、ヒートマップの y 軸と上部に配置された x 軸を含め、例がクラッシュせず一貫してレンダリングされることです。

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

評価

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

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

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