Replies: 2 comments 1 reply
-
我感觉这里有点问题,连线肯定需要连接桩,所以是先展示连接桩才能连线。官方demo https://x6.antv.antgroup.com/examples/showcase/practices/#flowchart 中是鼠标移入节点展示连接桩。 // 控制连接桩显示/隐藏
const showPorts = (ports: NodeListOf<SVGElement>, show: boolean) => {
for (let i = 0, len = ports.length; i < len; i += 1) {
ports[i].style.visibility = show ? 'visible' : 'hidden'
}
}
graph.on('node:mouseenter', () => {
const container = document.getElementById('graph-container')!
const ports = container.querySelectorAll(
'.x6-port-body',
) as NodeListOf<SVGElement>
showPorts(ports, true)
})
graph.on('node:mouseleave', () => {
const container = document.getElementById('graph-container')!
const ports = container.querySelectorAll(
'.x6-port-body',
) as NodeListOf<SVGElement>
showPorts(ports, false)
}) |
Beta Was this translation helpful? Give feedback.
0 replies
-
同问,没有连线中事件监听,想实现从连接桩拖出线时可连接的桩高亮,不能连接的桩半透明。目前没有找到解决方案 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我看文档里面没有给连接过程中的监听事件,我都没法手动展示
Beta Was this translation helpful? Give feedback.
All reactions