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: 统一链接跳转字段绘制逻辑, 支持标记列头 close #2430 #2796

Merged
merged 8 commits into from
Jul 5, 2024

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Jun 28, 2024

👀 PR includes

✨ Feature

  • New feature

📝 Description

  1. 统一绘制逻辑, 支持列头 close 🙏 链接跳转 - 透视表支持 colums #2430, 现在链接跳转支持对 列头 标记,且明细表同时对 列头数值 生效(可自定义规则)
  2. 修正链接跳转错误文档, 完善自定义标记的教程
const s2Options = {
  interaction: {
    linkFields: ['province', 'city', 'type', 'sub_type', 'number', EXTRA_FIELD]
  }
}
  1. 回调参数 key 调整为 field, cellData 调整为 meta, 风格保持统一.
s2.on(S2Event.GLOBAL_LINK_FIELD_JUMP, (data) => {
-  const { key, cellData, record } = data;
+  const { field, meta, record } = data;
});

🖼️ Screenshot

Before After
image image

🔗 Related issue link

close #2430

🔍 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.

Copy link

vercel bot commented Jun 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Jul 1, 2024 8:37am

@github-actions github-actions bot added pr(feature) new feature next 2.0-next 版本的问题 labels Jun 28, 2024
@lijinke666 lijinke666 changed the title feat: 统一链接跳转字段绘制统一, 支持标记列头 close #2430 feat: 统一链接跳转字段绘制逻辑, 支持标记列头 close #2430 Jun 28, 2024
@github-actions github-actions bot requested review from wjgogogo and wuhaiyang June 28, 2024 07:54
Copy link
Contributor

github-actions bot commented Jun 28, 2024

Size Change: +17 B (+0.01%)

Total Size: 326 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 228 kB +17 B (+0.01%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 388 B
./packages/s2-react/dist/index.min.js 69.8 kB
./packages/s2-react/dist/style.min.css 3.88 kB
./packages/s2-vue/dist/index.min.js 22 kB
./packages/s2-vue/dist/style.min.css 1.97 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Jun 28, 2024

你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。

Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it.

@github-actions github-actions bot added the 🚨 test failed 单元测试挂了 label Jun 28, 2024
@lijinke666 lijinke666 linked an issue Jun 28, 2024 that may be closed by this pull request
1 task
@github-actions github-actions bot removed the 🚨 lint failed 静态检查失败 label Jul 1, 2024
@github-actions github-actions bot removed the 🚨 test failed 单元测试挂了 label Jul 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.15%. Comparing base (ecdc9c8) to head (3197402).
Report is 398 commits behind head on next.

Files Patch % Lines
...n/base-interaction/click/header-cell-link-click.ts 92.30% 1 Missing and 1 partial ⚠️
...ckages/s2-core/src/utils/interaction/link-field.ts 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2796      +/-   ##
==========================================
+ Coverage   75.77%   80.15%   +4.38%     
==========================================
  Files         257      180      -77     
  Lines       11994    10337    -1657     
  Branches     2464     2331     -133     
==========================================
- Hits         9088     8286     -802     
+ Misses       1398      607     -791     
+ Partials     1508     1444      -64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -70,7 +71,7 @@ export interface EmitterType {

/** ================ Cell ================ */
[S2Event.GLOBAL_LINK_FIELD_JUMP]: (data: {
cellData: Node;
meta: Node | ViewMeta;
Copy link
Member Author

Choose a reason for hiding this comment

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

dataCell 是 ViewMeta, 并不是 Node

@@ -0,0 +1,64 @@
import type { FederatedPointerEvent as CanvasEvent } from '@antv/g';
Copy link
Member Author

Choose a reason for hiding this comment

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

原 row-text-click 改了个名, 增加了列头点击

image

@lijinke666 lijinke666 merged commit 637f651 into next Jul 5, 2024
8 of 9 checks passed
@lijinke666 lijinke666 deleted the feat-2430 branch July 5, 2024 08:00
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v2.0.0-next.25 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-v2.0.0-next.24 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-components-v1.0.0-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(feature) new feature released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🙏 链接跳转 - 透视表支持 colums
3 participants