Skip to content

Feat visualize#966

Merged
ninelcc336 merged 11 commits into
aifrom
feat-visualize
Jun 5, 2026
Merged

Feat visualize#966
ninelcc336 merged 11 commits into
aifrom
feat-visualize

Conversation

@ninelcc336

@ninelcc336 ninelcc336 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  • 将可视化功能从analysis()拆分为独立的visualize()方法
  • 图表推荐提示词结构化
  • 拆分advistor
  • 新增VisualizeResponse类型和图表定义元数据
  • 移除进度功能
  • 简化 analysis 和 visualize 方法的参数
  • 更新测试用例和文档

lkn added 2 commits June 4, 2026 12:15
- Split the visualization function from the `analysis()` method into a separate `visualize()` method
- Added VisualizeResponse type and chart definition metadata
- Update test cases and documentation to reflect the new architecture
- Use EventEmitter instead of callback functions to handle progress events
- Simplify the parameters of the analysis and visualize methods
- Update test cases and documentation to accommodate the new event system
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🎊 PR Preview dae3a9d has been successfully built and deployed to https://antvis-AVA-preview-pr-966.surge.sh

🕐 Build time: 0.009s

🤖 By surge-preview

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the AVA class to extend a new EventEmitter for emitting step events and splits the visualization logic out of the analysis method into a separate visualize method. It also dynamically builds the chart advisor prompt using structured chart definitions and updates the documentation and site components accordingly. The review feedback highlights several critical improvements: restoring try-catch blocks in analysis and visualize to properly emit error step events, checking for data presence before making expensive LLM calls, cleaning up empty event sets in EventEmitter to prevent memory leaks, stripping markdown code blocks from LLM outputs for robust parsing, and fixing a redundant nested ternary check in the tests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/ava.ts
Comment thread src/ava.ts
Comment thread src/events.ts Outdated
Comment thread src/visualization/advisor.ts
Comment thread __tests__/ava.test.ts Outdated
Comment thread src/ava.ts Outdated
Comment thread src/ava.ts Outdated
Comment thread src/visualization/advisor.ts Outdated
Comment thread src/visualization/advisor.ts
Comment thread src/visualization/index.ts Outdated
Comment thread README.md Outdated
@ninelcc336 ninelcc336 requested a review from hustcc June 4, 2026 09:37
@hustcc

hustcc commented Jun 4, 2026

Copy link
Copy Markdown
Member

@copilot buildAdvisorPrompt 方法放到 advisor 中,这个是提示词,是 advisor 的核心代码,然后在梳理下这部分代码是否有可优化的地方。

@hustcc

hustcc commented Jun 4, 2026

Copy link
Copy Markdown
Member

@copilot readme 中,在 📖 Quick Start 章节后面,加上 Document,介绍 AVA 的几个 API 以及使用方式,描述简洁精炼一些,可以配合小篇幅的示意代码。

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@copilot buildAdvisorPrompt 方法放到 advisor 中,这个是提示词,是 advisor 的核心代码,然后在梳理下这部分代码是否有可优化的地方。

已调整:buildAdvisorPrompt 已迁回 advisor.ts,并梳理优化了这部分逻辑(图表类型校验改为集合判断、图表描述改为惰性缓存生成)。对应提交:197b20e

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@copilot readme 中,在 📖 Quick Start 章节后面,加上 Document,介绍 AVA 的几个 API 以及使用方式,描述简洁精炼一些,可以配合小篇幅的示意代码。

已在 README 的 📖 Quick Start 后新增 📘 Documentation 章节,简要介绍了 AVA 核心 API 和使用方式,并补充了小篇幅示例代码。对应提交:9cfee7d

@hustcc

hustcc commented Jun 4, 2026

Copy link
Copy Markdown
Member

@copilot

  1. 图表信息的 name 不需要区分 zh 和 en,选择 name 即可,用中文名字即可。
  2. chartTypeList 不需要拼接 none 进去。
  3. chartDescriptionsCache 不需要缓存,直接在头部立即执行生成即可,没啥性能消耗

@hustcc

hustcc commented Jun 4, 2026

Copy link
Copy Markdown
Member

@copilot api 还缺少 new AVA 的介绍。

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@copilot

  1. 图表信息的 name 不需要区分 zh 和 en,选择 name 即可,用中文名字即可。
  2. chartTypeList 不需要拼接 none 进去。
    ...

已调整,提交 94cb902

  1. 图表元数据改为单一 name(中文);
  2. chartTypeList 不再拼接 none
  3. 移除 chartDescriptionsCache,改为模块初始化时直接生成 chartDescriptions

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@copilot api 还缺少 new AVA 的介绍。

已补充 new AVA 的 API 介绍,提交 dae3a9d

Copilot finished work on behalf of hustcc June 4, 2026 10:57
@ninelcc336 ninelcc336 merged commit b198822 into ai Jun 5, 2026
3 checks passed
@ninelcc336 ninelcc336 deleted the feat-visualize branch June 5, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants