mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge pull request #5017 from ad1992/bug/4946-fix-svg-order-sequence-participant
fix: render the participants in same order as they are created
This commit is contained in:
commit
5fdbf5d891
@ -164,6 +164,13 @@
|
|||||||
end
|
end
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
sequenceDiagram
|
||||||
|
actor Alice
|
||||||
|
actor John
|
||||||
|
Alice-xJohn: Hello John, how are you?
|
||||||
|
John--xAlice: Great!
|
||||||
|
</pre>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mermaid from './mermaid.esm.mjs';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
|
@ -829,6 +829,11 @@ export const draw = function (_text: string, id: string, _version: string, diagO
|
|||||||
bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
|
bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.debug('createdActors', createdActors);
|
||||||
|
log.debug('destroyedActors', destroyedActors);
|
||||||
|
|
||||||
|
drawActors(diagram, actors, actorKeys, false);
|
||||||
|
|
||||||
// Draw the messages/signals
|
// Draw the messages/signals
|
||||||
let sequenceIndex = 1;
|
let sequenceIndex = 1;
|
||||||
let sequenceIndexStep = 1;
|
let sequenceIndexStep = 1;
|
||||||
@ -1028,14 +1033,12 @@ export const draw = function (_text: string, id: string, _version: string, diagO
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
log.debug('createdActors', createdActors);
|
|
||||||
log.debug('destroyedActors', destroyedActors);
|
|
||||||
|
|
||||||
drawActors(diagram, actors, actorKeys, false);
|
|
||||||
messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStartY, diagObj));
|
messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStartY, diagObj));
|
||||||
|
|
||||||
if (conf.mirrorActors) {
|
if (conf.mirrorActors) {
|
||||||
drawActors(diagram, actors, actorKeys, true);
|
drawActors(diagram, actors, actorKeys, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
backgrounds.forEach((e) => svgDraw.drawBackgroundRect(diagram, e));
|
backgrounds.forEach((e) => svgDraw.drawBackgroundRect(diagram, e));
|
||||||
fixLifeLineHeights(diagram, actors, actorKeys, conf);
|
fixLifeLineHeights(diagram, actors, actorKeys, conf);
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ const drawActorTypeParticipant = function (elem, actor, conf, isFooter) {
|
|||||||
const center = actor.x + actor.width / 2;
|
const center = actor.x + actor.width / 2;
|
||||||
const centerY = actorY + 5;
|
const centerY = actorY + 5;
|
||||||
|
|
||||||
const boxpluslineGroup = elem.append('g').lower();
|
const boxpluslineGroup = elem.append('g');
|
||||||
var g = boxpluslineGroup;
|
var g = boxpluslineGroup;
|
||||||
|
|
||||||
if (!isFooter) {
|
if (!isFooter) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user