csblo
csblo

Reputation: 1631

Shared coordinates between elements in SVG

I would like to share coordinates between two or more elements.

My example in peudo-Code :

<point xml:id="myPoint" x="10" y="20" />

<circle point="url(#myPoint)" r="10" />
<circle point="url(#myPoint)" r="50" />

I've seen IRI references that have the best match with that I searched, but :

With SVG format and specifications (no javascript code), Is there a way to have many elements which reference the same coordinates ?

Thus, I just have to manipulate the point "myPoint" to change the coordinate of all elements that reference it.

I hope my english isn't so bad and thanks for your answers.

Upvotes: 1

Views: 84

Answers (1)

Robert Longson
Robert Longson

Reputation: 124219

Use a group <g> element to transform the origin. If you omit co-ordinates then objects will be drawn there.

<g transform="translate(10, 20)">
  <circle r="10" />
  <circle r="50" />
</g>

Upvotes: 1

Related Questions