Here is a FIDDLE with Mike's example you mentioned.
var chart = $(".bubble"),
aspect = chart.width() / chart.height(),
container = chart.parent();
$(window).on("resize", function() {
var targetWidth = container.width();
chart.attr("width", targetWidth);
chart.attr("height", Math.round(targetWidth / aspect));
}).trigger("resize");
Essentially, you use the viewBox
and preserveAspectRatio
attributes on the svg
and re-size accordingly.