scrcoordsset false. The script has two tasks:
y = Ymax - y(y increases top to bottom)
scrcoords set true - for the screen coordinates of SVG Editor. Drawing is
constructed and SVG statements, generated by the SVG Editor, are listed as shown.
This is to show construction of SVG viewBox for SVG drawing to be scaled and centered in view port of chosen width and height.
Simply the drawing bounding rectangle (using SVG <rect>, shown in red) is put in place, then the x, y, width and height
attributes of the rectangle are used for the viewBox and the rectangle removed. In Source Editor the inner SVG viewBox
(with attributes taken from the bounding rectangle) does contain the SVG written by the graphics editor (Inkscape).
The SVG is written as continuous path statements yet the viewBox does the job of scaling and centering the drawing
within the width and height of the outer SVG.
document.getElementsByTagName) would determine max/min (x, y) coordinates
so as to set min-x, min-y, width and height of the viewBox.