"Composition rules"? #1015
Replies: 3 comments 9 replies
-
Hi @PatrikN-work, A @injectable()
export class MyDiagramConfiguration implements DiagramConfiguration {
// ...
get shapeTypeHints(): ShapeTypeHint[] {
return [
{ elementTypeId: 'A', deletable: true, reparentable: false, repositionable: true, resizable: true },
{ elementTypeId: 'B', deletable: true, reparentable: false, repositionable: true, resizable: true }
];
}
get edgeTypeHints(): EdgeTypeHint[] {
return [
{
elementTypeId: 'X',
deletable: true,
repositionable: true,
routable: true,
sourceElementTypeIds: ['A'],
targetElementTypeIds: ['A']
},
{
elementTypeId: 'Y',
deletable: true,
repositionable: true,
routable: true,
sourceElementTypeIds: ['B'],
targetElementTypeIds: ['B']
}
];
}
} |
Beta Was this translation helpful? Give feedback.
-
I was thinking of this particular issue. is it addressed in GLSP 2.0? |
Beta Was this translation helpful? Give feedback.
-
Sorry, still can't get it to work. I'm probaly missing something simple. I'm extending the tasklist example and my diagram config is as follows. The issue is that I can still create edges betwene both NODEs and NODE_CIRCLES. Edit:
export class TaskListDiagramConfiguration implements DiagramConfiguration {
layoutKind = ServerLayoutKind.MANUAL;
needsClientLayout = true;
animatedUpdate = true;
get typeMapping(): Map> {
return getDefaultMapping();
}
get shapeTypeHints(): ShapeTypeHint[] {
return [
{
elementTypeId: DefaultTypes.NODE,
deletable: true,
reparentable: false,
repositionable: true,
resizable: true
},
{
elementTypeId: DefaultTypes.NODE_CIRCLE,
deletable: true,
reparentable: false,
repositionable: true,
resizable: true
}
];
}
get edgeTypeHints(): EdgeTypeHint[] {
return [
{
elementTypeId: DefaultTypes.EDGE,
deletable: true,
repositionable: false,
routable: false,
dynamic: true,
sourceElementTypeIds: [DefaultTypes.NODE],
targetElementTypeIds: [DefaultTypes.NODE]
}
];
}
}
|
Beta Was this translation helpful? Give feedback.
-
How do I specify which semantic "node" elements can be connected by which "edge" semantic elements?
Eg. how do i specify that nodes of Type A can only be connected by edge of type X but not an edge of type Y while nodes of type B only by edges of type Y?
Beta Was this translation helpful? Give feedback.
All reactions