1295 Handling labels of clusters

This commit is contained in:
Knut Sveidqvist
2020-03-11 20:25:55 +01:00
parent 7bd5529bb7
commit da048cbc7b
4 changed files with 29 additions and 15 deletions

View File

@@ -33,10 +33,17 @@ const rect = (parent, node) => {
.attr('height', node.height + padding);
const adj = (node.width + node.padding - bbox.width) / 2;
logger.info('bbox', bbox.width, node.x, node.width);
// Center the label
label.attr('transform', 'translate(' + adj + ', ' + (node.y - node.height / 2) + ')');
// label.attr('transform', 'translate(' + 70 + ', ' + -node.height / 2 + ')');
// label.attr('transform', 'translate(' + adj + ', ' + (node.y - node.height / 2) + ')');
label.attr(
'transform',
'translate(' +
(node.x - bbox.width / 2) +
', ' +
(node.y - node.height / 2 - node.padding / 3 + 3) +
')'
);
const rectBox = rect.node().getBBox();
node.width = rectBox.width;