[Feature] 希望Image图元能添加cellType=image时的keepAspectRatio属性
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
What problem does this feature solve?
目前定高定宽的Image图元会改变图片比例。
尝试使用外层定宽高的Group的clip裁切然后里面Image居中垂直对齐的方式会有奇怪的问题(添加display="flex" alignItems="center" justifyContent="center"才会出现,不添加不会出现问题),初次渲染没有图片,调用重新绘制的方法也无法显示,手动调整列宽或者快速上下滚动(应该是页面重新渲染了?)才会渲染出来,如下图。
另外开启clip似乎会把外层的Group的阴影属性穿透到内部的Text图元上。
What does the proposed API look like?
希望Image添加一个类似css中object-fit的属性,或者提供一个使用目前的图元实现类似效果的方法,感激。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Image implementation for cells with cellType=image, then review how fixed width and height currently affect image rendering. Compare the existing Group, clip, flex, alignment, and shadow behavior described in the report. Done should mean a documented API or equivalent behavior that preserves the image aspect ratio without the reported rendering and clipping regressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100