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: add steps support #144

Merged
merged 3 commits into from
Jun 29, 2022
Merged

Conversation

yykoypj
Copy link
Contributor

@yykoypj yykoypj commented May 31, 2022

ref: ant-design/ant-design#35802

还有些待解决的问题,写了个例子,帮忙看看我的解题思路对不对。

  1. 不支持strokeLinecap
    因为strokeLinecap为square时,stroke最小是个边长为strokeWidth的正方形块(会在原有stroke前后加上宽度为strokeWidth/2的长方形),导致覆盖前后的其他内容。round同理

  2. steps不为0时,前后step块的相邻边不是平行的
    现在每条step块的前后边的延长线都是经过圆心的,但是当前stroke解决方案下我找不到能做出下图这种平行效果的方法(还有bordarRadius)。不知道是不是只能上canvas,但是如果上canvas应该算是重构了,api可能也得变

image

@vercel
Copy link

vercel bot commented May 31, 2022

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

Name Status Preview Updated
progress ✅ Ready (Inspect) Visit Preview Jun 16, 2022 at 9:27AM (UTC)

@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #144 (20c3142) into master (1ed17d7) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   99.15%   99.25%   +0.10%     
==========================================
  Files           4        4              
  Lines         118      135      +17     
  Branches       35       41       +6     
==========================================
+ Hits          117      134      +17     
  Misses          1        1              
Impacted Files Coverage Δ
src/Circle.tsx 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@afc163
Copy link
Member

afc163 commented Jun 7, 2022

strokeLinecap 可以支持为 butt

@afc163
Copy link
Member

afc163 commented Jun 7, 2022

不用平行,类似 donut 效果应该就够用了。

@afc163
Copy link
Member

afc163 commented Jun 7, 2022

覆盖率不达标。

@yykoypj
Copy link
Contributor Author

yykoypj commented Jun 7, 2022

codecov的覆盖率跟本地的不太一样,我在master上跑的覆盖率也跟codecov对不上。。不知道看哪个值

@yykoypj
Copy link
Contributor Author

yykoypj commented Jun 16, 2022

gapDegree的默认值提到了外面,getCircleStyle里面的默认值就不用了。改过来了

@afc163 afc163 merged commit 80ea029 into react-component:master Jun 29, 2022
@afc163
Copy link
Member

afc163 commented Jun 29, 2022

https://github.com/react-component/progress/releases/tag/v3.4.0

可以给 antd 继续发 PR,补演示和文档。

@yykoypj yykoypj deleted the feat-steps-support branch June 29, 2022 12:22
@yykoypj
Copy link
Contributor Author

yykoypj commented Jun 29, 2022

好的👌🏻

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.

2 participants