svg-centre
v1.0.7
Published
Resize and centre an svg element to its contents. Eliminates whitespace, and enables correct rescaling regarding width and height (provided ratio is constant)
Downloads
12
Maintainers
Readme
svg-centre
Lets shrink our svg just to the elements being shown within it.
centre = require('svg-centre')
// shrink a single svg
centre.shrink(document.getElementById('svg1'))
// or
// shrink all svgs
centre.shrinkall()
//create a montage of equally sized normalised svgs
centre.shrinkall(square='30vw')