I previously asked this question on the PlantUML GitHub discussions forum but it seems that this place is not very active so I'm reposting it here.
I have a large diagram that I want to include in my MkDocs site. Here an example I took from here.
Because of the size, it needs to be scaled down. This works fine if I export it to a .png and include it as an <img>. However, the diagram has links so I want to output it as an SVG and inline it (using this plugin). However, when I do that the aspect ratio isn't preserved anymore, making it unreadable.

After some searching I found out that I can fix this with the skinparam preserveAspectRatio, e.g. skinparam preserveAspectRatio xMidYMid meet. This will preserve the aspect ratio of the but the height of the image will remain at the original size, resulting in large blank areas.

Some more searching showed me that I could avoid this by setting skinparam svgDimensionStyle false. This will remove the entire style attribute from the svg. Unfortunately, this also removes the background attribute, which is a problem when the parent background is not white.

I'm all out of ideas. How do I create an SVG that will scale properly when inlined in HTML?