How to use the @projectstorm/react-diagrams-routing.PathFindingLinkFactory function in @projectstorm/react-diagrams-routing

To help you get started, we’ve selected a few @projectstorm/react-diagrams-routing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projectstorm / react-diagrams / packages / react-diagrams / index.ts View on Github external
export default (options: CanvasEngineOptions = {}): DiagramEngine => {
	const engine = new DiagramEngine(options);

	// register model factories
	engine.getLayerFactories().registerFactory(new NodeLayerFactory());
	engine.getLayerFactories().registerFactory(new LinkLayerFactory());
	engine.getLayerFactories().registerFactory(new SelectionBoxLayerFactory());

	engine.getLabelFactories().registerFactory(new DefaultLabelFactory());
	engine.getNodeFactories().registerFactory(new DefaultNodeFactory()); // i cant figure out why
	engine.getLinkFactories().registerFactory(new DefaultLinkFactory());
	engine.getLinkFactories().registerFactory(new PathFindingLinkFactory());
	engine.getPortFactories().registerFactory(new DefaultPortFactory());

	// register the default interaction behaviours
	engine.getStateMachine().pushState(new DefaultDiagramState());
	return engine;
};

@projectstorm/react-diagrams-routing

This package adds dagre integration for laying out nodes and links

MIT
Latest version published 10 months ago

Package Health Score

69 / 100
Full package analysis

Popular @projectstorm/react-diagrams-routing functions