-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Generated svg is different than live editor, text is cut off #1485
Comments
Thanks for reporting this. They method to get the width of the label is to render it and get the bounding box. After that the width if the box is calculated based in that initial width. If the font for some reason differs between the initial rendering and the final svg the text can be cut. I will try to replicate this error and investigate. This might be related to issue #1540. |
I have found the root cause for this and will fix it in 8.6.1. Meanwhile you can circumvent the issue by providing a container id for the render function as per below:
and insert a element in which the rendering can happen in the html:
The reason for this manipulation is that the DOM is used for getting the size of the text labels ... and we should make sure that the right font settings is provided where these calculations take place. |
…_settings #1485 Setting proper font settings in the root css
Describe the bug
The svg generated via
mermaid.render
is different than the one in the live editor.For the following code:
The live editor outputs this:
While the
mermaid.render()
callback outputs this:To Reproduce
Here is basically my code to generate the svg, nothing fancy:
I'm using mermaid 8.5.1
I tried fiddling with fonts and sizes but it doesn't seem to change anything.
The text was updated successfully, but these errors were encountered: