Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-singers-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: Ensure block diagram hexagon blocks respect column spanning syntax
12 changes: 12 additions & 0 deletions cypress/integration/rendering/block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,18 @@ describe('Block diagram', () => {
block:group2:3
l m n o p q r
end
`,
{}
);
});

it('BL34: hexagon shape block should span correctly', () => {
imgSnapshotTest(
`block-beta
columns 3
A1{{"Opening tag"}} space A3{{"Closing tag"}}
B1["<tagname>"] B2["content"] B3["</tagname>"]
C{{"Element"}}:3
`,
{}
);
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/dagre-wrapper/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ const hexagon = async (parent, node) => {
);

const f = 4;
const h = bbox.height + node.padding;
const h = node.positioned ? node.height : bbox.height + node.padding;
Comment thread
ashishjain0512 marked this conversation as resolved.
const m = h / f;
const w = bbox.width + 2 * m + node.padding;
const w = node.positioned ? node.width : bbox.width + 2 * m + node.padding;
const points = [
{ x: m, y: 0 },
{ x: w - m, y: 0 },
Expand Down
Loading