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

path解析弧 Uncaught Error: Invalid path segment type "N" #3920

Closed
festalstar opened this issue Sep 20, 2023 · 5 comments
Closed

path解析弧 Uncaught Error: Invalid path segment type "N" #3920

festalstar opened this issue Sep 20, 2023 · 5 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@festalstar
Copy link

festalstar commented Sep 20, 2023

问题描述

创建path节点,解析path: 'M704.24,79.95 A 5.10 5.10 0 0 1 704.24 90.15'报错,解析path: 'M704.24,79.95 A 5.10 5.10 0 0 1 704.24 90.14'不报错。

image

重现链接

https://x6.antv.antgroup.com/zh/examples/node/native-node/#path

重现步骤

import { Graph } from '@antv/x6'

const graph = new Graph({
container: document.getElementById('container'),
grid: true,
})

graph.addNode({
shape: 'path',
x: 40,
y: 40,
width: 100,
height: 80,
path: 'M704.24,79.95 A 5.10 5.10 0 0 1 704.24 90.15',
attrs: {
body: {
fill: '#efdbff',
stroke: '#9254de',
},
},
})

官方url路径下,执行后报错,控制台提示:Uncaught Error: Invalid path segment type "N"。
将 path属性值的改为:'M704.24,79.95 A 5.10 5.10 0 0 1 704.24 90.14', 执行无错误。

预期行为

path: 'M704.24,79.95 A 5.10 5.10 0 0 1 704.24 90.15' 无报错。

平台

OS: [Windows]
Browser: [e.g]
Version: [e.g. 116.0.1938.69 (正式版本) (64 位)]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 20, 2023

Potential duplicates:

@x6-bot x6-bot bot added the potential-duplicate This issue or pull request may duplicated with others. label Sep 20, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 20, 2023

Potential duplicates:

@NewByVector
Copy link
Contributor

X6 中 path 对 A 支持不太好,可以使用下面方式规避:

const d = new Path()
  .moveTo(704.24, 79.95)
  .arcTo(5.10, 5.10, 0, 0, 1, 704.24, 90.15)
  .close()
  .serialize();

@NewByVector NewByVector added type: discussion 讨论 Usage questions, guidance, and other discussions and removed potential-duplicate This issue or pull request may duplicated with others. labels Sep 20, 2023
@festalstar
Copy link
Author

X6 中 path 对 A 支持不太好,可以使用下面方式规避:

const d = new Path()
  .moveTo(704.24, 79.95)
  .arcTo(5.10, 5.10, 0, 0, 1, 704.24, 90.15)
  .close()
  .serialize();

这种方式可以,谢谢。

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 26, 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 Sep 26, 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