Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

FR: Add support for plotly_sunburstclick and plotly_treemapclick in highlight()

Offen
#2,176 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
r

Rechercherichtung

Beginne damit nachzuverfolgen, wie highlight() die Ereignisnamen plotly_click und plotly_doubleclick behandelt, und vergleiche dieses Verhalten anschließend mit dem bereitgestellten sunburst- und treemap-Beispiel. Überprüfe, ob die crosstalk-Ansichten auf plotly_sunburstclick und plotly_treemapclick reagieren, während das bestehende highlight-Verhalten erhalten bleibt; das Issue nennt außerdem plotly_unhover als verwandte off-event-Anfrage.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

As sunburst/treemap charts have their own click-events: plotly_sunburstclick / plotly_treemapclick it would be nice to support them in highlight.

The following (plotly_click) doesn't work as expected:

library(plotly)
library(crosstalk)

sunburstDF <- structure(list(labels = structure(c(1L, 3L, 4L, 2L, 7L, 6L, 5L, 
7L, 6L, 5L, 7L, 6L, 5L), levels = c("Total", "mixed", "private", 
"public", "commercial", "recreation", "residential"), class = "factor"), 
    values = c(1658, 353, 1120, 185, 108, 143, 102, 300, 320, 
    500, 37, 58, 90), parents = c(NA, "Total", "Total", "Total", 
    "Total - private", "Total - private", "Total - private", 
    "Total - public", "Total - public", "Total - public", "Total - mixed", 
    "Total - mixed", "Total - mixed"), ids = c("Total", "Total - private", 
    "Total - public", "Total - mixed", "Total - private - residential", 
    "Total - private - recreation", "Total - private - commercial", 
    "Total - public - residential", "Total - public - recreation", 
    "Total - public - commercial", "Total - mixed - residential", 
    "Total - mixed - recreation", "Total - mixed - commercial"
    )), row.names = c(NA, -13L), class = "data.frame")


d <- highlight_key(sunburstDF, ~ids)
fig <- plot_ly(data = d, ids = ~ids, labels= ~labels, parents = ~parents, values= ~values, type='sunburst', branchvalues = 'total')
fig1 <- fig2 <- highlight(fig, on = "plotly_click", off = "plotly_doubleclick", dynamic = FALSE)
crosstalk::bscols(fig1, fig2)

Related: allow plotly_unhover as an off event: https://github.com/plotly/plotly.R/issues/1864

Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/plotly.R

Alle Issues in plotly/plotly.R

Ähnliche Issues

Weitere Issues zu R

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.