mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-14 17:54:13 +01:00
#1295 Removing invalid title for concurrency clusters
This commit is contained in:
@@ -159,14 +159,6 @@ const divider = (parent, node) => {
|
|||||||
// add the rect
|
// add the rect
|
||||||
const rect = shapeSvg.insert('rect', ':first-child');
|
const rect = shapeSvg.insert('rect', ':first-child');
|
||||||
|
|
||||||
// Create the label and insert it after the rect
|
|
||||||
const label = shapeSvg.insert('g').attr('class', 'cluster-label');
|
|
||||||
|
|
||||||
const text = label.node().appendChild(createLabel(node.labelText, node.labelStyle));
|
|
||||||
|
|
||||||
// Get the size of the label
|
|
||||||
const bbox = text.getBBox();
|
|
||||||
|
|
||||||
const padding = 0 * node.padding;
|
const padding = 0 * node.padding;
|
||||||
const halfPadding = padding / 2;
|
const halfPadding = padding / 2;
|
||||||
|
|
||||||
@@ -174,25 +166,9 @@ const divider = (parent, node) => {
|
|||||||
rect
|
rect
|
||||||
.attr('class', 'divider')
|
.attr('class', 'divider')
|
||||||
.attr('x', node.x - node.width / 2 - halfPadding)
|
.attr('x', node.x - node.width / 2 - halfPadding)
|
||||||
.attr('y', node.y - node.height / 2 - halfPadding)
|
.attr('y', node.y - node.height / 2)
|
||||||
.attr('width', node.width + padding)
|
.attr('width', node.width + padding)
|
||||||
.attr('height', node.height + padding);
|
.attr('height', node.height + padding);
|
||||||
// innerRect
|
|
||||||
// .attr('class', 'inner')
|
|
||||||
// .attr('x', node.x - node.width / 2 - halfPadding)
|
|
||||||
// .attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1)
|
|
||||||
// .attr('width', node.width + padding)
|
|
||||||
// .attr('height', node.height + padding - bbox.height);
|
|
||||||
|
|
||||||
// Center the label
|
|
||||||
label.attr(
|
|
||||||
'transform',
|
|
||||||
'translate(' +
|
|
||||||
(node.x - bbox.width / 2) +
|
|
||||||
', ' +
|
|
||||||
(node.y - node.height / 2 - node.padding / 3 + 3) +
|
|
||||||
')'
|
|
||||||
);
|
|
||||||
|
|
||||||
const rectBox = rect.node().getBBox();
|
const rectBox = rect.node().getBBox();
|
||||||
node.width = rectBox.width;
|
node.width = rectBox.width;
|
||||||
|
|||||||
Reference in New Issue
Block a user