mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 09:20:03 +02:00
Replace string concat with string templates
This commit is contained in:
@@ -69,17 +69,13 @@ const rect = (parent, node) => {
|
|||||||
label.attr(
|
label.attr(
|
||||||
'transform',
|
'transform',
|
||||||
// This puts the labal on top of the box instead of inside it
|
// This puts the labal on top of the box instead of inside it
|
||||||
'translate(' +
|
`translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
|
||||||
(node.x - bbox.width / 2) +
|
|
||||||
', ' +
|
|
||||||
(node.y - node.height / 2 + subGraphTitleTopMargin) +
|
|
||||||
')'
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
label.attr(
|
label.attr(
|
||||||
'transform',
|
'transform',
|
||||||
// This puts the labal on top of the box instead of inside it
|
// This puts the labal on top of the box instead of inside it
|
||||||
'translate(' + node.x + ', ' + (node.y - node.height / 2 + subGraphTitleTopMargin) + ')'
|
`translate(${node.x}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Center the label
|
// Center the label
|
||||||
|
Reference in New Issue
Block a user