score:1

You can resize the SVG by setting its height and width:

svg.attr("height", newHeight).attr("width", newWidth);

You have to compute the dimensions of the SVG yourself though. That is, D3 doesn't provide any functionality to fit the size of a container to its contents.


More Query from same tag