antvis / S2

⚡️ A practical visualization library for tabular analysis.
https://s2.antv.antgroup.com
MIT License
1.49k stars 196 forks source link

feat: 增加不同类型单元格的选中事件 & 支持识别事件来源 #2956

Closed lijinke666 closed 3 weeks ago

lijinke666 commented 3 weeks ago

👀 PR includes

✨ Feature

📝 Description

单选/多选/圈选 等场景都会触发选中事件, 但是只有一个 GLOBAL_SELECTED 事件, 无法较好的区分是哪个交互触发

image

  1. 增加不同单元格的选中事件
  2. 事件回调中, 增加第二个参数
interface CellSelectedDetail {
  /**
   * 触发选中的交互名
   */
  interactionName?: `${InteractionName}`;
  /**
   * 触发选中的单元格
   */
  targetCell?: S2CellType | null;
}

🖼️ Screenshot

Before After

🔗 Related issue link

🔍 Self-Check before the merge

vercel[bot] commented 3 weeks ago

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

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Nov 1, 2024 10:14am
github-actions[bot] commented 3 weeks ago

Size Change: +434 B (+0.13%)

Total Size: 336 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 236 kB +303 B (+0.13%)
./packages/s2-react/dist/index.min.js 70.9 kB +35 B (+0.05%)
./packages/s2-vue/dist/index.min.js 23 kB +96 B (+0.42%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `./packages/s2-core/dist/style.min.css` | 388 B | | `./packages/s2-react/dist/style.min.css` | 3.77 kB | | `./packages/s2-vue/dist/style.min.css` | 1.85 kB |

compressed-size-action

github-actions[bot] commented 3 weeks ago

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

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

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 80.48780% with 8 lines in your changes missing coverage. Please review.

Project coverage is 80.73%. Comparing base (ecdc9c8) to head (29818d5). Report is 468 commits behind head on next.

Files with missing lines Patch % Lines
...eraction/base-interaction/click/data-cell-click.ts 60.00% 0 Missing and 2 partials :warning:
packages/s2-core/src/interaction/root.ts 66.66% 0 Missing and 2 partials :warning:
...raction/base-interaction/click/row-column-click.ts 80.00% 0 Missing and 1 partial :warning:
...ckages/s2-core/src/interaction/event-controller.ts 50.00% 0 Missing and 1 partial :warning:
...ackages/s2-core/src/interaction/range-selection.ts 0.00% 0 Missing and 1 partial :warning:
...ages/s2-core/src/interaction/selected-cell-move.ts 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2956 +/- ## ========================================== + Coverage 75.77% 80.73% +4.96% ========================================== Files 257 179 -78 Lines 11994 10432 -1562 Branches 2464 2374 -90 ========================================== - Hits 9088 8422 -666 + Misses 1398 555 -843 + Partials 1508 1455 -53 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lijinke666 commented 3 weeks ago

:tada: This PR is included in version @antv/s2-v2.0.0-next.31 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

lijinke666 commented 3 weeks ago

:tada: This PR is included in version @antv/s2-react-v2.0.0-next.30 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

lijinke666 commented 3 weeks ago

:tada: This PR is included in version @antv/s2-vue-v2.0.0-next.16 :tada:

The release is available on:

Your semantic-release bot :package::rocket: