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

svg.resize.js

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg.resize.js

An extension for svn.js which allows to resize elements which are selected

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
874K
increased by1.54%
Maintainers
1
Weekly downloads
 
Created
Source

svg.resize.js

An extension of svg.js which allows to resize elements which are selected with svn.select.js

Demo

For a demo see http://fuzzyma.github.io/svg.resize.js/

Get Started

  • Install svg.resize.js using bower:

      bower install svg.resize.js
    
  • Include the script after svg.js and svg.select.js into your page

      <script src="svg.js"></script>
      <script src="svg.select.js"></script>
      <script src="svg.resize.js"></script>
    
  • Select a rectangle and make it resizeable:

      <div id="myDrawing"></div>
    
      var drawing = new SVG('myDrawing').size(500, 500);
      drawing.rect(50,50).select().resize()
    

Usage

Activate resizing

var draw = SVG('drawing');
var rect = draw.rect(100,100);
rect.select().resize();

Deactivate resizing

rect.resize('stop');

Options

  • snapToGrid: Snaps the shape to a virtual grid while resizing (default 1)
  • snapToAngle: Snaps to an angle when rotating (default 0.1)

Events

  • resizedone: Fired when resizing is done

Keywords

FAQs

Package last updated on 07 Mar 2016

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