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(combo): add rect combo element #5496

Merged
merged 8 commits into from
Mar 7, 2024
Merged

feat(combo): add rect combo element #5496

merged 8 commits into from
Mar 7, 2024

Conversation

yvonneyx
Copy link
Contributor

@yvonneyx yvonneyx commented Mar 5, 2024

  • 新增 Rect Combo 元素
  • Combo 支持通过设置 collapsedOrigin 来控制收起时的原点位置,取值为 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | [number, number]。例如,如果设置成 'top-left',则朝元素的左上角收起
  • 扩展 Combo 属性 collapsedMarkerType
image

Copy link
Contributor

@Aarebecca Aarebecca left a comment

Choose a reason for hiding this comment

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

可以参考 #5494 简化一下 combo 的类型定义

Copy link
Contributor

@Aarebecca Aarebecca left a comment

Choose a reason for hiding this comment

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

rebase 一下最新代码呢

* <en/> The origin of combo when collapsed
*/
collapsedOrigin?: string | [number, number];
collapsedOrigin?:
Copy link
Contributor

Choose a reason for hiding this comment

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

我看好几个地方都用到了类似的 position(比如 LoopEdgePosition, RelativePosition),可否统一组织一下呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

统一到 Placement

export type CardinalPlacement = 'left' | 'right' | 'top' | 'bottom';

export type CornerPlacement =
  | 'left-top'
  | 'left-bottom'
  | 'right-top'
  | 'right-bottom'
  | 'top-left'
  | 'top-right'
  | 'bottom-left'
  | 'bottom-right';

export type Placement = CardinalPlacement | CornerPlacement | 'center';

packages/g6/src/utils/combo.ts Show resolved Hide resolved
| 'right'
| 'right-top'
| 'right-bottom';
export type LoopEdgePosition = CardinalPlacement | CornerPlacement;
Copy link
Contributor

Choose a reason for hiding this comment

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

这里 Position 都改为 Placement 吧~

@yvonneyx yvonneyx force-pushed the feat/rect-combo branch 2 times, most recently from a56c90f to 8e05997 Compare March 7, 2024 03:23
@Aarebecca Aarebecca mentioned this pull request Mar 7, 2024
3 tasks
@yvonneyx yvonneyx merged commit 8633679 into v5 Mar 7, 2024
5 checks passed
@yvonneyx yvonneyx deleted the feat/rect-combo branch March 7, 2024 06:17
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