UmlSequenceDiagramModel
23 Sep 20254 minutes to read
Interface for a class UmlSequenceDiagram
Properties
fragments UmlSequenceFragmentModel[]
Defines the interaction fragments in the UML sequence diagram.
Fragments are used to group messages under specific control structures such as loops, alternatives, or options.
fragments: [
{
id: 'frag1',
type: 'Optional',
conditions: [
{
content: 'Interactions',
messageIds: ['MSG1', 'MSG2', 'MSG3']
}
]
}
]messages UmlSequenceMessageModel[]
Defines the list of messages exchanged between participants in the UML sequence diagram.
Messages represent interactions such as method calls or responses between lifelines.
messages: [
{
id: 'MSG1',
content: 'User sends request',
fromParticipantID: 'User',
toParticipantID: 'Server'
},
{
id: 'MSG2',
content: 'Processing',
fromParticipantID: 'Server',
toParticipantID: 'Server'
},
{
id: 'MSG3',
content: 'Server sends response',
fromParticipantID: 'Server',
toParticipantID: 'User'
}
]participants UmlSequenceParticipantModel[]
Defines the list of participants involved in the UML sequence diagram.
Each participant represents a lifeline, such as an actor or an object, that sends or receives messages.
participants: [
{
id: 'User',
content: 'User',
width: 100,
height: 50,
showDestructionMarker: true,
isActor: true,
activationBoxes: [
{ id: 'act1', startMessageID: 'MSG1', endMessageID: 'MSG3' }
]
},
{
id: 'Server',
content: 'Server',
width: 100,
height: 50,
showDestructionMarker: true,
isActor: false,
activationBoxes: [
{ id: 'act2', startMessageID: 'MSG1', endMessageID: 'MSG3' }
]
}
]spaceBetweenParticipants number
Defines the horizontal spacing between each participant (lifeline) in the UML sequence diagram.
This spacing determines how far apart the participant boxes are placed,
which affects the overall layout and readability of the diagram.
const model: UmlSequenceDiagramModel = {
spaceBetweenParticipants: 120,
participants: [ ... ],
messages: [ ... ],
fragments: [ ... ]
};- A higher value increases the distance between participants.
- A lower value makes participants appear closer together.