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

x6 createNode 节点时 transform能否支持自定义 #3718

Closed
YGodFather opened this issue Jun 30, 2023 · 2 comments
Closed

x6 createNode 节点时 transform能否支持自定义 #3718

YGodFather opened this issue Jun 30, 2023 · 2 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@YGodFather
Copy link

问题描述

createNode({
      shape: "rect",
      x: 100,
      y: 100,
      width: 60,
      height: 40,
      angle: 90,
      label: "text",
      attrs: {
      },
      ports: [
    ]
    })

添加 x ,y angle 属性后 g 标签 现在可以自动添加transform = 'translate(x ,y ), rotate(angle, ...)',暂时无法自定义修改g 标签上的 tranform 属性。

当前我想变换整个组的时候,只能通过给g下面的图形添每个都添加一个相同的transform来达到相同效果
示例:
image

image

重现链接

重现步骤

预期行为

想在createNode 时候,能添加一个自定义的transform 属性,这样整个group 组我只需要添加一次我需要的变换了。

image

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox ...]
  • X6 版本: [2.11.1 ...]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@NewByVector
Copy link
Contributor

不支持在节点最外层 g 上直接修改 transform,因为内部在实现节点尺寸、位置修改就是通过修改最外层 transform 属性来实现的,如果你手动修改,很可能出现冲突。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Jul 3, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Jul 10, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

2 participants