Range breaks in plotly R
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi,
Recently Plotly introduced breaks on date axes ( plotly v 4.6.0 ). They are pretty handy to remove weekends and missing dates while plotting. So far the fix was to make the Date as type =Category. But this makes the range slider not working. Thats also why this rangebreak was brought up. I dont know if its available in R yet.
A small workable script is given below
library(readr)
library(plotly)
a <- read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
plot_ly(a[450:500,], x = ~Date, y = ~AAPL.High, type='scatter', mode = 'markers') %>%
layout(xaxis = list(
rangebreaks= list (
values= c("2016-12-25", "2016-12-24","2016-12-26","2017-01-01"))
))
Screenshot of the output:
This doesnt hide the missing dates, but it doesnt give any error either. I was wondering what am I doing wrong here.
Thanks
Additional information:
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plotly_4.9.2.1 ggplot2_3.3.0 readr_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 rtsdata_0.1.2 pillar_1.4.4 compiler_4.0.0 xts_0.12-0 tools_4.0.0 digest_0.6.25 jsonlite_1.6.1
[9] lifecycle_0.2.0 tibble_3.0.1 gtable_0.3.0 lattice_0.20-41 viridisLite_0.3.0 pkgconfig_2.0.3 rlang_0.4.6 cli_2.0.2
[17] rstudioapi_0.11 crosstalk_1.1.0.1 yaml_2.2.1 curl_4.3 withr_2.2.0 dplyr_0.8.5 httr_1.4.1 vctrs_0.3.1
[25] htmlwidgets_1.5.1 hms_0.5.3 grid_4.0.0 tidyselect_1.1.0 glue_1.4.1 data.table_1.12.8 R6_2.4.1 fansi_0.4.1
[33] purrr_0.3.4 tidyr_1.1.0 magrittr_1.5 scales_1.1.1 ellipsis_0.3.1 htmltools_0.4.0 assertthat_0.2.1 colorspace_1.4-1
[41] lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4 zoo_1.8-8
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、plotly 4.9.2.1 で layout(xaxis = list(rangebreaks = ...)) を使用した付属の plot_ly() 例を実行し、その結果を Plotly の日付軸における rangebreak の動作と比較します。R-to-Plotly における xaxis rangebreaks の処理を追跡し、期待される結果が、動作する range slider を維持しながら欠落した日付を非表示にすることかどうかを明らかにします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100