feat: Add markdown-like visualization syntax parser#325
Conversation
|
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
|
😭 Deploy PR Preview 1d04aeb failed. Build logs 🤖 By surge-preview |
|
@copilot 单元测试中,有些图表的语法写法不太对,比如雷达图、直方图应该是不对的。
|
…uctures Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Done in 5146bdd. Changes made:
All 78 tests now pass. |
|
@copilot 单元测试中,有些图表的语法写法不太对,比如双轴图,按照图表知识库,把所有图表都检查一遍,确保正确。 |
|
@copilot 单测中还缺少了一些图表,比如 boxplot,检查下还缺少哪些,都加一下。 另外根据图表知识库,检查下是否有一些配置没有在语法中实现。 |
… on knowledge bases Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Fixed in 8022749. Key corrections based on knowledge bases:
The parser was updated to support simple value arrays (flat arrays without key-value pairs) in addition to object arrays. All 81 tests pass. |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Added tests for all missing chart types in bb2d203. New test files added (9 new files):
Total: 26 test files, 108 tests covering all chart types from the knowledge bases. |
|
@copilot 集成到 gptvis 中的时候,render 函数第一个参数还是 chartType,第二个参数可以是语法 string, 也可以 config 对象,这样设计看起来代码简洁一些。 另外,对于层级数据的图表,增加嵌套 children 的测试案例。 |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Done in b8d46aa. API Changes:
Nested children support added for hierarchical charts:
Example: g.render('mind-map', `
data
- name 项目计划
children
- name 研究阶段
children
- name 市场调研
- name 技术分析
- name 开发阶段
`);Total: 26 test files, 112 tests |
|
@copilot render 函数传入的 syntax 一定是包含 vis 前缀的,所以不需要在解析前追加前缀。 |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Fixed in c14c1ed. The // Syntax string must include vis prefix
g.render('pie', `
vis pie
data
- category A
value 30
`); |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>

src/aidirectory to parse syntax string to objectGPTVisclass to support syntax string format input (pass through parser)render(type, config)where config can be object or syntax stringchildrensupport for hierarchical charts (mind-map, treemap, organization-chart, fishbone-diagram)visprefix__tests__directory (same level assrc)Test Files (26 total, 112 tests)
Located in
__tests__/directory at repository root.API
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.