--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolkit/javascript/d3/src/core/selection-insert.js Thu Apr 10 14:20:23 2014 +0200
@@ -0,0 +1,20 @@
+// TODO insert(node, function)?
+// TODO insert(function, string)?
+// TODO insert(function, function)?
+d3_selectionPrototype.insert = function(name, before) {
+ name = d3.ns.qualify(name);
+
+ function insert() {
+ return this.insertBefore(
+ document.createElement(name),
+ d3_select(before, this));
+ }
+
+ function insertNS() {
+ return this.insertBefore(
+ document.createElementNS(name.space, name.local),
+ d3_select(before, this));
+ }
+
+ return this.select(name.local ? insertNS : insert);
+};