Replace string concat with string templates

This commit is contained in:
Matheus B
2023-11-20 21:06:38 -03:00
parent fc3018e977
commit d61bfde167

View File

@@ -69,17 +69,13 @@ const rect = (parent, node) => {
label.attr(
'transform',
// This puts the labal on top of the box instead of inside it
'translate(' +
(node.x - bbox.width / 2) +
', ' +
(node.y - node.height / 2 + subGraphTitleTopMargin) +
')'
`translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
);
} else {
label.attr(
'transform',
// 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