Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
engine.getNodeFactories().registerFactory(new JSCustomNodeFactory() as any);
engine.getNodeFactories().registerFactory(new TSCustomNodeFactory());
// create a diagram model
const model = new DiagramModel();
//####################################################
// now create two nodes of each type, and connect them
const node1 = new JSCustomNodeModel({ color: 'rgb(192,255,0)' });
node1.setPosition(50, 50);
const node2 = new TSCustomNodeModel({ color: 'rgb(0,192,255)' });
node2.setPosition(200, 50);
const link1 = new DefaultLinkModel();
link1.setSourcePort(node1.getPort('out'));
link1.setTargetPort(node2.getPort('in'));
model.addAll(node1, node2, link1);
//####################################################
// install the model into the engine
engine.setModel(model);
document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(, document.querySelector('#application'));
});
createLinkModel(): LinkModel {
const link = super.createLinkModel();
return link || new DefaultLinkModel();
}
}
createLinkModel(): LinkModel {
return new DefaultLinkModel();
}
}
createLinkModel(): LinkModel {
return new DefaultLinkModel();
}
}
createLinkModel(): LinkModel {
return new DefaultLinkModel();
}
}
createLinkModel(): LinkModel {
return new DefaultLinkModel();
}
}
createLinkModel(): LinkModel {
return new DefaultLinkModel();
}
}