Created
July 31, 2012 14:34
-
-
Save stephenmaturin/3217448 to your computer and use it in GitHub Desktop.
Cannot select SVG foreign object in d3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run() { | |
svg = d3.select("#example_svg"); | |
console.log(svg.selectAll("circle")); | |
console.log(svg.selectAll("foreignObject")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Cannot Select SVG Foreign Object</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<script src = "fo_select.js"></script> | |
</head> | |
<body> | |
<svg id="example_svg" width="600" height="600"> | |
<g> | |
<circle r="40" cx = "80" cy="80"></circle> | |
<foreignObject width = "100" height = "100" x = "200" y="200"> | |
<body>Hello, world</body> | |
</foreignObject> | |
</g> | |
</svg> | |
<script>run()</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment