
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
jquery-svgpan
Advanced tools
This plugin provides a jQuery hook to use Andrea Leofreddi's SVGPan library on an arbitrary number of SVGs.
This is an an adaptation of Andrea Leofreddi's SVGPan library, version 1.2.2, for use as a jQuery plugin.
When called upon SVG element(s), this will add all the capabilities of Andrea Leofreddi's SVGPan library to those elements. Non-SVG elements will be silently ignored.
This is useful if you have SVG content sitting in the DOM. For example, if you are generating graphics via the d3 visualization library. It will not work if you are embedding the SVG through some other means.
You can configure the behaviour of the pan/zoom/drag by passing arguments.
viewportId
: String ID of the root SVG element.enablePan
: Boolean enable or disable panning (default enabled)enableZoom
: Boolean enable or disable zooming (default enabled)enableDrag
: Boolean enable or disable dragging (default disabled)zoomScale
: Float zoom sensitivity, defaults to .2 $(selector).svgPan(viewportId, enablePan, enableZoom, enableDrag, zoomScale);
This would enable SVGPan for all SVGs currently on the page. The
element #viewport
would be used as the viewport for each.
$('svg').svgPan('viewport');
This would enable SVGPan for a single element (provided it is an SVG).
$('#id').svgPan('viewport');
Andrea Leofreddi's original SVGPan library on Google code
Fork jquery-svgpan at
CDN jquery-svgpan from
FAQs
This plugin provides a jQuery hook to use Andrea Leofreddi's SVGPan library on an arbitrary number of SVGs.
We found that jquery-svgpan 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.