equal
deleted
inserted
replaced
|
1 // TODO insert(node, function)? |
|
2 // TODO insert(function, string)? |
|
3 // TODO insert(function, function)? |
|
4 d3_selectionPrototype.insert = function(name, before) { |
|
5 name = d3.ns.qualify(name); |
|
6 |
|
7 function insert() { |
|
8 return this.insertBefore( |
|
9 document.createElement(name), |
|
10 d3_select(before, this)); |
|
11 } |
|
12 |
|
13 function insertNS() { |
|
14 return this.insertBefore( |
|
15 document.createElementNS(name.space, name.local), |
|
16 d3_select(before, this)); |
|
17 } |
|
18 |
|
19 return this.select(name.local ? insertNS : insert); |
|
20 }; |