joethei / obsidian-plantuml

Generate PlantUML Diagrams inside Obsidian.md
MIT License
368 stars 18 forks source link

Zoom not working for PNG, large diagrams are cut #28

Open dev-zero opened 2 years ago

dev-zero commented 2 years ago

Is your feature request related to a problem? Please describe. I have a larger diagram for which when rendering with plantuml the font is rather small. I get the magnification arrow, but when I click nothing happens. Furthermore, depending on the diagram type, it is cut at the bottom (this is rendered with @startmindmap, with @startwbs the cutoff does not happen):

Screenshot 2022-05-09 at 09 00 04

Describe the solution you'd like Full diagram with Zoom buttons and/or the possibility to define the final size of the image.

Describe alternatives you've considered plantuml-svg gives only the large diagram, which is definitely much more readable.

joethei commented 2 years ago

Zooming is not a feature of this plugin, that can be done with other plugins like the Obsidian Image Toolkit plugin (obsidian://show-plugin?id=obsidian-image-toolkit | https://github.com/sissilab/obsidian-image-toolkit).

Not sure why its cutting of large diagrams though when using the PNG renderer, will investigate in a few days.

boylesean commented 2 years ago

Assuming that you are using a local plantuml.jar, you might try tweaking the plantuml configuration. There is a limitation in plantuml on the size of the image. Change "Java Path" to java -DPLANTUML_LIMIT_SIZE=16384.

You may need to give it more memory by appending -Xmx1024m http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html

==UPDATE: This actually doesn't seem to work.== @startuml version @enduml

Still shows as PLANTUML_LIMIT_SIZE: 4092

BTW, the Image Toolkit only works for PNG, not SVG.

boylesean commented 1 year ago

What does work sometimes is to create a shell script which calls java and sets the proper parameters (as above). It would be nice to be able to set PLANTUML_SIZE_LIMIT and memory within the configuration page, rather than having to hack it externally.

imadjamil commented 7 months ago

Zooming is not a feature of this plugin, that can be done with other plugins like the Obsidian Image Toolkit plugin (obsidian://show-plugin?id=obsidian-image-toolkit | https://github.com/sissilab/obsidian-image-toolkit).

Not sure why its cutting of large diagrams though when using the PNG renderer, will investigate in a few days.

This is exactly what I was searching for, thanks!