Few tricks:
d3.xml()
to load the external SVG, simply including it as an image hides it from the DOM and d3. For an example of this, take a look here.d3.select()
can then be used to query and modify its attributesThe height|width are relative to the svg viewbox. Not related to the width and height of it on the page. This is important because any transforms or animations you do will all reference these coordinates.
Movement should be calculated according to your will, potentially via mathematical formula.
z-level is done by moving the object from upper to lower group. Svgs do not have a z-index
(if you know css).