plotly / plotly/plotly.R

Translate JSON references in docs to R equivalents

Offen
#439 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

Is this an error in the documentation for R? This is for heatmap > colorscale section link:

Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, [[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in z space, use zmin and amax

Two things, first it's missing a ']'. That's far less important as you can't feed R an array using that syntax. If I take the example from the site:

plot_ly(z = volcano, type = "heatmap")

And I create a var called 'colScale' to add a custom colorscale value, then this (going by the documentation) won't work:

colScale = [[0, 'rgb(10,0,50)'], [1, '#rgb(50,100,10)']]

It gives me an error (in R itself, not in the attempt to draw the plot). If I make a list and add it to the sample it works:

colScale= list(c(0, "rgb(10,0,50)"),list(1, "rgb(50,100,10)"))
plot_ly(z = volcano, type = "heatmap" , colorscale = colScale)

Using a simple 'Find' command it looks like there are multiple instances of the array syntax in the R documentation on the site.

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 der verlinkten Referenz zur heatmap-Farbskala und durchsuche die R-Dokumentation nach der gemeldeten Array-Syntax. Aktualisiere die betroffenen Beispiele auf gültige R-Entsprechungen, einschließlich des Beispiels für die heatmap-Farbskala, und bestätige, dass die Dokumentation JSON-artige Arrays nicht länger als R-Code darstellt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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