I think it may be beneficial to look at the SVG
viewbox attribute. There is a nice explanation
here and the SVG Spec is
here. In conjunction with the
preserveAspectRatio attribute (the very next section on the SVG Spec url) you should be able to achieve what you want. Past that, you
could apply the same attr() adjustments accordingly to what ever elements you need scaled in the resize event, which can be handy if you just want to scale a few key elements, but trying to scale all of the elements could lead to slow performance. Though, if you still need to do that you could use an interval checking routine of sorts and only perform the scaling
after the window has stop resizing. Disclaimer, I've done a little bit of all of that throughout a few different projects and it ends up, for me at least, that it can be quite dependent to the project, so I make no claim that any or all of these methods are "correct". :P