plotly / plotly/plotly.R

Layout attribute "template"

未關閉
#1,817 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
R
星號
2.7k
分支
641
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 R 圖形參考中的 layout/template 項目開始,並將其與連結的 Python 模板文件進行比較。確認 plotly.R 是否已經提供模板處理功能;完成的標準是記錄受支援的引數語法,或確認缺少的實作及其所需的測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
r
領域
data-visualization
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。