Does the viewBox have to use pixels?
The four values are in the SVG’s internal coordinates. The viewport is the area on screen or in a layout where the SVG is displayed.
Turn the width, height and origin of your SVG artwork into a viewBox. Add equal padding or expand the bounds to fit a viewport ratio.
The first two values give the origin of the visible region in SVG units. The last two give its width and height. A negative origin is valid if the artwork extends left or above the drawing origin.
The viewport-ratio mode grows whichever viewBox dimension is too small and splits the extra area evenly across its two sides. It preserves the padded drawing inside the result.
The four values are in the SVG’s internal coordinates. The viewport is the area on screen or in a layout where the SVG is displayed.
It changes the visible coordinate window. It does not move the paths or other drawing elements.