Mermaid diagrams extends page limit

Hello,

I am using Mermaid to add diagrams to my site.

As shown in the picture, the diagram is draw out of the page limits.

So, I was wondering how to circumvent this. Right now, I have two ideas (but don’t now how to implement them, I don’t even know if it possible).
1-) Remove the sidebar for only that page.
2- Force Mermaid to draw the diagram in the page area.

I am using the Gateway them.

Regards,

Camps

It largely depends on the DOM-structure and CSS that the theme uses, but normally you’d just ensure that the container width for the diagram cannot exceed it’s parent element’s width. Just display: block; width: 100%; max-width: 100%. If I recall correctly, Mermaid uses the directed acyclical graph, which should force it to draw the diagram within the constraints of the container.

1 Like