Feature/Multiline sequence message alignment #1315
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📑 Summary
Please first take a look at PR #1314 , it contains a fix for multiline messages in sequence diagrams.
This PR is an additional improvement which let the user set the alignment of these multiline messages.
It introduces a new configuration option
messageAlign
which takes 3 possible values:left
: align text to the leftcenter
(default): text is align in the middle, current alignmentright
: align text to the right📏 Design Decisions
To left/right align the text, I change the style attribute
text-anchor
and I move the center alignment line according to the maximum width of text lines.📷 Example
Here is a basic HTTP request/response diagram where text alignment is useful:
The first PR #1314 is IMHO easier (no additional parameter, no change in flow or logic). This one require a new parameter and a double iteration is mandatory to calculate max text width.
📋 Tasks
Make sure you
develop
branch