node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »



A module to manipulate the Z-Order of a SVG element.


var svgz = require("svg-z-order");
var g = svg.getElementById("foo");
// with D3.js 
var d3g ="#foo");

If require is NOT available, use global svgz_element function instead of 'svgz.element' method.

Sample Code

To run the sample above on the WEB, Visit the project page.


  • svgz.element(domElement) - Creates SVGZElement instance referencing a dom element.
  • SVGZElement.toTop() - Brings up the element to top of the all sibling elements.
  • SVGZElement.toBottom() - Brings down the element to bottom of the all sibling elements.
  • SVGZElement.moveUp(element/n) - Moves up the element to the front of specified target element or n-times.
  • SVGZElement.moveDown(element/n) - Moves down the element to behind of the specified target element or n-times.
  • SVGZElement.moveTo(element/index) - Moves the element to the specified position.


This software is released under the MIT License, see LICENSE