I am using svg.js to draw lines on like a canvas. Is it possible to scale the svg element created by calling SVG() to the size of the parent? As of right now, I am just redrawing all the lines when the element resizes.
<div
ref={r => this.whiteboard = r}
id="whiteboard"
>
</div>
{...}
let { offsetWidth: width, offsetHeight: height } = this.whiteboard;
this.draw = SVG('whiteboard').size(width, height);
I am using React which I know will be hard to mix with svg.js but that is another conversation.