plotly / plotly/plotly.R

ggplotly can omit geom_lines when they are colour coded within groups

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

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

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

説明

Create a ggplot graph in which geom_line objects connect data points within a grouping variable and when colour is also mapped to a variable. i.e. the output is a grid of dots in which dots at the same height are connected by horizontal lines:

ggplot_output

When passed to the ggplotly function, however, the lines are often omitted. In the reproducible example below, all the lines are omitted, but in other examples, sometimes just individual lines fail to plot. In this example, lines, but not points, do appear in the legend:

ggplotly_output

To isolate the problem, in the example below, if the colour = time parameter is dropped from the aes() function, then the lines (in monochrome) do get displayed.

library(ggplot2)
library(dplyr)
library(plotly)

# a dataframe with multiple values per case:
d = data.frame(case = as.factor(rep(1:5, each = 4)),
               time = as.factor(rep(1:4, times = 5)))

p = d %>% 
  ggplot(aes(x = time, y = case, colour = time)) +
  # produce lines to link points within a case: 
  geom_line(aes(group = case)) + 
  geom_point()

print(p) # standard ggplot output includes both lines and points
 
ggplotly(p) # but plotly output omits lines when colour is specified

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

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

はじめの一歩

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

調査の方向性

ggplotly()、geom_line()、geom_point() を使用し、colour を time にマッピングした再現可能な R の例から始めます。その出力を単色線のバリエーションと比較します。ggplotly がグループ化された geom_line レイヤーをどのように変換するかを追跡し、colour をマッピングした場合にすべてのグループ化された線が表示され、点と凡例が正しい状態で維持されることを確認します。

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

評価

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

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

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