Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pod-point/build-svg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pod-point/build-svg

Build SVGs from these building blocks.

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-96.64%
Maintainers
1
Weekly downloads
 
Created
Source

BuildSVG

Class that can define and manipulate SVG elements. Build up an image by creating children BuildSVG elements.

Import

import BuildSVG from '@pod-point/build-svg';

Use

Create a new element

var svg = new BuildSVG('svg', attrs);

svg.element; // SVGElement

Methods

.attr()

svg.attr('d'); // Get 'd'
svg.attr('d', 'M100 200'); // Set 'd'
svg.attr(attrs); // Set multiple

.dimensions()

svg.dimensions(width, height); // Set width and height

.offset()

svg.offset(); // Get { x, y }
svg.offset(x, y); // Set { x, y } 

.append()

svg.append(new BuildSVG('path')); // Adds a path tag after all children

.prepend()

svg.prepend(new BuildSVG('path')); // Adds a path tag before all children

.create()

svg.create('path', attr); // Create and append child SVG path

FAQs

Package last updated on 24 Nov 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc