mermaid-js / mermaid Public
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
scaling/rendering issues on 4K displays #651
Comments
|
I was just testing out mermaid today for the first time, when I came upon this problem. I performed some quick tests and here's some more info: Testing monitors:
Testing browsers:
Diagram types:
So to sum up, this seems to affect flowcharts in a 4K monitor scaled to 2x with a chrome browser. |
|
Some more comments:
So I'd assume this affects most users seeing a flowchart from a laptop with a 4K monitor, using chrome. If the above hold true, it may make sense to prioritize fixing this one. PS: On the other hand, this could actually be a chrome bug. |
|
Another thing from my side : If you use a 1080p resolution and set the scaling to 200% it also happens. So it might be rather related to the DPI scaling than the resolution... |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Commenting again so that the issue doesn't get automatically closed. Given the rising popularity of hidpi monitors, I think it makes sense to resolve this. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you are still interested in it, and it is still relevant, you can comment or remove the label to revive it. |
|
I could have a look into this as I have a 4K monitor. |
|
I got same issue... |
|
Same issue here. kindly share your solution when found. |
|
mermaid on high resolution such as 4k or mobile screens even using edge on android is giving a shape much larger than text. I don't think that there is a solution for this issue so far unless a specific formatting is done based on the device and resolution |
|
In my case, text OVERFLOWS box: Live editor v8.8.4 on Google Chrome 87.0.4280.66 (Build oficial) (64 bits) As you can see, all text of diagram is overflowing his respective boxes. To solve this, I thing you should multiply the or using Firefox. In standards monitors, like fullhd, If you need more information, contact me. I will be happy to help Big regards !! |
|
My desktop scale is set to 150% and everything is similarly scaled incorrectly. This issue is currently blocking me from using mermaid :-( Comparing the generated SVG with and without monitor scaling, I believe it is a little more complex than just scaling the rects by devicePixelRatio. For example, the height of |
|
I run into the same issue where rects are mis-scaled (both width and height) by a factor of |
|
My diagrams seems overflowing exactly like in @Pronink screenshots on some displays. |
|
Hi, I'm wild guessing here. Has anybody tried adding the preserveAspectRatio or adding CSS media queries for each pixel density to the resulting svg yet? I have tried to workaround this issue by disabling htmlLabels, then transforming the svg text nodes to paths and it sorta works. Unfortunately, the end result isn't as pretty as it looks in the live-editor |



My laptop has a ~4K display which requires me to work with a 200% scaled desktop. I noticed that mermaid renders the SVGs differently on normal and 200% scale.
Environment: Surface Book 2, Windows 10, Chrome 65
This is the chart I am rendering: https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFJcbkFBQSgoU1RBUlQpKSAtLT4gQns8Y2VudGVyPjxoMj5UZXN0PC9oMj48YnI-c29tZXRoaW5nIHNtYWxsPC9jZW50ZXI-fVxuQiAtLVRSVUUtLT4gQyhBREQpXG5CIC0tRkFMU0UtLT4gRihBREQpXG5cbmNsYXNzRGVmIG9yYW5nZSBmaWxsOiNmOTYsc3Ryb2tlOiMwMDAsc3Ryb2tlLXdpZHRoOjJweDtcbmNsYXNzIEMsRixHLEggb3JhbmdlXG5jbGFzc0RlZiBncmF5IGZpbGw6I0NDQyxzdHJva2U6IzAwMCxzdHJva2Utd2lkdGg6MnB4O1xuY2xhc3MgQSxBQUEgZ3JheVxuY2xhc3NEZWYgYWN0aW9ucyBmaWxsOiM5ZWQzZjcsc3Ryb2tlOiMwMDAsc3Ryb2tlLXdpZHRoOjJweDtcbmNsYXNzIEIsRSxEIGFjdGlvbnNcbiIsIm1lcm1haWQiOnsidGhlbWUiOiJkYXJrIn19
100% Scale

200% Scale

Is it possible to let mermaid render the same on all scales?
The text was updated successfully, but these errors were encountered: