scattermapbox non-circle marker symbols not shown in legend since v4.12.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, r
- Ambito
- data-visualization
Direzione di ricerca
Iniziare con il reprex R fornito usando trace scattermapbox e confrontare il comportamento della legenda tra plotly 4.11.0 e 4.12.0. Tracciare il modo in cui i simboli dei marker vengono passati tramite add_trace e ispezionare la gestione della legenda di scattermapbox; il lavoro è completo quando le voci circle, diamond, square e marker vengono visualizzate correttamente senza influire sul comportamento di scattergeo o scatter.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
)
)
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/plotly.R
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
save_image Error Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
Tutte le issue di plotly/plotly.R
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
r-lib/pkgdepends#485 · 3 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
beginners blocker
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enviPathR ApertaBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
Bioconductor/BiocContributions#207 · 6 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
datacarpentry/semester-biology#1255 ·