Skip to content

Commit

Permalink
add raise function
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Jun 14, 2020
1 parent 9f93db5 commit cb35d27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Expand Up @@ -9,3 +9,4 @@ export { default as scaleCanvas } from './lib/scaleCanvas.js';
export { default as flatten } from './lib/flatten.js';
export { default as uniques } from './lib/uniques.js';
export { default as calcExtents } from './lib/calcExtents.js';
export { default as raise } from './lib/raise.js';
11 changes: 11 additions & 0 deletions src/lib/raise.js
@@ -0,0 +1,11 @@
/* --------------------------------------------
*
* Move an element to the last child
* Adapted from d3-selection `.raise`
* https://github.com/d3/d3-selection#selection_raise
*
* --------------------------------------------
*/
export default function raise(el) {
if (el.nextSibling) el.parentNode.appendChild(el);
}

0 comments on commit cb35d27

Please sign in to comment.