plotly / plotly/plotly.R

Incorrect warning in `layout()` when using `bargroupgap`

Offen
#2,458 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

When using the bargroupgap argument, the following waring is thrown:

Warning message:
'layout' objects don't have these attributes: 'bargroupgap'
Valid attributes include: ...

However the attribute clearly exists and works

library(ggplot2)
library(plotly)


test <- tibble::tibble(
  A = c(1,2,3),
  B = c(3,2,1),
  C = c(4,1,4)
)

plot_ly(
  test,
  y = ~A,
  type = 'bar',
  name = 'Option A',
  marker = list(
    color = '#4E0F53'
  )
) |> 
  add_trace(
    y = ~B,
    name = 'Option B',
    marker = list(
      color = '#DC9542'
    )
  ) |> 
  add_trace(
    y = ~C,
    name = 'Option C',
    marker = list(
      color = '#a8aaad'
    )
  ) |> 
  layout(
    barmode = 'group',
    bargroupgap = 0.1
  )

Image


plot_ly(
  test,
  y = ~A,
  type = 'bar',
  name = 'Option A',
  marker = list(
    color = '#4E0F53'
  )
) |> 
  add_trace(
    y = ~B,
    name = 'Option B',
    marker = list(
      color = '#DC9542'
    )
  ) |> 
  add_trace(
    y = ~C,
    name = 'Option C',
    marker = list(
      color = '#a8aaad'
    )
  ) |> 
  layout(
    barmode = 'group'
  )
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

Führen Sie zunächst das reproduzierbare R-Beispiel im Issue aus und prüfen Sie, wie layout() Attribute validiert, wobei Sie sich darauf konzentrieren, warum bargroupgap abgelehnt wird, obwohl es funktioniert. Erledigt ist die Aufgabe, wenn das Beispiel nicht mehr die Warnung wegen eines ungültigen Attributs ausgibt und das Verhalten beim Abstand gruppierter Balken erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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