Say that I have the following arrow, which I want to repeat several times in different places in svg:
<svg width="400" height="400">
<path transform="translate(150,100)" fill="black" d="M 0.5,0.5 l-100,0 -25,20 25,20 100,0 z" />
<path transform="translate(300,200)" fill="black" d="M 0.5,0.5 l-100,0 -25,20 25,20 100,0 z" />
<path transform="translate(150,300)" fill="black" d="M 0.5,0.5 l-100,0 -25,20 25,20 100,0 z" />
</svg>

Perhaps I would like to change the shape of the path in the future, so I would prefer to avoid copying the attribute insertion deverywhere.
Can I somewhere determine the shape of the path, and then place it in a different location x, ynot manipulating them from javascript?
Two thoughts:
Is there a way to avoid copying an entire object without delivering it from javascript?
source
share