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 star node #5410
feat: add star node #5410
Conversation
hustcc
commented
Feb 1, 2024
•
edited
edited
- fixed [v5] 增加 node 类型 star 组件 #5400
- star node
- test cases
/** | ||
* 内半径 | ||
*/ | ||
innerR: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
节点之间的配置项差异太大了,后面不太方便统一处理,base-node
节点尺寸使用 width 和 height 表示吧,Circle 的 r 和这里的outerR
就是取 min(width, height) / 2
, innerR 应该可以按外半径比例计算出一个默认值,也可以用户指定
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
innerR 可以做成可选,默认就是正常的五角星,看图中第一个,是一个变种的五角星,看是否需要保留。
后面峰值统一对共同属性就行处理吧。
], | ||
// anchor | ||
anchorOptions: [ | ||
{ position: 'left', r: 2, stroke: 'black', lineWidth: 1, zIndex: 2 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zIndex 应该配置成默认属性吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我后面一个分支单独对样式进行优化吧,这个分支先简单一些,也给开发者一个参考。
0a3961c
to
66ae7db
Compare