Adding layers makes tooltips disappear
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, r
調査の方向性
まず、提供されている ggplotly の再現可能な例を実行し、州境の近くと遠くで hover の挙動を比較します。レイヤー化されたポリゴンおよびパスの trace が tooltip の選択をどのように処理するかを追跡します。州境付近でも、提案された workaround を必要とせずに郡名の tooltip が利用できれば完了です。issue ではファイル名もテストも指定されていないため、関連する hover コードの特定と回帰テストのカバレッジ追加には、プロジェクトへの理解が必要です。
索引モデルが issue の本文から書いたものです。
説明
Hi there,
I'm experiencing the same issue as @borenstein, referenced here: Adding layer makes tool tips disappear. Someone asked @borenstein to post the issue here but I didn't see a record of it. Here's a shorter reproducible example and summary; please note their solution (comparing data on hover) doesn't work in my use case (not shown here).
I want to create a plot where users can hover over a map and a tooltip for a single layer appears, for example, showing the names of US counties, with state boundaries overlaid on the map. If your mouse is "far" from a state boundary, the tooltip appears. However, if you are "close" (e.g., southeastern edge of map), the tooltip does not appear.
I've tried identifying the traces that contain parts of my plot that I don't want to show tooltips for - as in these stack overflow posts:
-
ggplotly - only return tooltip hover text on certain geom objects
-
Disable hover information for a specific layer (geom) of plotly
But, it doesn't work.
library(plotly)
library(tidyverse)
### New England: *sometimes* shows tool tips
new_england <- c("maine", "new hampshire", "vermont", "massachusetts", "connecticut", "rhode island")
b <- ggplot2::map_data("state") %>%
filter(region %in% new_england)
a <- data.frame(group = seq(3085), val = rnorm(3085)) %>%
left_join(ggplot2::map_data("county"), by = "group") %>%
filter(region %in% new_england)
p <- ggplot(a, aes(long, lat, group = group)) +
geom_polygon(aes(fill = val, text = subregion)) +
geom_path(data = b, color = "black")
ggplotly(p, tooltip="text")
Tagging @MountainCedar so they know I've filed an issue about this.
- 主要言語
- JavaScript
- スター
- 18.3k
- フォーク
- 2k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 30
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.js のほかの issue
-
chore P3 plotly-internal size: 3 task
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
bug P2 size: 1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
chore P1 plotly-internal size: 1 task
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
chore P3 plotly-internal size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
plotly/plotly.js の issue をすべて見る
似ている issue
-
bot:ai-assisted component:compact-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
midnightntwrk/midnight-sdk#403 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100