Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mermaid diagrams are rendering very small in the slide #218

Open
codyburleson opened this issue Apr 1, 2023 · 8 comments
Open

Mermaid diagrams are rendering very small in the slide #218

codyburleson opened this issue Apr 1, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@codyburleson
Copy link

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 codyburleson added the bug Something isn't working label Apr 1, 2023
@natsen
Copy link

natsen commented Apr 5, 2023

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

@majidaldo
Copy link

yup

@AlexLeoTW
Copy link

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!
```
---

@majidaldo
Copy link

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

@razmser
Copy link

razmser commented Jun 8, 2023

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

@GeoffreyMetais
Copy link

GeoffreyMetais commented Jun 9, 2023

Great thanks for the workaround!

I've put it in my custom css 👍

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

@murdos
Copy link

murdos commented Dec 21, 2023

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

@sjgknight
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants