html - SVG added to DOM using javascript is not visible. -
i have valid svg file verified opening in image viewer.
i tried adding svg html file using javascript code
d3.xml("assets/abc.svg", function(xml) { document.body.appendchild(xml.documentelement); });
i check html source , can see svg added in html. svg not visible on page. idea reason?
note :
- d3 working fine.
- the svg valid.
- the svg getting added dom structure within body.'
- its not visible in both chrome , firefox.
works ok me in ie/ff/ch. have valid svg, following in root svg:
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" ...>
if have namespace, problem svg not formed correctly. or possibly, svg not viewable i.e. display="none" or viewbox tiny
Comments
Post a Comment