plotly / plotly/plotly.R

hovertemplate doesn't work for points in boxplots

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

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

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

説明

Using hovertemplate on a boxplot breaks the tooltips for data points, it simply doesn't appear at all:

image

# Using hoverinfo (works)
plot_ly() %>% add_trace(y = 1:10, type = "box", hoverinfo = "y", boxpoints = "all", pointpos = 0)

# Using hovertemplate (doesn't work)
plot_ly() %>% add_trace(y = 1:10, type = "box", hovertemplate = "%{y}", boxpoints = "all", pointpos = 0)

When inspecting the hovertemplate graph using my browser's dev tools I found that this appears in the console when I move the mouse over a data point:

test2.html:1820 Uncaught TypeError: t.replace is not a function
    at Object.l.hovertemplateString (test2.html:1820)
    at SVGGElement.<anonymous> (test2.html:1820)
    at test2.html:1820
    at ut (test2.html:1820)
    at Array.W.each (test2.html:1820)
    at A (test2.html:1820)
    at test2.html:1820
    at test2.html:1820
    at l (test2.html:1820)
    at Object.r.throttle (test2.html:1820)

hovertemplate works as expected for other graph types, like e.g.:

plot_ly() %>% add_trace(y = 1:10, type = "bar", hovertemplate = "%{y}")

plotly 4.9.0
R 3.4.4

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

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

はじめの一歩

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

調査の方向性

boxpoints と hovertemplate を使った 2 つの R の例を boxplot で再現し、その後、動作する棒グラフの例と比較します。ブラウザーエラーに表示されている hovertemplateString の呼び出しから始めて、boxplot のポイントのホバー経路を追跡します。hovertemplate が boxplot のデータポイントに対して t.replace エラーなしでレンダリングされれば完了です。

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

評価

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

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

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