X6 icon indicating copy to clipboard operation
X6 copied to clipboard

连接线为什么会拐这么大一圈?节点间距应该怎么控制呢?

Open cangsnage opened this issue 1 year ago • 6 comments

问题描述

连接线拐的太大了,应该怎么设置节点的间距呢 微信图片_20240305091712

重现链接

暂无

重现步骤

微信图片_20240305091712 设置连接线rounded属性,节点间距只要小店就会出现拐弯的情况。

预期行为

我希望连接线不会因为节点间距太小而导致连接线的问题 Uploading 2.png…

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

cangsnage avatar Mar 05 '24 01:03 cangsnage

👋 @cangsnage

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.

x6-bot[bot] avatar Mar 05 '24 01:03 x6-bot[bot]

router: { name: 'manhattan', args: { padding: 5, }, },

连线路由的padding改小点试试呢 默认是20

XueMeijing avatar Mar 05 '24 03:03 XueMeijing

router: {

name: 'manhattan',

args: {

padding: 5,

},

},

连线路由的padding改小点试试呢 默认是20

不行,现在想着改变节点的间距但是好像没有间距最小的距离的api

cangsnage avatar Mar 05 '24 06:03 cangsnage

我同样遇到了这个问题,一番查阅无果后,我的方案是手动将边的 router 设置为 normal,当然也可以自动设置但是这样会比较复杂,根据自己的业务需求和开发工作量来决定吧。

setRouter('normal')

iwengx avatar Mar 22 '24 09:03 iwengx

间距最小的api 这个咋理解,这样是不是拖动后 两个节点在一起 自己会分开?

flxy1028 avatar Apr 08 '24 03:04 flxy1028

可以通过以下配置自定义回退路由,大部分情况下使用 er 会比默认的 orth 效果要好一些

import { Registry } from '@antv/x6'

router: {
  name: 'manhattan',
  args: {
    fallbackRouter: Registry.Router.presets.er,
  },
},

F-loat avatar Apr 11 '24 03:04 F-loat