hovertemplate does not show value
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
When using the %{text} placeholder, it sometimes gets displayed instead of the actual value of text. The following code produces a plot where, when I hover over the middle point, gives me this hover text:
Price: $6.84
X: 3
%{text}
Other points display correctly, eg.
Price: $2.03
X: 1
Text A
The code I use is a slightly modified example:
tibble::tibble(
x = c(1,2,3,4,5),
y = c(2.02825,1.63728,6.83839,4.8485,4.73463),
color = factor(c(1, 1, 2, 3, 3))) %>%
plot_ly() %>%
add_trace(
type = 'scatter', mode = 'lines+markers',
x = ~x, y = ~y, color = ~color,
text = c("Text A", "Text B", "Text C", "Text D", "Text E"),
hovertemplate = paste('<i>Price</i>: $%{y:.2f}',
'<br><b>X</b>: %{x}<br>',
'<b>%{text}</b>'),
showlegend = FALSE)
You can donwload the resulting html here (in case it renders differently for you for some reason). Note that when color is not used, this does not happen and all the points display correct hover text.
R version 3.6.3 (2020-02-29)
plotly 4.9.2.1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、記載されている R と plotly のバージョンで、提供された plot_ly() と add_trace() の例を実行し、その後、色付きのトレースと色なしのトレースを比較します。中央の点が引き続き Text C ではなく %{text} をレンダリングするか確認し、その比較を使って hovertemplate の処理を追跡します。ソースファイルやテストは指定されていないため、reproducer がすべての点について実際のテキストを表示すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100