translate | 座標系の移動 |
scale | 座標系の拡大縮小 |
rotate | 座標系の回転 |
skewX | X座標軸を傾ける |
skewY | Y座標軸を傾ける |
<svg width="10cm" height="10cm" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="square" stroke-width="2" stroke="blueviolet"> <rect x="5" y="5" width="40" height="40"/> <rect x="15" y="15" width="20" height="20"/> </g> <use xlink:href="#square" transform="translate(40, 40)" fill="yellow"/> </svg> |
<svg width="10cm" height="10cm" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"> <circle cx="40" cy="40" r="25" stroke="red" fill="none"/> <circle cx="40" cy="40" r="25" transform="scale(0.4)" stroke="blue" fill="none"/> <circle cx="40" cy="40" r="25" transform="scale(1.4, 0.7)" stroke="green" fill="none"/> </svg> |
<svg width="10cm" height="10cm" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"> <rect x="30" y="30" width="40" height="20" fill="magenta"/> <rect x="30" y="30" width="40" height="20" fill="green" transform="rotate(45, 30, 30)"/> </svg> |
<svg width="10cm" height="10cm" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="70" height="50" stroke="red" fill="none"/> <rect x="1" y="1" width="70" height="50" stroke="green" fill="none" opacity="0.5" transform="skewX(15)"/> <rect x="1" y="1" width="70" height="50" stroke="blue" fill="none" opacity="0.5" transform="skewY(15)"/> </svg> |
<svg width="10cm" height="10cm" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="square" stroke-width="2" stroke="blueviolet"> <rect x="5" y="5" width="40" height="40"/> <rect x="15" y="15" width="20" height="20"/> </g> <use xlink:href="#square" fill="gold" transform="translate(30, 30) rotate(30)"/> </svg> |