Currently, the :width: and :height: properties are ignored for SVG outputs. This is a bit annoying, as for PNG, the output image is properly resized if you specify those properties. In addition, SVG offers much better options to define the display size (as the name suggests, it is a scalable vector graphic): percentages for width are a feasible option.
I had a look at the code, and for SVG, it currently just copies the calculated width and height in pixels from the SVG and puts it to the <object> tag.
I suggest to substitute width and height with the properties given to the directive instead. :width: 100% would work nicely for SVGs and HTML output.
An additional consideration would be to add also a :max-width: property.
It seems it would at least partially address other user's findings:
Currently, the
:width:
and:height:
properties are ignored for SVG outputs. This is a bit annoying, as for PNG, the output image is properly resized if you specify those properties. In addition, SVG offers much better options to define the display size (as the name suggests, it is a scalable vector graphic): percentages for width are a feasible option.I had a look at the code, and for SVG, it currently just copies the calculated width and height in pixels from the SVG and puts it to the
<object>
tag. I suggest to substitute width and height with the properties given to the directive instead.:width: 100%
would work nicely for SVGs and HTML output. An additional consideration would be to add also a:max-width:
property.It seems it would at least partially address other user's findings:
:scale:
option not working https://github.com/sphinx-contrib/plantuml/issues/12#issuecomment-1175215100_