admin管理员组文章数量:1397093
I couldn't find the way how to embed two SVGs into SVG document. I need to do it with ability of code which would manipulate with both child SVG-s, and would like to have independent coordinates on both of those areas. I don't like to do it in HTML, because I consider it too limiting paring to SVG. Many thanks!
I couldn't find the way how to embed two SVGs into SVG document. I need to do it with ability of code which would manipulate with both child SVG-s, and would like to have independent coordinates on both of those areas. I don't like to do it in HTML, because I consider it too limiting paring to SVG. Many thanks!
Share Improve this question asked Nov 6, 2011 at 17:08 AlexAlex 3,2777 gold badges37 silver badges51 bronze badges3 Answers
Reset to default 6An SVG document fragment consists of any number of SVG elements contained within an ‘svg’ element.
- Source: http://www.w3/TR/SVG/struct.html#NewDocument
Basically:
<svg …>
<svg id="a" …>…</svg>
<svg id="b" …>…</svg>
</svg>
<svg>
...
<image x="..." y="..." width="..." height="..." xlink:href="path/to/your/file.svg" ></image>
...
</svg>
One of solution is '[parent svg] - [g] - [child svg]' structure.
<svg>
<g transform="translate(-,-)">
<svg>
...
</svg>
</g>
</svg>
You can set the cordinate of child svg as transform(translate) of g element.
demo:
http://hitokun-s.github.io/old/demo/path-between-two-svg.html
本文标签: javascriptembedding SVG in SVGStack Overflow
版权声明:本文标题:javascript - embedding SVG in SVG - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744149522a2592996.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论