antvis/G6

darge布局当指定线的类型为quadratic时,darge布局配置中如果设置controlPoints:true,会出现部分线和点连接不上 #4429

songxiaoyu321 posted onGitHub

Describe the bug

如下,点0和点3之间点线没有正确连接 Uploading 截屏2023-04-13 16.01.57.png…

Your Example Website or App

https://g6.antv.antgroup.com/examples/net/dagreFlow/#lrDagre

Steps to Reproduce the Bug or Issue

import G6 from '@antv/g6'; const data = { nodes: [ { id: '0', label: '0', }, { id: '1', label: '1', }, { id: '2', label: '2', }, { id: '3', label: '3', }, ], edges: [ { source: '0', target: '1', }, { source: '0', target: '2', }, { source: '0', target: '3', }, { source: '2', target: '3', }, ], };

const container = document.getElementById('container'); const width = container.scrollWidth; const height = container.scrollHeight || 500; const graph = new G6.Graph({ container: 'container', width, height, fitView: true, modes: { default: ['drag-canvas', 'drag-node'], }, layout: { type: 'dagre', rankdir: 'LR', align: 'DL', nodesepFunc: () => 1, ranksepFunc: () => 1, controlPoints:true }, defaultNode: { size: [30, 20], type: 'rect', style: { lineWidth: 2, stroke: '#5B8FF9', fill: '#C6E5FF', }, }, defaultEdge: { type:'quadratic', size: 1, color: '#e2e2e2', style: { endArrow: { path: 'M 0,0 L 8,4 L 8,-4 Z', fill: '#e2e2e2', }, }, }, }); graph.data(data); graph.render();

if (typeof window !== 'undefined') window.onresize = () => { if (!graph || graph.get('destroyed')) return; if (!container || !container.scrollWidth || !container.scrollHeight) return; graph.changeSize(container.scrollWidth, container.scrollHeight); };

Expected behavior

正常

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response


Fund this Issue

$0.00
Funded

Pull requests