mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
#755 lint fixes
This commit is contained in:
parent
f6377e6125
commit
c6efddee87
@ -217,14 +217,14 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
|
|||||||
const breaklines = msg.message.split(/<br\/?>/ig)
|
const breaklines = msg.message.split(/<br\/?>/ig)
|
||||||
for (const breakline of breaklines) {
|
for (const breakline of breaklines) {
|
||||||
textElem = g.append('text') // text label for the x axis
|
textElem = g.append('text') // text label for the x axis
|
||||||
.attr('x', txtCenter)
|
.attr('x', txtCenter)
|
||||||
.attr('y', verticalPos - 7 + counterBreaklines * breaklineOffset)
|
.attr('y', verticalPos - 7 + counterBreaklines * breaklineOffset)
|
||||||
.style('text-anchor', 'middle')
|
.style('text-anchor', 'middle')
|
||||||
.attr('class', 'messageText')
|
.attr('class', 'messageText')
|
||||||
.text(breakline.trim())
|
.text(breakline.trim())
|
||||||
counterBreaklines++
|
counterBreaklines++
|
||||||
}
|
}
|
||||||
const offsetLineCounter = counterBreaklines-1
|
const offsetLineCounter = counterBreaklines - 1
|
||||||
const totalOffset = offsetLineCounter * breaklineOffset
|
const totalOffset = offsetLineCounter * breaklineOffset
|
||||||
|
|
||||||
let textWidth = (textElem._groups || textElem)[0][0].getBBox().width
|
let textWidth = (textElem._groups || textElem)[0][0].getBBox().width
|
||||||
@ -239,7 +239,7 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
|
|||||||
(verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset))
|
(verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset))
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.bumpVerticalPos(30+totalOffset)
|
bounds.bumpVerticalPos(30 + totalOffset)
|
||||||
const dx = Math.max(textWidth / 2, 100)
|
const dx = Math.max(textWidth / 2, 100)
|
||||||
bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset)
|
bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset)
|
||||||
} else {
|
} else {
|
||||||
@ -248,7 +248,7 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
|
|||||||
line.attr('y1', verticalPos)
|
line.attr('y1', verticalPos)
|
||||||
line.attr('x2', stopx)
|
line.attr('x2', stopx)
|
||||||
line.attr('y2', verticalPos)
|
line.attr('y2', verticalPos)
|
||||||
bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos()) + totalOffset
|
bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos() + totalOffset)
|
||||||
}
|
}
|
||||||
// Make an SVG Container
|
// Make an SVG Container
|
||||||
// Draw the line
|
// Draw the line
|
||||||
|
Loading…
x
Reference in New Issue
Block a user