Socket
Book a DemoInstallSign in
Socket

svg-z-order

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-z-order

A module to manipulate the z-order of a SVG elements

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

SVG-Z-ORDER

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

Overview

var svgz = require("svg-z-order");

var g = svg.getElementById("foo");
svgz.element(g).toTop();

// with D3.js
var d3g = d3.select("#foo");
svgz.element(d3g.node()).toTop();

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

Sample Code

  • APIs to Change Z-Order: toTop/toBottom/moveUp/moveDown

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

APIs

  • 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.

LICENSE

This software is released under the MIT License, see LICENSE

Keywords

SVG

FAQs

Package last updated on 03 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts