Skip to content
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

feat: 小计/总计功能,支持按维度分组汇总 #2328

Closed
wants to merge 388 commits into from

Conversation

NoobNotN
Copy link
Collaborator

@NoobNotN NoobNotN commented Sep 4, 2023

👀 PR includes

✨ Feature

  • New feature

📝 Description

总计/小计 按配置的维度进行分组汇总,以便进行更精确的汇总数据对比。
所增加的两个 API:

  • S2Options.Totals.Total.totalsDimensionsGroup:string[]
  • S2Options.Totals.Total.subTotalsDimensionsGroup:string[]

🖼️ Screenshot

下图中总计按城市+类别进行分组汇总,小计按子类别进行分组汇总。

  • totalsDimensionsGroup: [’city‘,'type']
  • subTotalsDimensionsGroup: ['sub_type']
    image

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

lcx-seima and others added 30 commits June 21, 2022 16:35
* feat(Api): 添加 totalDimensionGroup/subTotalDimensionGroup api,以及一些临时的开发函数

* feat(Hierarchy): 总计小计结点下添加Hierarchy

* feat(Render): getMultipleMap 实现,计算总计小计下的布局信息

* feat(Render): 按维度分组的小计总计下表头位置的调整和渲染

* feat(DataSet): 存在维度分组时的汇总值获取

* feat(DataSet): 存在维度分组时的汇总值获取

* feat(DataSet): 存在维度分组时的汇总值获取

* feat: 补充注释

* feat: 单测快照更新,添加isTotalRoot属性

* fix: 有多个 Value 时不允许隐藏度量列

* fix: 有多个 Value 时不允许隐藏度量列

* fix: 删除了一个莫名其妙的函数

* test: 按维度分组汇总能力单测

* docs: 按维度分组汇总能力文档

* test: 更新,多度量指标不允许隐藏指标头

* docs: 图片示例

* test: 更新 snap 数据文件

* chore: 版本号更新

* chore: 版本号更新

* chore: 版本号更新

* chore: 版本号更新

* chore: 版本号更新

* chore: 版本号更新

* chore: 版本号更新

* Merge remote-tracking branch 'origin/Juze_TotalsDimGroup' into Juze_TotalsDimGroup

* test: 更新快照

* chore: 删除开发测试文件

* fix: 汇总指标节点也是汇总节点

* chore: 删除无用文件

* fix: isTotalRoot 替换 isTotals

* fix: isTotalRoot 替换 isTotals

* fix: isTotalRoot 替换 isTotals

---------

Co-authored-by: JuZe <[email protected]>
@lijinke666
Copy link
Member

@NoobNotN test 挂了

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Patch coverage: 74.55% and project coverage change: -0.07% ⚠️

Comparison is base (1adc25d) 76.48% compared to head (b02ca11) 76.42%.
Report is 61 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2328      +/-   ##
==========================================
- Coverage   76.48%   76.42%   -0.07%     
==========================================
  Files         240      241       +1     
  Lines       12312    12569     +257     
  Branches     2630     2701      +71     
==========================================
+ Hits         9417     9606     +189     
+ Misses       1377     1371       -6     
- Partials     1518     1592      +74     
Files Changed Coverage Δ
packages/s2-core/src/cell/col-cell.ts 89.18% <ø> (-0.02%) ⬇️
packages/s2-core/src/cell/corner-cell.ts 83.33% <0.00%> (+0.64%) ⬆️
packages/s2-core/src/cell/row-cell.ts 73.57% <ø> (+0.23%) ⬆️
packages/s2-core/src/cell/table-col-cell.ts 86.53% <ø> (+4.72%) ⬆️
...ackages/s2-core/src/common/constant/interaction.ts 100.00% <ø> (ø)
packages/s2-core/src/data-set/base-data-set.ts 93.93% <ø> (+0.39%) ⬆️
packages/s2-core/src/data-set/table-data-set.ts 73.68% <ø> (-0.99%) ⬇️
packages/s2-core/src/sheet-type/pivot-sheet.ts 86.30% <0.00%> (+0.19%) ⬆️
packages/s2-core/src/theme/index.ts 92.30% <ø> (-7.70%) ⬇️
packages/s2-core/src/utils/cell/data-cell.ts 77.08% <ø> (ø)
... and 41 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

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.

8 participants