Skip to content

Commit f8cdd05

Browse files
committed
fix: prevent mermaid LR diagrams from being squished
Set `flowchart.useMaxWidth: false` so LR (left-to-right) flowcharts render at their natural width instead of being compressed to fit the container. A scrollable wrapper is added so wide diagrams remain accessible without overflowing the layout. Closes #6697
1 parent 3720aaf commit f8cdd05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/src/plugins/layout/mermaid/mermaid.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const DEFAULT_CONFIG: MermaidConfig = {
2222
flowchart: {
2323
htmlLabels: true,
2424
curve: "linear",
25+
useMaxWidth: false,
2526
},
2627
sequence: {
2728
diagramMarginX: 50,
@@ -88,7 +89,11 @@ const Mermaid: React.FC<Props> = ({ diagram }) => {
8889
return null;
8990
}
9091

91-
return <div dangerouslySetInnerHTML={{ __html: svg }} />;
92+
return (
93+
<div style={{ overflowX: "auto" }}>
94+
<div dangerouslySetInnerHTML={{ __html: svg }} />
95+
</div>
96+
);
9297
};
9398

9499
export default Mermaid;

0 commit comments

Comments
 (0)