Skip to content

Commit 6d33d93

Browse files
committed
run prettier
1 parent d54eed9 commit 6d33d93

27 files changed

+110
-33
lines changed

.esbuild/server.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const rebuildAll = async () => {
3636
console.time(timeLabel);
3737
await Promise.all(
3838
contexts.map(async ({ config, context }) => {
39-
const buildVariant = `Rebuild ${buildNumber} Time (${Object.keys(config.entryPoints!)[0]} ${config.format})`;
39+
const buildVariant = `Rebuild ${buildNumber} Time (${Object.keys(config.entryPoints!)[0]} ${
40+
config.format
41+
})`;
4042
console.time(buildVariant);
4143
await context.rebuild();
4244
console.timeEnd(buildVariant);

cypress/integration/rendering/iconShape.spec.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ looks.forEach((look) => {
1414
directions.forEach((direction) => {
1515
forms.forEach((form) => {
1616
labelPos.forEach((pos) => {
17-
describe(`Test iconShape in ${form ? `${form} form,` : ''} ${look} look and dir ${direction} with label position ${pos ? pos : 'not defined'}`, () => {
17+
describe(`Test iconShape in ${
18+
form ? `${form} form,` : ''
19+
} ${look} look and dir ${direction} with label position ${
20+
pos ? pos : 'not defined'
21+
}`, () => {
1822
it(`without label`, () => {
1923
let flowchartCode = `flowchart ${direction}\n`;
2024
flowchartCode += ` nA --> nAA@{ icon: 'fa:bell'`;

cypress/integration/rendering/imageShape.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const labelPos = [undefined, 't', 'b'] as const;
1212
looks.forEach((look) => {
1313
directions.forEach((direction) => {
1414
labelPos.forEach((pos) => {
15-
describe(`Test imageShape in ${look} look and dir ${direction} with label position ${pos ? pos : 'not defined'}`, () => {
15+
describe(`Test imageShape in ${look} look and dir ${direction} with label position ${
16+
pos ? pos : 'not defined'
17+
}`, () => {
1618
it(`without label`, () => {
1719
let flowchartCode = `flowchart ${direction}\n`;
1820
flowchartCode += ` nA --> A@{ img: 'https://cdn.pixabay.com/photo/2020/02/22/18/49/paper-4871356_1280.jpg', w: '100', h: '100' }\n`;

packages/mermaid/src/diagrams/architecture/svgDraw.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ export const drawGroups = async function (groupsEl: D3Element, cy: cytoscape.Cor
212212
if (data.icon) {
213213
const bkgElem = groupLabelContainer.append('g');
214214
bkgElem.html(
215-
`<g>${await getIconSVG(data.icon, { height: groupIconSize, width: groupIconSize, fallbackPrefix: architectureIcons.prefix })}</g>`
215+
`<g>${await getIconSVG(data.icon, {
216+
height: groupIconSize,
217+
width: groupIconSize,
218+
fallbackPrefix: architectureIcons.prefix,
219+
})}</g>`
216220
);
217221
bkgElem.attr(
218222
'transform',
@@ -297,11 +301,19 @@ export const drawServices = async function (
297301
// throw new Error(`Invalid SVG Icon name: "${service.icon}"`);
298302
// }
299303
bkgElem.html(
300-
`<g>${await getIconSVG(service.icon, { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}</g>`
304+
`<g>${await getIconSVG(service.icon, {
305+
height: iconSize,
306+
width: iconSize,
307+
fallbackPrefix: architectureIcons.prefix,
308+
})}</g>`
301309
);
302310
} else if (service.iconText) {
303311
bkgElem.html(
304-
`<g>${await getIconSVG('blank', { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}</g>`
312+
`<g>${await getIconSVG('blank', {
313+
height: iconSize,
314+
width: iconSize,
315+
fallbackPrefix: architectureIcons.prefix,
316+
})}</g>`
305317
);
306318
const textElemContainer = bkgElem.append('g');
307319
const fo = textElemContainer

packages/mermaid/src/diagrams/block/layout.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh
105105
for (const child of block.children) {
106106
if (child.size) {
107107
log.debug(
108-
`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`
108+
`abc95 Setting size of children of ${block.id} id=${
109+
child.id
110+
} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`
109111
);
110112
child.size.width =
111113
maxWidth * (child.widthInColumns ?? 1) + padding * ((child.widthInColumns ?? 1) - 1);

packages/mermaid/src/diagrams/git/gitGraphRenderer.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ const drawCommitBullet = (
276276
cross
277277
.attr(
278278
'd',
279-
`M ${commitPosition.x - 5},${commitPosition.y - 5}L${commitPosition.x + 5},${commitPosition.y + 5}M${commitPosition.x - 5},${commitPosition.y + 5}L${commitPosition.x + 5},${commitPosition.y - 5}`
279+
`M ${commitPosition.x - 5},${commitPosition.y - 5}L${commitPosition.x + 5},${
280+
commitPosition.y + 5
281+
}M${commitPosition.x - 5},${commitPosition.y + 5}L${commitPosition.x + 5},${
282+
commitPosition.y - 5
283+
}`
280284
)
281285
.attr('class', `commit ${typeClass} ${commit.id} commit${branchIndex % THEME_COLOR_LIMIT}`);
282286
}
@@ -652,21 +656,27 @@ const drawArrow = (
652656

653657
colorClassNum = branchPos.get(commitA.branch)?.index;
654658

655-
lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc} ${lineX} ${p1.y + offset} L ${lineX} ${p2.y - radius} ${arc2} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`;
659+
lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc} ${lineX} ${
660+
p1.y + offset
661+
} L ${lineX} ${p2.y - radius} ${arc2} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`;
656662
}
657663
} else if (dir === 'BT') {
658664
if (p1.x < p2.x) {
659665
// Source commit is on branch position left of destination commit
660666
// so render arrow rightward with colour of destination branch
661667

662-
lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius} ${p1.y} ${arc} ${lineX} ${p1.y - offset} L ${lineX} ${p2.y + radius} ${arc2} ${lineX + offset} ${p2.y} L ${p2.x} ${p2.y}`;
668+
lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius} ${p1.y} ${arc} ${lineX} ${
669+
p1.y - offset
670+
} L ${lineX} ${p2.y + radius} ${arc2} ${lineX + offset} ${p2.y} L ${p2.x} ${p2.y}`;
663671
} else {
664672
// Source commit is on branch position right of destination commit
665673
// so render arrow leftward with colour of source branch
666674

667675
colorClassNum = branchPos.get(commitA.branch)?.index;
668676

669-
lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc2} ${lineX} ${p1.y - offset} L ${lineX} ${p2.y + radius} ${arc} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`;
677+
lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc2} ${lineX} ${
678+
p1.y - offset
679+
} L ${lineX} ${p2.y + radius} ${arc} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`;
670680
}
671681
} else {
672682
if (p1.y < p2.y) {

packages/mermaid/src/diagrams/state/dataFetcher.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ export const dataFetcher = (
258258
newNode.isGroup = true;
259259
newNode.dir = getDir(parsedItem);
260260
newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP;
261-
newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ''}`;
261+
newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${
262+
altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ''
263+
}`;
262264
}
263265

264266
// This is what will be added to the graph

packages/mermaid/src/rendering-util/rendering-elements/clusters.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ const roundedWithTitle = async (parent, node) => {
264264

265265
label.attr(
266266
'transform',
267-
`translate(${node.x - bbox.width / 2}, ${y + 1 - (evaluate(siteConfig.flowchart.htmlLabels) ? 0 : 3)})`
267+
`translate(${node.x - bbox.width / 2}, ${
268+
y + 1 - (evaluate(siteConfig.flowchart.htmlLabels) ? 0 : 3)
269+
})`
268270
);
269271

270272
const rectBox = rect.node().getBBox();

packages/mermaid/src/rendering-util/rendering-elements/shapes/curlyBraceLeft.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ export const curlyBraceLeft = async (parent: SVGAElement, node: Node) => {
9595

9696
label.attr(
9797
'transform',
98-
`translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
98+
`translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${
99+
-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))
100+
})`
99101
);
100102

101103
updateNodeBounds(node, curlyBraceLeftShape);

packages/mermaid/src/rendering-util/rendering-elements/shapes/curlyBraceRight.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ export const curlyBraceRight = async (parent: SVGAElement, node: Node) => {
9595

9696
label.attr(
9797
'transform',
98-
`translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
98+
`translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${
99+
-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))
100+
})`
99101
);
100102

101103
updateNodeBounds(node, curlyBraceRightShape);

packages/mermaid/src/rendering-util/rendering-elements/shapes/curlyBraces.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export const curlyBraces = async (parent: SVGAElement, node: Node) => {
114114

115115
label.attr(
116116
'transform',
117-
`translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
117+
`translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${
118+
-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))
119+
})`
118120
);
119121

120122
updateNodeBounds(node, curlyBracesShape);

packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export const cylinder = async (parent: SVGAElement, node: Node) => {
9090

9191
label.attr(
9292
'transform',
93-
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + (node.padding ?? 0) / 1.5 - (bbox.y - (bbox.top ?? 0))})`
93+
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${
94+
-(bbox.height / 2) + (node.padding ?? 0) / 1.5 - (bbox.y - (bbox.top ?? 0))
95+
})`
9496
);
9597

9698
node.intersect = function (point) {

packages/mermaid/src/rendering-util/rendering-elements/shapes/dividedRect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export const dividedRectangle = async (parent: SVGAElement, node: Node) => {
5252

5353
label.attr(
5454
'transform',
55-
`translate(${x + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${y + rectOffset + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`
55+
`translate(${x + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${
56+
y + rectOffset + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))
57+
})`
5658
);
5759

5860
updateNodeBounds(node, polygon);

packages/mermaid/src/rendering-util/rendering-elements/shapes/flippedTriangle.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export const flippedTriangle = async (parent: SVGAElement, node: Node): Promise<
5151

5252
label.attr(
5353
'transform',
54-
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-h / 2 + (node.padding ?? 0) / 2 + (bbox.y - (bbox.top ?? 0))})`
54+
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${
55+
-h / 2 + (node.padding ?? 0) / 2 + (bbox.y - (bbox.top ?? 0))
56+
})`
5557
);
5658

5759
node.intersect = function (point) {

packages/mermaid/src/rendering-util/rendering-elements/shapes/labelRect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const labelRect = async (parent: SVGElement, node: Node) => {
2929
shapeSvg.attr('class', 'label edgeLabel');
3030
label.attr(
3131
'transform',
32-
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
32+
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${
33+
-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))
34+
})`
3335
);
3436

3537
// if (node.props) {

packages/mermaid/src/rendering-util/rendering-elements/shapes/linedCylinder.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export const linedCylinder = async (parent: SVGAElement, node: Node) => {
101101

102102
label.attr(
103103
'transform',
104-
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + ry - (bbox.y - (bbox.top ?? 0))})`
104+
`translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${
105+
-(bbox.height / 2) + ry - (bbox.y - (bbox.top ?? 0))
106+
})`
105107
);
106108

107109
node.intersect = function (point) {

packages/mermaid/src/rendering-util/rendering-elements/shapes/linedWaveEdgedRect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export const linedWaveEdgedRect = async (parent: SVGAElement, node: Node) => {
6565
waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);
6666
label.attr(
6767
'transform',
68-
`translate(${-w / 2 + (node.padding ?? 0) + ((w / 2) * 0.1) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
68+
`translate(${
69+
-w / 2 + (node.padding ?? 0) + ((w / 2) * 0.1) / 2 - (bbox.x - (bbox.left ?? 0))
70+
},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
6971
);
7072

7173
updateNodeBounds(node, waveEdgeRect);

packages/mermaid/src/rendering-util/rendering-elements/shapes/multiRect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export const multiRect = async (parent: SVGAElement, node: Node) => {
6767

6868
label.attr(
6969
'transform',
70-
`translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - (bbox.y - (bbox.top ?? 0))})`
70+
`translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${
71+
-(bbox.height / 2) + rectOffset - (bbox.y - (bbox.top ?? 0))
72+
})`
7173
);
7274

7375
updateNodeBounds(node, multiRect);

packages/mermaid/src/rendering-util/rendering-elements/shapes/multiWaveEdgedRectangle.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export const multiWaveEdgedRectangle = async (parent: SVGAElement, node: Node) =
8989

9090
label.attr(
9191
'transform',
92-
`translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
92+
`translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${
93+
-(bbox.height / 2) + rectOffset - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))
94+
})`
9395
);
9496

9597
updateNodeBounds(node, shape);

packages/mermaid/src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const rect_left_inv_arrow = async (
5454

5555
label.attr(
5656
'transform',
57-
`translate(${-notch / 2 - bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
57+
`translate(${-notch / 2 - bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${
58+
-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))
59+
})`
5860
);
5961
updateNodeBounds(node, polygon);
6062

packages/mermaid/src/rendering-util/rendering-elements/shapes/shadedProcess.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export const shadedProcess = async (parent: SVGAElement, node: Node) => {
5252

5353
label.attr(
5454
'transform',
55-
`translate(${-w / 2 + 4 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
55+
`translate(${-w / 2 + 4 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${
56+
-h / 2 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))
57+
})`
5658
);
5759

5860
updateNodeBounds(node, rect);

packages/mermaid/src/rendering-util/rendering-elements/shapes/slopedRect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export const slopedRect = async (parent: SVGAElement, node: Node) => {
4747
polygon.attr('transform', `translate(0, ${h / 4})`);
4848
label.attr(
4949
'transform',
50-
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h / 4 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`
50+
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${
51+
-h / 4 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))
52+
})`
5153
);
5254

5355
updateNodeBounds(node, polygon);

packages/mermaid/src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export const taggedWaveEdgedRectangle = async (parent: SVGAElement, node: Node)
8787
waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);
8888
label.attr(
8989
'transform',
90-
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`
90+
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${
91+
-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))
92+
})`
9193
);
9294

9395
updateNodeBounds(node, waveEdgeRect);

packages/mermaid/src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ export const tiltedCylinder = async (parent: SVGAElement, node: Node) => {
102102

103103
label.attr(
104104
'transform',
105-
`translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
105+
`translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${
106+
-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))
107+
})`
106108
);
107109

108110
updateNodeBounds(node, cylinder);

packages/mermaid/src/rendering-util/rendering-elements/shapes/triangle.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ export const triangle = async (parent: SVGAElement, node: Node): Promise<SVGAEle
5454

5555
label.attr(
5656
'transform',
57-
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${h / 2 - (bbox.height + (node.padding ?? 0) / (useHtmlLabels ? 2 : 1) - (bbox.y - (bbox.top ?? 0)))})`
57+
`translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${
58+
h / 2 -
59+
(bbox.height + (node.padding ?? 0) / (useHtmlLabels ? 2 : 1) - (bbox.y - (bbox.top ?? 0)))
60+
})`
5861
);
5962

6063
node.intersect = function (point) {

packages/mermaid/src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export const waveEdgedRectangle = async (parent: SVGAElement, node: Node) => {
6565
waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);
6666
label.attr(
6767
'transform',
68-
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude - (bbox.y - (bbox.top ?? 0))})`
68+
`translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${
69+
-h / 2 + (node.padding ?? 0) - waveAmplitude - (bbox.y - (bbox.top ?? 0))
70+
})`
6971
);
7072

7173
updateNodeBounds(node, waveEdgeRect);

packages/mermaid/src/rendering-util/rendering-elements/shapes/windowPane.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const windowPane = async (parent: SVGAElement, node: Node) => {
2525
{ x: x + w, y: y - rectOffset },
2626
];
2727

28-
const path = `M${x - rectOffset},${y - rectOffset} L${x + w},${y - rectOffset} L${x + w},${y + h} L${x - rectOffset},${y + h} L${x - rectOffset},${y - rectOffset}
28+
const path = `M${x - rectOffset},${y - rectOffset} L${x + w},${y - rectOffset} L${x + w},${
29+
y + h
30+
} L${x - rectOffset},${y + h} L${x - rectOffset},${y - rectOffset}
2931
M${x - rectOffset},${y} L${x + w},${y}
3032
M${x},${y - rectOffset} L${x},${y + h}`;
3133

@@ -51,7 +53,9 @@ export const windowPane = async (parent: SVGAElement, node: Node) => {
5153

5254
label.attr(
5355
'transform',
54-
`translate(${-(bbox.width / 2) + rectOffset / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset / 2 - (bbox.y - (bbox.top ?? 0))})`
56+
`translate(${-(bbox.width / 2) + rectOffset / 2 - (bbox.x - (bbox.left ?? 0))}, ${
57+
-(bbox.height / 2) + rectOffset / 2 - (bbox.y - (bbox.top ?? 0))
58+
})`
5559
);
5660

5761
updateNodeBounds(node, windowPane);

0 commit comments

Comments
 (0)