obsidian-advanced-slides icon indicating copy to clipboard operation
obsidian-advanced-slides copied to clipboard

Mermaid diagrams are rendering very small in the slide

Open codyburleson opened this issue 1 year ago • 8 comments

Describe the bug

This could be my lack of understanding and not a bug, but my mermaid diagrams render tiny on the screen...

image

Samples to Reproduce

Code for my slide:


---

```mermaid
gantt
    dateFormat  YYYY-MM-DD
    title       Vietnam War Story

    section Deadlines
    First draft         : 2023-04-01, 2023-04-30
    Final draft         : 2023-05-01, 2023-05-31
    Final reviews/edit  : 2023-06-01, 2023-06-30
	Book layout         : 2023-07-01, 2023-07-31
	68th Annual Reunion : 2023-08-14, 2023-08-20
```

---

Expected behavior In your documentation, they show rendering larger. I'd like the mermaid diagram to fill the slide.

codyburleson avatar Apr 01 '23 17:04 codyburleson

I can confirm the same issue as well. I observe that the image size is correlated to the amount of text added to the graph nodes and edges.

The issue can be reproduced in obsidian advanced slides plugin using. The same specification renders correctly using the https://github.com/zjffun/reveal.js-mermaid-plugin html example.

 flowchart TD
            A[Start] --> B{Is it?};
            B -- Yes --> C[OK];
            C --> D[Obsidian advanced slides plugin is awesome];
            D --> B;
            B -- No ----> E[End];

while the same diagram renders well in the html example in reveal.js-mermaid-plugin so this issue is likely in obsidian advanced slides plugin

natsen avatar Apr 05 '23 00:04 natsen

yup

majidaldo avatar Apr 12 '23 04:04 majidaldo

same here

Screenshot from 2023-05-04 16-13-02

a max-width was added automatically and this override any custom CSS rules... (the white border on the svg was added for demonstration purpose)

slide used:

---
```mermaid
sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!
```
---

AlexLeoTW avatar May 04 '23 08:05 AlexLeoTW

this should be prioritized. mermaid is a big deal for presentations.

majidaldo avatar May 18 '23 16:05 majidaldo

Same problem. Adding element annotation to stretch a diagram is a workaround that worked for me. <!-- element style="height: 100%;width: 100%;" -->

razmser avatar Jun 08 '23 11:06 razmser

Great thanks for the workaround!

I've put it in my custom css 👍

.mermaid {
  height: 100%;
  width: 100%;
}

GeoffreyMetais avatar Jun 09 '23 11:06 GeoffreyMetais

FYI I applied workaround described here, it would be really nice if the default CSS could include this :-)

murdos avatar Dec 21 '23 16:12 murdos

Is this still an issue for some people/diagrams? (It seems to be for me). I've tried adding css, element annotation, and using mermaid frontmatter useWidth/useMaxWidth, but my diagrams are small, they seem to be taking up width but not height, and the fontSize is small.

sjgknight avatar Jul 17 '24 03:07 sjgknight