Layout attribute "template"
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
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 usingPlotly.makeTemplate, or created manually. They should be objects with format:{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}layoutTemplateandtraceTemplateare objects matching the attribute structure oflayoutand a data trace. Trace templates are applied cyclically to traces of each type. Container arrays (egannotations) have special handling: An object ending indefaults(egannotationdefaults) is applied to each array item. But if an item has atemplateitemnamekey we look in the template array for an item with matchingnameand apply that instead. If no matchingnameis 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 matchingtemplateitemnameandvisible: 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the R figure reference's layout/template entry and compare it with the linked Python template documentation. Determine whether plotly.R already exposes template handling; done means either documenting the supported argument syntax or identifying the missing implementation and its required tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100