-
Hi, where can I find out more information about the RouterKind.MANHATTAN ? I would like to understand better its behaviour and how I can tweak it a little bit. For example I want to define that the start and endpoint should always be aligned to the centre of the element. Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The implementation of the default routers and anchoring is located in Sprotty. Based on the registered edge routes (see the module where they are registered) and the router type of the edge in the GModel, the respective router implementation (e.g. Manhattan router) and anchoring (e.g. Manhattan anchor computer) is selected and applied on the client. Of course, you can bind your own routers and anchor computers on the client. The GLSP client DI container is a set of Sprotty and GLSP DI modules and you can add your own (and even unload existing ones to replace modules). Thus, you can add your own module to your GLSP client container in which you bind your own router, either a new router implementation from scratch or one that extends and customizes an existing one: bind(YourEdgeRouter).toSelf().inSingletonScope();
bind(TYPES.IEdgeRouter).toService(YourEdgeRouter); Your router needs to specify the kind: export class YourEdgeRouter extends AbstractEdgeRouter {
static readonly KIND = 'yourrouter';
...
} Then, in the GModel set the respective router kind to select your router for particular edges. |
Beta Was this translation helpful? Give feedback.
The implementation of the default routers and anchoring is located in Sprotty. Based on the registered edge routes (see the module where they are registered) and the router type of the edge in the GModel, the respective router implementation (e.g. Manhattan router) and anchoring (e.g. Manhattan anchor computer) is selected and applied on the client.
Of course, you can bind your own routers and anchor computers on the client. The GLSP client DI container is a set of Sprotty and GLSP DI modules and you can add your own (and even unload existing ones to replace modules). Thus, you can add your own module to your GLSP client container in which you bind your own router, either a new router imp…