Leverage react component/editor for interactive code generation
还没有人认领这个 Issue。
- 主要语言
- 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,
...
)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 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