Replies: 1 comment 1 reply
-
在 G6 v5 中,要设置从锚点上拖出连线,可以通过配置节点的 createGraph(
{
data: {
nodes: [
{ id: 'node1', label: 'Node 1' },
{ id: 'node2', label: 'Node 2' }
],
edges: []
},
node: {
style: {
fill: '#f8f8f8',
stroke: '#8b9baf',
lineWidth: 1,
port: true,
ports: [
{ placement: 'top' },
{ placement: 'bottom' },
{ placement: 'left' },
{ placement: 'right' }
],
},
},
edge: {
type: 'cubic-horizontal',
style: {
stroke: '#7e3feb',
lineWidth: 2,
},
},
behaviors: ['drag-canvas', 'drag-element'],
layout: { type: 'grid', cols: 2 },
plugins: [{ type: 'grid-line', size: 30 }],
},
{ width: 600, height: 300 },
(gui, graph) => {
gui.add({ type: 'cubic-horizontal' }, 'type').disable();
},
); 在这个示例中,节点配置了多个锚点( 如果你有更多问题或需要进一步的帮助,请随时告诉我! 🪧 TipsFor further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me. |
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
-
v5的create-edge功能如何设置从锚点上拖出连线
Beta Was this translation helpful? Give feedback.
All reactions