-
Notifications
You must be signed in to change notification settings - Fork 220
feat: s2-vue支持分析组件(与 s2-react-components对齐) #3301
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: next
Are you sure you want to change the base?
Conversation
|
你好 @Alexzjt,非常感谢你的贡献. Hello, @Alexzjt, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
Summary of ChangesHello @Alexzjt, 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! 此拉取请求通过引入一套与 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 为 s2-vue 带来了与 s2-react-components 对齐的一系列分析组件,是一次非常大的功能增强。整体实现质量很高,代码结构清晰,充分利用了 Vue 3 的特性(如 <script setup> 和 computed)。
我发现了一些可以改进的地方:
- 在
AdvancedSort组件中,存在一个严重的类型安全问题,可能会导致运行时错误。 - 在
Switcher组件的工具函数中,发现了一些未使用的代码,可以进行清理。
具体的修改建议请见我的评论。除此之外,新增加的组件和功能都看起来很棒!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3301 +/- ##
==========================================
+ Coverage 75.77% 78.86% +3.09%
==========================================
Files 257 223 -34
Lines 11994 12269 +275
Branches 2464 2759 +295
==========================================
+ Hits 9088 9676 +588
+ Misses 1398 928 -470
- Partials 1508 1665 +157 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Size Change: +33.6 kB (+4.63%) 🔍 Total Size: 759 kB
ℹ️ View Unchanged
|
|
/gemini review |
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 是一次重大的功能增强,为 s2-vue 引入了一系列分析组件,使其与 s2-react-components 的功能对齐。新增的组件包括下钻、高级排序、导出、冻结面板、行列切换、文本对齐和主题设置等,极大地丰富了 s2-vue 的能力。代码实现上,大部分是直接从 React 版本移植而来,这有助于保持跨框架的一致性。
整体来看,代码结构清晰,组件划分合理。不过,在一些实现细节上还有提升空间,例如可以加强类型安全、避免使用有潜在问题的深拷贝方式等。此外,package.json 中包体积限制从 38kB 增加到 65kB,这是一个显著的增长,但考虑到新增了大量功能,这是可以预期的。
我已经在代码中提出了一些具体的改进建议,希望能帮助提升代码质量。
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
🧩 Components Extra (分析组件库)
该目录封装了一系列开箱即用的分析组件,用于增强 S2 表格的交互能力:
核心组件
🔽
drill-down(维度下钻)提供维度下钻交互能力,支持点击表格单元格后展示下钻菜单,并触发相应的数据下钻操作。
📶
advanced-sort(高级排序)提供高级排序入口及配置面板,支持对维度值进行“手动排序”或基于字段的“规则排序”。
📤
export(导出)提供表格数据导出功能,支持常规数据导出及策略导出 (
StrategyExport),方便数据二次分析。❄️
frozen-panel(冻结配置)提供行头与列头的冻结配置面板,支持动态设置冻结数量,优化长表格的阅读体验。
🔄
switcher(行列切换)提供维度切换器,允许用户通过直观的拖拽或勾选操作,动态调整行、列、值维度的配置。
📏
text-align-panel(对齐设置)提供文字对齐设置面板,用于便捷控制单元格文本的水平或垂直对齐方式。
🎨
theme-panel(主题设置)提供主题配置面板,支持快速切换或自定义表格主题色系,满足个性化视觉需求。
通用模块
common(通用组件)包含内部复用的通用 UI 组件,例如:
ResetButton: 重置按钮TooltipWrapper: Tooltip 包装器RadioGroup: 单选组🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge