plotly / plotly/plotly.R

layout breaks with facet_wrap when employing scales=free

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

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

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

説明

I have a problem combining plotly::ggplotly (v4.7.1) with facet_wrap (v3.0.0) that I can't seem to generalise but is reproducible with a particular dataset (summary metrics for a set of tweets):

require(tidyverse)
require(plotly)
d = read_csv('https://gist.githubusercontent.com/geotheory/21c4eacbf38ed397f7cf984f8d92e931/raw/9148df79326f53a66a8cc363241a440752487357/data.csv')
d = d %>% mutate(key = fct_reorder(key, n)) # order the bars
p = ggplot(d, aes(key, n)) + geom_bar(stat='identity') + 
  facet_wrap(~ set, scales='free', nrow=1) +
  labs(x=NULL, y=NULL) + coord_flip()
print(p)

enter image description here

Enter ggplotly:

print(ggplotly(p))

enter image description here

This seems to relate to the combination of nrow=1 and scales='free' arguments. Any ideas about the cause?

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

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

はじめの一歩

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

調査の方向性

まず、提供されている R の例を、リンクされたデータセットと報告されている ggplot2 および plotly のバージョンで実行し、ggplot と ggplotly の描画結果を比較します。ggplotly が scales='free'、coord_flip()、nrow=1 を指定した facet_wrap をどのように処理するかを追跡します。変換後のプロットが、free scales を壊すことなく期待される facet レイアウトを維持すれば完了です。

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

評価

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

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

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