-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
when using mermaid + reveal.js, diagrams do not render in correct size after the 4th slide #1824
Comments
Found the cause. lazy loading of slide contents causes the dimensions to be off for mermaid, therefore improperly calculate them for slides not fully loaded yet. I've written some code to invoke init and render the diagrams only if the content has been fully loaded: https://gist.github.com/koutbo6/f78bca0e2e2789c9892df77eafa1b70f Solution works great for all diagrams .. except flow charts. The flowchart diagrams render well, except for the node labels. Text dimension seems way off. Here is how I see the following diagram: graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
Messing a bit with directives, I can get some of the labels to appear: %%{init: { 'logLevel': 'debug', 'theme': 'neutral' } }%%
graph TD;
%%{config: { 'fontFamily': 'Menlo', 'fontSize': 18, 'fontWeight': 400} }%%
A-->B;
A-->C;
B-->D;
C-->D;
Would appreciate any guidance Thanks! |
I'm experiencing the sane thing as @malmarz The "boxes" are smaller than the text so they can't be used. |
I still have this issue and could not fix it with the gist provided above. I am using pandoc markdown to create the revealjs presentation with this command: test-mermaid.md resulting in the following index.html which does not render correctly: Any help is appreciated! :) |
The trick mentioned above does not work anymore for mermaid 10.x As I need to use new diagrams like mindmap, I am somewhat lost here.. |
I bisect some releases and found that this is broken since 9.2.0 (which introduces mindmaps :( ) - latest version which works with the workaround is 9.1.7 |
I know have something like this:
which works better, but not well.. |
Describe the bug
Managed to integrate mermaid into reveal4.10 and it renders perfectly.
That is, until you hit the 4th slide.
For some reason, slides 1,2,3 render the diagrams and set their size correctly.
Starting from slide 4 and beyond, the diagrams render, but they get unusually small sizes that prohibit their display.
To Reproduce
Attached index.html in this gist reproduces the problem:
https://gist.github.com/koutbo6/44777c84fff9fe559bdf984aa065fe4d
Expected behavior
diagrams should render properly on slides 4 and beyond when using mermaid with revealjs
Desktop (please complete the following information):
Additional context
Here is the devtools console output. I probed the diagrams on slide 2 (working) and slide 4 (rendering but invisible due to small size)
Thank you
The text was updated successfully, but these errors were encountered: