-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Exported Mermaid graphs as PNG are incredibly small #7521
Comments
One more thing for me to add to my Mermaid tests: exporting to png/svg. I am sorry that I missed this. I totally forgot about this feature. Update: Although I doubt it's Mermaid, b/c exporting to PNG is not done with Mermaid. |
Svg Images have a viewBox attribute, we can use it to define width and height of the image we will be saving as png. <svg viewBox="-8 -8 258.080078125 446" ... so setting png dimensions to 258 * 446 we get following png image Should I open A PR with these changes ? |
Yes, I think that would make sense. Please do. P.S.: If the origin point is negative, doesn't it mean we should add those values ABS(x, y) numbers to x' and y'. e.g. for this image 266x454 |
I think the size of image would remain same regardless of origin changes so we need not add it to width and height. |
I don't know when it started. Maybe, a couple of weeks ago. Joplin on Ubuntu started making Mermaid renders very small in size if I export them as PNG.
Environment
Joplin version: 2.9.17
Platform: Ubuntu 22.04
Steps to reproduce
Describe what you expected to happen
Expected to have a bigger image than this.
![mermaid-1671722589364](https://user-images.githubusercontent.com/11888301/209172461-bc4331ee-4cab-4156-b21b-1f76b5ad1f65.png)
The text was updated successfully, but these errors were encountered: