-
Notifications
You must be signed in to change notification settings - Fork 117
width / height options do not alter the size of the generated PNG #3
Comments
widget and height are actually web page size instead of the generated image size. For example: The cli is just a thin wrapper around the mermaid library. I guess in a real browser, you cannot change the image size either. You can look at the code of the CLI, fewer than 100 LoC. Please share your opinions and suggestions. |
I sent a PR that fixes the scaling |
Please read the comments here: #4 (comment)
Feel free to create an issue for the mermaid project. |
Thanks for your investigations ! Have you considered the This may be a solution, configurable from the CLI as a flag |
Hi @tylerlong It would be nice to have a way of increasing the resolution of pngs. @Lucas-C 's fix seems to allow for better resolution sequence and flowchart graphs, but the default gantt diagram doesn't look right either at 1000 nor 2000 width. Thank you both! |
@Lucas-C I will make a PR shortly allowing mermaid configuration, so you could try Unfortunately this is not available for sequence diagrams. In the meantime I was thinking about solving on the cli by inserting @Lucas-C fix only in the case of png, or looking at a different rendering option like using https://github.com/exupero/saveSvgAsPng |
this solves mermaid.cli issue mermaidjs#12 and allows to use a workaround for issue mermaidjs#3
@Lucas-C The new version should allow you to use a custom css file where you could set your |
This does not work on version 0.5.1. Passing a Custom CSS does not work for SVGs, so one can't even render to SVG and then scale up with a different program without giving up the ability to specify, e.g. custom fonts. |
Reconfirmed the above on mmdc version |
Okay, I figured it out. Pass this to
…and this to
…and finally |
@matthew-piziak Could you elaborate what you meant by EDIT: I was using an older version of |
I just had to create the docker run -v $(pwd):/work \
minlag/mermaid-cli:latest \
-i "/work/mermaid.mmd" \
--scale 4 \
-o "/work/out.png" \
-b transparent \
--cssFile "/work/cssfile" The only downside is that this seems to create a lot of excess horizontal border area around the image, so I just copy-paste it into something like GIMP and "crop to content". Not sure if there's a trivial way to automate this via imagemagick or some other CLI tool. Could likely (not 100% sure) achieve this via |
Note: Simply using convert input.png -trim output.png |
Hi.
I'm not sure if this is a bug or feature request,
but currently it is not posible to generate a bigger PNG using the
-w
/-H
flagsThe text was updated successfully, but these errors were encountered: