README
svg-center
Lets shrink our svg just to the elements being shown within it.
center = require('svg-center')
// shrink a single svg
center.shrink(document.getElementById('svg1'))
// or
// shrink all svgs
center.shrinkall()
Resize and center an svg element to its contents. Eliminates whitespace, and enables correct rescaling regarding width and height (provided ratio is constant)
<script type="module">
import svgCenter from 'https://cdn.skypack.dev/svg-center';
</script>
Lets shrink our svg just to the elements being shown within it.
center = require('svg-center')
// shrink a single svg
center.shrink(document.getElementById('svg1'))
// or
// shrink all svgs
center.shrinkall()