Hi there, kudos to the devs for this amazing lib.
I'm wondering how to remove link if it is not connected to any node. Is there any way to modify the link after it is created (when you are finished dragging the link / stop holding the mouse click)?. It seems all the available function related to link gets fired directly when creating a link by dragging the port for the first time.
Any insight is appreciated!!
Hey, maybe the allowLooseLinks props for DiagramWidget may help you ?
<DiagramWidget
css={css'
background-color: #000;
height: 100vh;
'}
diagramEngine={engine}
allowLooseLinks={false}
/>
Oh right, I missed that props. Thankyou very much!
I tried using import { CanvasWidget } from '@projectstorm/react-canvas-core' but this prop is not recognize.
I tried using
import { CanvasWidget } from '@projectstorm/react-canvas-core'but this prop is not recognize.
Have the same issue
I tried using
import { CanvasWidget } from '@projectstorm/react-canvas-core'but this prop is not recognize.
Try this, when creating an engine
const state = engine.getStateMachine().getCurrentState();
if (state instanceof DefaultDiagramState) {
state.dragNewLink.config.allowLooseLinks = false;
}
Most helpful comment
Try this, when creating an engine
const state = engine.getStateMachine().getCurrentState();
if (state instanceof DefaultDiagramState) {
state.dragNewLink.config.allowLooseLinks = false;
}