antvis / S2

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

fix: 修复在局部复制和导出场景时, 格式化函数获取不到单元格信息 close #2866 #2871

Closed lijinke666 closed 3 weeks ago

lijinke666 commented 3 weeks ago

👀 PR includes

🐛 Bugfix

📝 Description

复制/导出链路. formatter 调用时只传入了一个参数, 修改为根据根据 rowIndex/colIndex 获取 viewMeta, 然后传入, 和表格渲染的逻辑保持一致

meta: [{ 
    field: 'number',
-   formatter: (value) => {} 
+   formatter: (value, data, viewMeta) => {} 
}]

image

🖼️ 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) Aug 22, 2024 3:40am
github-actions[bot] commented 3 weeks ago

Size Change: +34 B (+0.01%)

Total Size: 329 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 229 kB +34 B (+0.01%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `./packages/s2-core/dist/style.min.css` | 388 B | | `./packages/s2-react/dist/index.min.js` | 70.8 kB | | `./packages/s2-react/dist/style.min.css` | 3.88 kB | | `./packages/s2-vue/dist/index.min.js` | 22.9 kB | | `./packages/s2-vue/dist/style.min.css` | 1.97 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 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.75%. Comparing base (ecdc9c8) to head (de1cc8a). Report is 423 commits behind head on next.

Files Patch % Lines
...core/src/utils/export/copy/pivot-data-cell-copy.ts 66.66% 0 Missing and 1 partial :warning:
...ckages/s2-core/src/utils/export/copy/table-copy.ts 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2871 +/- ## ========================================== + Coverage 75.77% 80.75% +4.98% ========================================== Files 257 180 -77 Lines 11994 10404 -1590 Branches 2464 2359 -105 ========================================== - Hits 9088 8402 -686 + Misses 1398 555 -843 + Partials 1508 1447 -61 ```

: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.27 :tada:

The release is available on:

Your semantic-release bot :package::rocket: