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 star node #5410

Merged
merged 6 commits into from Feb 3, 2024
Merged

feat: add star node #5410

merged 6 commits into from Feb 3, 2024

Conversation

hustcc
Copy link
Member

@hustcc hustcc commented Feb 1, 2024

image

@hustcc hustcc changed the base branch from v5 to v5-temp February 1, 2024 13:34
@hustcc hustcc changed the title feat: add star node WIP feat: add star node Feb 1, 2024
@hustcc hustcc changed the title WIP feat: add star node feat: add star node Feb 2, 2024
packages/g6/src/utils/element.ts Outdated Show resolved Hide resolved
packages/g6/__tests__/unit/utils/padding.spec.ts Outdated Show resolved Hide resolved
/**
* 内半径
*/
innerR: number;
Copy link
Contributor

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 应该可以按外半径比例计算出一个默认值,也可以用户指定

Copy link
Member Author

@hustcc hustcc Feb 2, 2024

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 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zIndex 应该配置成默认属性吧

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我后面一个分支单独对样式进行优化吧,这个分支先简单一些,也给开发者一个参考。

@hustcc hustcc merged commit e6f4623 into v5-temp Feb 3, 2024
4 checks passed
@hustcc hustcc deleted the feat-star-node branch February 3, 2024 01:38
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.

None yet

3 participants