marcherdiego / json-visualizer

Tiny plugin to visualize your JSON files. You can create a diagram of your JSON files by simply opening them in your IDE
Apache License 2.0
2 stars 2 forks source link

Image truncated to 4096x4096 for large and complex JSONs #3

Open Darathor opened 1 year ago

Darathor commented 1 year ago

With a large JSON file, the generated images is limited to 4096x4096. The graph seems to be fully generated.

For example, with this file: https://framagit.org/Darathor/tintecrabe/-/blob/poc/www/extensions/graveyards/extension.json

marcherdiego commented 1 year ago

Hi @Darathor I'm still waiting for updated on this one here: https://github.com/plantuml/plantuml/issues/1218

blundell commented 1 year ago

+1 just hit this :-)

(thanks for the plugin 💯 )

beezerbt commented 1 year ago

hi

Might be interested to know that if you set the environment variable in Intellij or as a user defined environment variable as follows: in the Terminal settings or set PLANTUML_LIMIT_SIZE=8192 respectively, generating the diagram fails. Nothing happens, and there are no logs in the Intellij IDE logs to indicate what happened. Equally important, is, that removing the environment variable and restarting Intellij and generating the diagram (I have a pretty big JSON file I want to convert to a diagram) works again, but with the bottom of the diagram snipped off.

Most probably as I want to generate huge diagrams! indicates, this might be a memory issue.

Oh and the advice to generate it using SVG export is not applicable to the plugin as there is no way of setting this as a config.

I did have a look at the code, and the method for generating the image, is overloaded in the PLANT UML...with a config which is a List. But that is as far as I got to be able to figure out how to refactor the plugin, to be able to fix this issue...

Therefore, I resorted to the Docker image of PlantUML which is a bit buggy, but there you can choose the SVG option to generate the SVG which is the full size. Only problem with that is, locally you would need IE to then reformat it to PNG unless security wise you are okay with an online alternative. Obviously with Docker you need admin rights to install the Docker Desktop on Windows...which is a pain in the back side, or alternatively Podman whose Windows install instructions is slightly obfuscated.

idwer commented 11 months ago

Attempted to insert a newer release of PlantUML, to find out whether a newer build writes a non-truncated image. Haven't noticed any effect.

Steps to repeat: 1) deinstall the plugin from IntelliJ 2)

unzip json-visualizer.zip

rm json-visualizer.zip
rm json-visualizer/lib/plantuml-1.2022.6.jar

wget https://github.com/plantuml/plantuml/releases/download/v1.2023.12/plantuml-1.2023.12.jar
cp plantuml-1.2023.12.jar json-visualizer/lib/
zip -r json-visualizer.zip json-visualizer

3) install the plugin (the new json-visualizer.zip file) from disk in IntelliJ