toolkit/javascript/d3/examples/hello-world/select-enter-add.html
changeset 47 c0b4a8b5a012
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/toolkit/javascript/d3/examples/hello-world/select-enter-add.html	Thu Apr 10 14:20:23 2014 +0200
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Test - select > enter > append</title>
+    <script type="text/javascript" src="../../d3.js"></script>
+  </head>
+  <body>
+    <span></span>
+    <span></span>
+    <script type="text/javascript">
+
+var s = d3.select("body")
+  .selectAll("span")
+    .data("The test passed, hooray!".split(/\b/));
+
+// Add missing <span>s.
+s.enter().append("span")
+  .append("b")
+    .text(function(d) { return d; });
+
+// Add missing <b>s.
+s.selectAll("b")
+    .data(function(d) { return [d]; })
+  .enter().append("b")
+    .text(function(d) { return d; });
+
+    </script>
+  </body>
+</html>