Browse Source

fix: edges can only be connected to ports

master
smallstonesk 4 years ago
parent
commit
654a0addef
  1. 10
      packages/core/src/mods/flowChart/createFlowChart.ts

10
packages/core/src/mods/flowChart/createFlowChart.ts

@ -51,12 +51,20 @@ const createFlowChart = (container: HTMLDivElement, miniMapContainer: HTMLDivEle
snap: true,
dangling: true,
highlight: true,
anchor: 'center',
connectionPoint: 'anchor',
router: {
name: 'manhattan'
},
validateConnection({sourceView, targetView}) {
validateConnection({sourceView, targetView, sourceMagnet, targetMagnet}) {
if(!sourceMagnet) {
return false;
} else if(!targetMagnet) {
return false;
} else {
return sourceView !== targetView;
}
}
},
// https://x6.antv.vision/zh/docs/tutorial/basic/background
background: {

Loading…
Cancel
Save