plotly / plotly/plotly.R

ggplotly barcharts with Dates and dynamicTicks=T

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

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

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

説明

I experience a weird behaviour when using barcharts with Dates on the x-Axis and dynamicTicks=T.

1 bar of the example (4th July) is in a different color, it doesnt show up and the highlight function also doesnt color the clicked bar, although the legend suggests otherwise.

When converting the Dates to character, everything shows up correctly and also the highlight function shows up, but the labels look horrible.


Plot with Dates

library(ggplot2)
library(plotly)

dfN <- data.frame(
  time_stamp = seq.Date(as.Date("2018-04-01"), as.Date("2018-07-30"), 1),
  val = runif(121, 100,1000),
  col = "green", stringsAsFactors = F
)

dfN[95,]$col = "orange"

maxY = max(dfN$val)
key <- highlight_key(dfN)

p <- ggplot() +
  geom_col(data = key, aes(x = (time_stamp), y = val, fill=I(col)), width = 1)

## 4 of July doesnt show at all (should show an orange bar)
ggplotly(p, source = "Src", dynamicTicks = T, originalData = T) %>%
  highlight(selectize=F, on="plotly_click", off = "plotly_doubleclick", color = "blue")

rplot


Plot with Characters

p <- ggplot() +
  geom_col(data = key, aes(x = as.character(time_stamp), y = val, fill=I(col)), width = 1) +
  ggtitle("Characters on x-Axis")

ggplotly(p, source = "Src", dynamicTicks = T, originalData = T) %>%
  highlight(selectize=F, on="plotly_click", off = "plotly_doubleclick", color = "blue")

rplot02

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

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

はじめの一歩

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

調査の方向性

まず、plotly.R で issue の再現可能な R 例を実行し、dynamicTicks と highlight を有効にした Date の x 軸の場合と character の x 軸の場合を比較します。7月4日の棒が期待される色で描画され、クリックすると使いやすい日付ラベルを維持したまま highlight が正しく適用されれば完了です。

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

評価

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

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

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