diff --git a/docs/sequenceDiagram.md b/docs/sequenceDiagram.md index 286009d4d..aac1817fe 100644 --- a/docs/sequenceDiagram.md +++ b/docs/sequenceDiagram.md @@ -364,8 +364,8 @@ It is possible to get a sequence number attached to each arrow in a sequence dia ```html + mermaid.initialize({ sequence: { showSequenceNumbers: true }, }); + ``` It can also be be turned on via the diagram code as in the diagram: diff --git a/src/diagrams/sequence/sequenceDb.js b/src/diagrams/sequence/sequenceDb.js index df20c5751..6fe9c67f9 100644 --- a/src/diagrams/sequence/sequenceDb.js +++ b/src/diagrams/sequence/sequenceDb.js @@ -156,8 +156,8 @@ export const parseMessage = function (str) { _str.match(/^[:]?wrap:/) !== null ? true : _str.match(/^[:]?nowrap:/) !== null - ? false - : undefined, + ? false + : undefined, }; log.debug('parseMessage:', message); return message; diff --git a/src/diagrams/sequence/sequenceRenderer.js b/src/diagrams/sequence/sequenceRenderer.js index 0040a18e4..3d1000eb2 100644 --- a/src/diagrams/sequence/sequenceRenderer.js +++ b/src/diagrams/sequence/sequenceRenderer.js @@ -367,21 +367,21 @@ const drawMessage = function (diagram, msgModel, lineStarty) { .attr( 'd', 'M ' + - startx + - ',' + - lineStarty + - ' C ' + - (startx + 60) + - ',' + - (lineStarty - 10) + - ' ' + - (startx + 60) + - ',' + - (lineStarty + 30) + - ' ' + - startx + - ',' + - (lineStarty + 20) + startx + + ',' + + lineStarty + + ' C ' + + (startx + 60) + + ',' + + (lineStarty - 10) + + ' ' + + (startx + 60) + + ',' + + (lineStarty + 30) + + ' ' + + startx + + ',' + + (lineStarty + 20) ); } } else { @@ -887,13 +887,13 @@ export const draw = function (text, id) { diagram.attr( 'viewBox', box.startx - - conf.diagramMarginX + - ' -' + - (conf.diagramMarginY + extraVertForTitle) + - ' ' + - width + - ' ' + - (height + extraVertForTitle) + conf.diagramMarginX + + ' -' + + (conf.diagramMarginY + extraVertForTitle) + + ' ' + + width + + ' ' + + (height + extraVertForTitle) ); addSVGAccessibilityFields(parser.yy, diagram, id); @@ -1095,17 +1095,17 @@ const buildNoteModel = function (msg, actors) { noteModel.width = shouldWrap ? Math.max(conf.width, textDimensions.width) : Math.max( - actors[msg.from].width / 2 + actors[msg.to].width / 2, - textDimensions.width + 2 * conf.noteMargin - ); + actors[msg.from].width / 2 + actors[msg.to].width / 2, + textDimensions.width + 2 * conf.noteMargin + ); noteModel.startx = startx + (actors[msg.from].width + conf.actorMargin) / 2; } else if (msg.placement === parser.yy.PLACEMENT.LEFTOF) { noteModel.width = shouldWrap ? Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin) : Math.max( - actors[msg.from].width / 2 + actors[msg.to].width / 2, - textDimensions.width + 2 * conf.noteMargin - ); + actors[msg.from].width / 2 + actors[msg.to].width / 2, + textDimensions.width + 2 * conf.noteMargin + ); noteModel.startx = startx - noteModel.width + (actors[msg.from].width - conf.actorMargin) / 2; } else if (msg.to === msg.from) { textDimensions = utils.calculateTextDimensions( @@ -1235,27 +1235,27 @@ const calculateLoopBounds = function (messages, actors) { loops[current.id] = current; break; case parser.yy.LINETYPE.ACTIVE_START: - { - const actorRect = actors[msg.from ? msg.from.actor : msg.to.actor]; - const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length; - const x = - actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2; - const toAdd = { - startx: x, - stopx: x + conf.activationWidth, - actor: msg.from.actor, - enabled: true, - }; - bounds.activations.push(toAdd); - } + { + const actorRect = actors[msg.from ? msg.from.actor : msg.to.actor]; + const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length; + const x = + actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2; + const toAdd = { + startx: x, + stopx: x + conf.activationWidth, + actor: msg.from.actor, + enabled: true, + }; + bounds.activations.push(toAdd); + } break; case parser.yy.LINETYPE.ACTIVE_END: - { - const lastActorActivationIdx = bounds.activations - .map((a) => a.actor) - .lastIndexOf(msg.from.actor); - delete bounds.activations.splice(lastActorActivationIdx, 1)[0]; - } + { + const lastActorActivationIdx = bounds.activations + .map((a) => a.actor) + .lastIndexOf(msg.from.actor); + delete bounds.activations.splice(lastActorActivationIdx, 1)[0]; + } break; } const isNote = msg.placement !== undefined;