scattermapbox non-circle marker symbols not shown in legend since v4.12.0
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Since upgrading to plotly 4.12.0, only the "circle" symbol is rendered correctly in the legend for scattermapbox traces. Other marker symbols (e.g. "diamond", "square") are no longer displayed — the legend shows a blank entry for those.
v 4.12.0
v 4.11.0
(note that already in previuos versions, the non-circle markers were not shown on the canvas itself, but this was not an issue in our use case, because we only wanted to create the custom legend with the square markers)
reprex
library(plotly)
symbols_to_try <- c(
"circle",
"diamond",
"square",
"marker"
)
traces <- lapply(seq_along(symbols_to_try), function(i) {
list(
type = "scattermapbox",
mode = "markers",
lon = i * 2,
lat = 51,
name = symbols_to_try[i],
showlegend = TRUE,
hoverinfo = "name",
marker = list(
color = "steelblue",
size = 20,
symbol = symbols_to_try[i]
)
)
})
p <- plotly_empty() |>
layout(
mapbox = list(
style = "carto-positron",
center = list(lon = 5, lat = 51),
zoom = 3
),
legend = list(x = 1, xanchor = "right", y = 1)
) |>
config(displaylogo = FALSE)
for (tr in traces) {
p <- add_trace(p,
inherit = FALSE,
type = tr$type,
mode = tr$mode,
lon = tr$lon,
lat = tr$lat,
name = tr$name,
showlegend = tr$showlegend,
hoverinfo = tr$hoverinfo,
marker = tr$marker
)
}
p
packageVersion("plotly")
Further info:
The legend (and markers on canvas) work fine with "scattergeo" or even "scatter", but it has other side-effects in our setting that makes the plot be drawn twice, even if setting the layout like
plotly::layout(
plotly_object,
geo = list(
visible = FALSE,
showframe = FALSE,
showcoastlines = FALSE,
showland = FALSE,
showocean = FALSE
)
)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された R reprex を scattermapbox トレースで開始し、plotly 4.11.0 と 4.12.0 の間で凡例の動作を比較します。マーカーシンボルが add_trace を通じてどのように渡されるかを追跡し、scattermapbox の凡例処理を調査します。circle、diamond、square、marker のエントリが、scattergeo や scatter の動作に影響を与えずに正しくレンダリングされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100