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

两个节点使用manhattan斜着连线时,segments工具不显示 #4516

Closed
fu827707013 opened this issue Nov 30, 2024 · 2 comments
Closed

Comments

@fu827707013
Copy link

Describe the bug

两个节点使用连线时,segments工具不显示,水平连线才显示,但我router使用的是manhattan,是自动变成正交线段组成,都是水平和垂直线段

  1. 初始化画布:
const graph = new Graph({
    container: document.getElementById('graph-container')!,
    grid: true,
    connecting: {
        router: 'orth',
        createEdge() {
            return new Shape.Edge({
                attrs: {
                    line: {
                        stroke: '#A2B1C3',
                        strokeWidth: 2,
                        targetMarker: {
                            name: 'block',
                            width: 12,
                            height: 8,
                        },
                    },
                },
                zIndex: 0,
            })
        },
    },
})

2.控制工具显示隐藏

graph.on('edge:mouseenter', ({cell}) => {
    cell.addTools([
        {
            name: 'segments',
            args: {
                attrs: {
                    fill: '#444',
                },
            }
        },
    ], 'segments')
    // cell.addTools(['segments'], 'onhover')
})

Your Example Website or App

Steps to Reproduce the Bug or Issue

  1. 拖拽两个节点到画布
  2. 放置非水平或垂直位置
  3. 连接两个节点,连接线自动变成两段正交线段
  4. 鼠标移动到线段上,segments工具未显示
    1732981556055
    在实际业务中如果 流程节点比较多,路线就会交叉,需要拖动线段做些微调

Expected behavior

  1. 拖拽两个节点到画布
  2. 放置非水平或垂直位置
  3. 连接两个节点,连接线自动变成两段正交线段
  4. 鼠标移动到线段上,segments工具正常显示

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Microsoft Edge
  • Version: 版本 131.0.2903.70 (正式版本) (64 位)
  • "@antv/x6": "^2.18.1",

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Nov 30, 2024

👋 @fu827707013

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.

@fu827707013
Copy link
Author

可能不够智能,目前用其他办法解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant