Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Mermaid diagrams extends page limit

Started by I. Camps 6 years ago · 1 replies · 1709 views
6 years ago

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.

screenshot|690x275

Regards,

Camps

6 years ago

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

Suggested topics

Topic Participants Replies Views Activity
General · by Andy Miller, 1 week ago
0 133 1 week ago
General · by lynbor, 1 month ago
3 451 2 weeks ago
General · by lynbor, 3 weeks ago
7 584 2 weeks ago
General · by Harry, 2 weeks ago
0 172 2 weeks ago
General · by Old Man Umby, 1 month ago
2 314 4 weeks ago