边上右键打开菜单后如何知道 distance 值? #3815
-
https://x6.antv.vision/en/examples/edge/tool#context-menu 如示例可以在边上右键,打开一个菜单。但只知道 x, y 的画布值。如何知道 distance 值? 我希望知道这个 distance 值后,在此处手动创建一个标签。就像双击的创建的效果一样:https://x6.antv.vision/en/examples/node/tool#editable |
Beta Was this translation helpful? Give feedback.
Answered by
NewByVector
Aug 7, 2023
Replies: 1 comment 1 reply
-
可以使用以下 API 获取在连线上距离 (x、y)最近的一个点距离起点的 distance。 const view = graph.findViewByCell(edge) as EdgeView
const distance = view.getClosestPointLength({ x, y }) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hylerrix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以使用以下 API 获取在连线上距离 (x、y)最近的一个点距离起点的 distance。