问题
I am using UMLGraph to generate sequence diagrams. I have a problem using the pic2plot program to generate svg images. It clips the image and parts of the image don't show. This problem is also documented in the FAQ:
How can I prevent clipped SVG images in sequence diagrams? This appears to be a limitation of pic2plot. You can work around it, by increasing the width and height values appearing in the SVG XML file that pic2plot generates.
However, I have tried but failed to change the width and height in the svg image. I tried modifying the width="8in" height="8in" viewBox="0 0 1 1" preserveAspectRatio="none"
in the svg with no success.
Please help.
回答1:
I don´t know about how to solve this specific problem with UMLGraph but if you are open to use other similar textual modeling tools, take a look here with more than 10 tools available
回答2:
Editing the first line of the generated SVG seems to help...
Keeping the first parameter in the viewBox fixed, I scaled the width and the delta between third parameter and first parameter in the viewBox by 1.5 from
<svg baseProfile="full" height="19.67in" id="body" preserveAspectRatio="none" version="1.1" viewBox="-0.3800 -0.7325 0.6900 2.4588" width="5.52in" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
to
<svg baseProfile="full" height="19.67in" id="body" preserveAspectRatio="none" version="1.1" viewBox="-0.3800 -0.7325 1.035 2.4588" width="8.28in" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
No more clipping for me and looks okay. Your mileage may vary.
来源:https://stackoverflow.com/questions/5469729/generating-sequence-diagrams-using-umlgraph