sijs-block-diagram-renderer
This module provides an example of how to implement a custom render module. In this case the module adds a new diagram type, and 2 new shapes. The Block Diagram Renderer module gets it's data for rendering the different Shapes from the Block Diagram Manipulation module.
Getting started
To use the Block Diagram Render Module the user needs to use the 'registerModule()' function provided by the Diagram Renderer. By registering the module at the Diagram Renderer the user will be able to use all the features provided by the Block Diagram module. After registering the module the Diagram Renderer will make sure all the correct methods from the Block Diagram Renderer are called.
Registering the render module
newRenderer.registerModule(new BlockDiagramRenderAPI());
Module features
The Block Diagram Render Module uses the same setup as the Diagram Renderer module for rendering shapes. Meaning it creates a SVG element based on the dataObject provided by the manipulation module. The shapes that this module is capable of rendering are 'Block' and 'BlockWithText' shape. This module provides no rendering methods for custom lines.
Developing
This module depends on the DiagramManipulator, DiagramRenderer and BlockDiagramManipulation module.
- Install the dependencies.
npm i
- Run the tests.
npm run test
- Build the module.
npm run build
- Publish the module.