plotly / plotly/plotly.R

Leverage react component/editor for interactive code generation

未关闭
#1,336 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

Programmatically placing annotations/shapes/images etc is difficult. Ideally we'd have some sort of GUI to assist in generating the relevant code. Plotly cloud does offer a solution, but there are two main issues:

  • Code generation works on the JSON-level, meaning any high-level R code gets lost.
  • The UI is complex -- it tries to do everything plotly.js can do without making common things easy.

https://github.com/plotly/react-chart-editor was recently open-sourced and could provide infrastructure for generating "focused" and locally-rendered GUIs that could help you generate code for these use-cases. For example, something like:

library(plotly)
qplot(1:10) %>%
  ggplotly() %>%
  layout_edit("annotations")

Could pop-up a shiny gadget wrapper around the react editor specifically for adding and/or editing existing annotation(s). It seems likely that we could retain the high-level (input) code and add the relevant code necessary to recreate the manual edits:

qplot(1:10) %>%
  ggplotly() %>%
  add_annotations(
    text = "My label",
    x = 0,
    y = 1,
     ...
  )

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读链接的 react-chart-editor 项目以及本 issue 中的 R 示例,尤其是提议的 layout_edit() 和 add_annotations() 流程。该 issue 没有指出 repository 文件、测试或验收标准;要完成这项工作,需要就一个聚焦的 GUI 达成一致,保留高层 R 代码,并定义如何验证生成的编辑。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, r, react
领域
data-visualization, frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。