plotly / plotly/plotly.R

highlight() function: setting the 'off' event to 'plotly_unhover' results in an error.

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

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

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

説明

This is a modified example from here:

library(plotly)

# load the `txhousing` dataset
data(txhousing, package = "ggplot2")

# declare `city` as the SQL 'query by' column
tx <- highlight_key(txhousing, ~city)

# initiate a plotly object
base <- plot_ly(tx, color = I("black")) %>% 
  group_by(city)

# create a time series of median house price
time_series <- base %>%
  group_by(city) %>%
  add_lines(x = ~date, y = ~median)

highlight(
  time_series, 
  on = "plotly_hover",
  off = "plotly_hover", # causes error
  selectize = FALSE, 
  dynamic = FALSE,
  color = "red",
  persistent = FALSE
)

Not providing off results in a warning:

Setting the off event (i.e., 'plotly_doubleclick') to match the on event (i.e., 'plotly_hover'). You can change this default via the highlight() function.

Setting off to plotly_hover or plotly_unhover (my initial intention) results in an error:

Error in match.arg(off, off_options) :
'arg' should be one of “plotly_doubleclick”, “plotly_deselect”, “plotly_relayout”

Found this via: https://stackoverflow.com/a/64387370/9841389

PS: using the latest CRAN version of plotly.

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

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

はじめの一歩

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

調査の方向性

highlight() のエントリポイントから開始し、off を plotly_hover と plotly_unhover に設定した変更後の txhousing 例を再現します。off_options の検証を調べ、文書化されたイベントの動作と比較します。完了とは、有効な off イベントで報告された match.arg エラーが発生しなくなり、例が意図したとおりに動作することです。

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

評価

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

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

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