Closed ExarcaFidalgo closed 3 years ago
Alright, this went under the radar for too much time. Surprised that it never arose before. Well, such contemplations do not help. First of all, every option available to the PlantUML API must be revised, in order to make sure that this does not have an easy way out to increase its max size.
I'll be repurposing the old project repo to use as a playground for this package to try a couple things.
So, this is the current situation:
PUML API does not allow an increase of the image size.
Libraries which make use of PUML to locally create the diagram are abandoned, broken and overall, are better forgotten.
Indeed, it seems like it may be time for an update at the XMI visualization. Are there any viable alternatives? There may be.
Looking around, I found Mermaid, which is an ongoing project with promising capabilities to create SVG diagramas from text.
Playing around with their class diagrams, they are similar in definition to the ones we already make use of. Such SVGs allow for more interaction and can be downloaded as well as PNG. Nonetheless, there are problems. It seems to break quite easily with non-expected characters and semi-colons, which must be used for prefixes everywhere, are a chore to its integrity. We'd have to add them later to the generated SVG. A pain, truly.
Also, I'm not quite convinced about its layout. It seemed too dependent in the order of elements, which by automatic generation will surely provide no pleasant view.
I think this is a nice occasion to open a new branch and test a few things out. We'll see.
El proceso de creación de diagramas mediante Mermaid resulta algo engorroso por la cantidad de caracteres que nosotros empleamos (<>:~...) que esto no acepta. A base de emplear sustitutos y reemplazarlos dinámicamente, conseguimos mantenerlo.
No obstante, el resultado final parece una mejoría. Un SVG que nos permite copiar los textos que contiene, que podemos descargar como SVG o PNG (presuntamente) y en principio, configurable en cuanto a temas estilísticos.
En cuanto al diagrama que ocasionó el caos, he de solucionar un par de minucias, pero aquí lo tenemos en su completitud. De algún modo, he de determinar dinámicamente la magnitud del diagrama para ajustar el tamaño del SVG respecto a su contenedor y así, hacerlo legible.
Con tal cantidad de relaciones que posee, es algo farragoso, pero me parece que usemos lo que usemos, eso es dificilmente evitable.
Alright, it is now capable of creating SVG Class Diagrams with Mermaid as far as it did before. It can be tried on here.
We are not done yet working with this. Customization possibilities, as well as a clearer exposition, are needed. I will open other issues for such purposes.
From rdfshape-client:
Seems like a PlantUML limitation, since we are just showing its output. Inspecting the original, PlantUML is setting a max width of 2000 px to the image generated, regardless of the content. Therefore, those diagrams which tend to be expanded horizontally are cut short.
It is an issue that must be solved in shumlex itself, although i'm unsure of the way. Doesn't seem like the PUML code allows for an increase in size. This may take some time, more than it initially seemed.