structurizr / ui

UI code for Structurizr Lite, on-premises, and cloud service.
https://docs.structurizr.com/ui
MIT License
43 stars 27 forks source link

Long relationship technology strings distort the layouts #72

Open hubertmis opened 3 months ago

hubertmis commented 3 months ago

Description

When a relationship technology contains a longer string (e.g. the name or version of API instead of simple "REST API" or "C API"), the view gets distorted by the extensive width of relationship text boxes:

image

It seems the reason is the technology string does not follow the width style property of the relationships. It seems this could be easily fixed by adding breakText() function to the technology string processing:

https://github.com/structurizr/java/blob/f5780f2e0c2a95cec314771bd5d8baf022f129b3/structurizr-export/src/main/java/com/structurizr/export/dot/DOTExporter.java#L312

The only workaround I'm aware of is adding line breaks (\n) manually to the technology strings in the model description. However, this is hard to maintain when changing styles in the views.

Would it be OK to make technology strings obey the relationship width property?

Priority

I'm willing to add this feature myself and raise a PR (please confirm approach first)

More information

No response