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" #3897

Closed
festalstar opened this issue Sep 8, 2023 · 2 comments
Closed

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

festalstar opened this issue Sep 8, 2023 · 2 comments

Comments

@festalstar
Copy link

Describe the bug

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,
label: 'path',
// 使用 path 属性指定路径的 pathData,相当于指定路径的 refD 属性
// https://x6.antv.vision/zh/docs/api/registry/attr#refdresetoffset
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', 执行无错误。

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

见bug描述。

x6版本 2.11.1。

调试发现,在x6-geometry包下 src/path/normalize.ts。 a2c函数中 Math.asin值小于-1导致返回NAN。

Expected behavior

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

Screenshots or Videos

No response

Platform

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

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 8, 2023

👋 @festalstar

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@festalstar festalstar closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 19, 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 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant