-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: add channel to tooltip item #7099
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
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.
Summary of Changes
Hello @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!
此拉取请求旨在增强 G2 图表库中 tooltip 的自定义能力。通过在 tooltip item 对象中添加一个 channel 字段,解决了在有 series 数据时,tooltip item 的 name 字段被 series 占用,导致难以获取原始 y 轴字段的问题。这一改动使得开发者在自定义 tooltip 回调时,能够更便捷地访问到所需的数据通道信息,从而实现更灵活的 tooltip 展示逻辑。
Highlights
- 增强 Tooltip 自定义能力: 此变更在 tooltip item 对象中引入了一个新的 channel 字段。当业务需要自定义 tooltip 时,如果 name 字段被 series 信息占用,通过 channel 字段可以方便地获取到原始的 y 轴字段或其他相关通道信息,从而提升自定义的灵活性。
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 为 tooltip item 增加了一个新属性,用于保留原始的字段名,这对于自定义 tooltip 很有用,尤其是在使用 series 的情况下。实现很简单。我的主要反馈是关于新属性的命名,以提高 API 的清晰度。我建议将 channel 重命名为 field,以获得更好的描述性。
| ...item, | ||
| color, | ||
| name: name1 || title, | ||
| channel: name, |
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.
新属性 channel 的命名可以更具描述性。根据 PR 的描述,这个属性旨在保留 y 轴编码中的原始字段名,当使用 series 时,该字段名会丢失。
在 G2 中,channel 一词通常指代像 x、y 或 color 这样的视觉通道。这里存储的值是映射到某个通道的数据集中的字段(field)。因此,将此属性命名为 field 会更准确,对于自定义 tooltip 的用户来说也不会那么模棱两可。
我建议将 channel 重命名为 field。这将使该属性在 tooltip item 数据结构中的用途更加清晰。
| channel: name, | |
| field: name, |
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 assist ,field 挺好的。
Checklist
npm testpassesDescription of change
业务自定义 tooltip 的时候,需要取到原始的 y 轴字段,但 tooltip item 在有 series 的情况下,name 会是 series 而不是 y encode,不方便自定义,在回调里加一个 channel 字段

主要帮看看这个命名有没有什么其他更好的