source: node_modules/d3-selection/src/selection/insert.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 474 bytes
Line 
1import creator from "../creator.js";
2import selector from "../selector.js";
3
4function constantNull() {
5 return null;
6}
7
8export default function(name, before) {
9 var create = typeof name === "function" ? name : creator(name),
10 select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
11 return this.select(function() {
12 return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
13 });
14}
Note: See TracBrowser for help on using the repository browser.