ggplotly not working with control chart library ggQC
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- r
調査の方向性
まず、提供されている R の再現コードを ggplotly、ggplot2、ggQC とともに実行し、動作するプロットと stat_QC() を使用するバージョンを比較します。報告されている「alpha must be of length 1 or the same length as x」エラーを調査し、制御チャートのレイヤーがハードエラーなしに ggplotly を通じてレンダリングされることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Brief description of the problem:
Adding some lines and labels using the ggQC library causes a hard fail.
This code works with ggplotly:
min_date = as.Date(min(lots_df_filtered()$DATE))
max_date = as.Date(max(lots_df_filtered()$DATE))
if (!is.na(min_date)) {
num_days = length(seq(from = min_date, to = max_date, by = 'day')) - 1
date_breaks <- if(num_days <= 31) 'day' else 'week'
XmR_Plot <-
ggplot(lots_df_filtered(), aes(x = as.Date(DATE), y = YRS_YIELD)) +
geom_point(alpha = .5) + geom_line() +
labs(title=paste0(input$mfg_step_name, ' Lot Yield Control Chart')) +
scale_x_date(date_breaks=date_breaks) +
theme_ipsum_ps() +
theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust=1),
axis.title.x=element_blank())
output$lot_time_series <- renderPlotly(ggplotly(XmR_Plot))
}`
Produces a nice chart as so:

The following code results in an error (alpha must be of length 1 or the same length as x):
min_date = as.Date(min(lots_df_filtered()$DATE))
max_date = as.Date(max(lots_df_filtered()$DATE))
if (!is.na(min_date)) {
num_days = length(seq(from = min_date, to = max_date, by = 'day')) - 1
date_breaks <- if(num_days <= 31) 'day' else 'week'
XmR_Plot <-
ggplot(lots_df_filtered(), aes(x = as.Date(DATE), y = YRS_YIELD)) +
geom_point(alpha = .5) + geom_line() +
stat_QC(method = "XmR",
auto.label = T,
label.digits = 2,
show.1n2.sigma = T
) +
labs(title=paste0(input$mfg_step_name, ' Lot Yield Control Chart')) +
scale_x_date(date_breaks=date_breaks) +
theme_ipsum_ps() +
theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust=1),
axis.title.x=element_blank())
output$lot_time_series <- renderPlotly(ggplotly(XmR_Plot))
}
Here is what the ggplot looks like when I do not use ggplotly and do use ggCC:

Could this be related to the ggplotly argument layerData? Any help is appreciated.
thx
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.R のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
save_image Error オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
plotly/plotly.R の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pharmaverse/rtables#1123 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Trying to reassign a reactiveVal to the name of an existing reactiveVal doesn't overwrite the latter オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
RConsortium/rconsortium_website#649 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
posit-dev/r-shinylive#203 ·