
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
svg.resize.js
Advanced tools
An extension for svg.js which allows to resize elements which are selected
An extension of svg.js which allows to resize elements which are selected with svg.select.js
For a demo see http://svgdotjs.github.io/svg.resize.js/
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).selectize().resize()
Activate resizing
var draw = SVG('drawing');
var rect = draw.rect(100,100);
rect.selectize().resize();
Deactivate resizing
rect.resize('stop');
Keep element within constrained box
var draw = SVG('drawing');
var rect = draw.rect(100, 100);
var opt = {
constraint: {
minX: 0,
minY: 0,
maxX: 200,
maxY: 300
}
};
rect.selectize().resize(opt)
snapToGrid
: Snaps the shape to a virtual grid while resizing (default 1
)snapToAngle
: Snaps to an angle when rotating (default 0.1
)constraint
: Keep element within constrained box (see usage above); The box snaps to the grid defined by snapToGrid
.saveAspectRatio
: Save aspect ratio of the element while resizing with left-top, left-bottom, right-top, right-bottom points.resizing
: Fired when changes occurresizedone
: Fired when resizing is doneFAQs
An extension for svg.js which allows to resize elements which are selected
The npm package svg.resize.js receives a total of 328,734 weekly downloads. As such, svg.resize.js popularity was classified as popular.
We found that svg.resize.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.