plotly / plotly/plotly.R

plotly_relayout does not always fire

Offen
#1,909 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

I will try and create a reprex if needed however I'm still trying to pin down an exact cause of this, for now I'll include relevant snippets.

In one of my projects I have been using the drawing capabilities of plotly.js:

    plotly::plot_ly(.......) %>%
      plotly::config(modeBarButtonsToAdd = list("drawclosedpath", "drawrect", "eraseshape")) %>%
      plotly::config(displayModeBar = TRUE)

I am listening to the plotly relayout event:

  observeEvent(plotly::event_data("plotly_relayout", session = session$rootScope()), {
    relayout <- plotly::event_data("plotly_relayout", session = session$rootScope())
    dplyr::glimpse(relayout)
    #.... rest of the code omitted
  })

The issue I am seeing is not all of the drawing events are triggering a shiny event. I have used the websocket viewer of Firefox developer console and the socket contains gaps where the relayout even should be. Hover events are being produced as the mouse is moved for the drawing of the shape however.

I'm seeing series of errors in the browser console:
image

Specifically for the rectangle draw:
image

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem plotly::event_data("plotly_relayout")-Observer und der websocket-Ausgabe in der Firefox-Entwicklerkonsole und vergleiche Zeichenaktionen mit Socket-Nachrichten und den gemeldeten Browserfehlern. Als abgeschlossen gilt die Untersuchung, wenn es einen reproduzierbaren Fall gibt, der identifiziert, warum Rechteck- oder andere Zeichenereignisse das Shiny-Ereignis nicht auslösen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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