-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: legend 支持 render 配置 #7153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v5
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @moayuisuda, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the customization capabilities of legends by introducing a Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
这个 PR 很好地实现了图例(legend)的自定义渲染功能,允许用户通过 render 函数返回 HTML 字符串或 DOM 元素来完全控制图例的展现形式和交互。这是一个非常实用的新特性,大大增强了 G2 的灵活性。
代码整体结构清晰,新功能的实现主要集中在 legendCategory.ts 和 legendFilter.ts 中,这是合理的。为新功能添加的测试用例 interval-tooltip-render.ts 也很好地覆盖了自定义渲染和交互的场景。
我在代码中发现了一些小问题,主要涉及交互逻辑中的一些错误和测试代码中的不一致之处。此外,对于交互逻辑部分,我有一个关于代码复用的重构建议。请查看具体的审查评论。
f930a43 to
a9bb52f
Compare
|
感觉这个应该在 |
渲染部分代码很少,大部分是绑定事件代码 那就这块代码放到 @antv/component 里? |
嗯嗯,在 component 里面加个 render 的实现。 |
Checklist
npm testpassesDescription of change
legend 支持 render 配置