plotly / plotly/plotly.R

Layout attribute "template"

Offen
#1,817 1 Kommentar 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

After playing with plotly.py themes and templates options, I was wondering if it was possible to achieve the same result with plotly for R.

Although there is no themes available in R, I thought I could use the template options from the python themes and use them in a template in R.

In the plotly R figure reference, there is under "layout" the item "template" with the following description:

Parent: layout
Type: number or categorical coordinate string
Default attributes to be applied to the plot. Templates can be created from existing plots using Plotly.makeTemplate, or created manually. They should be objects with format: {layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...} layoutTemplate and traceTemplate are objects matching the attribute structure of layout and a data trace. Trace templates are applied cyclically to traces of each type. Container arrays (eg annotations) have special handling: An object ending in defaults (eg annotationdefaults) is applied to each array item. But if an item has a templateitemname key we look in the template array for an item with matching name and apply that instead. If no matching name is found we mark the item invisible. Any named template item not referenced is appended to the end of the array, so you can use this for a watermark annotation or a logo image, for example. To omit one of these items on the plot, make an item with matching templateitemname and visible: FALSE.

I have tried passing several possible argument to the template option of layout to no effect. Is there an option to use a template at the moment in plotly.R, and if so what is the proper syntax for the argument to pass?

Thank you very much for your help.

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 Eintrag zu layout/template in der R-Figure-Referenz und vergleiche ihn mit der verlinkten Dokumentation zu Python-Templates. Ermittle, ob plotly.R die Template-Verarbeitung bereits bereitstellt; als erledigt gilt die Aufgabe entweder, wenn die Syntax des unterstützten Arguments dokumentiert ist, oder wenn die fehlende Implementierung und die dafür erforderlichen Tests identifiziert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
data-visualization
Issue-Typ
Feature
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.