Lets say I have an arbitrary svg with paths:

```default
<svg>
  <g>
    <path d="...." />
  </g>
  <g>
    <path d="...." />
  </g>
</svg>

```

For each path, I have calculated the exact **width** and **height** bbox values (in pixels) that I want them to be scaled down to on render. These values are correct and (when needed) will preserve the aspect ratio of the paths.
With no change to scaling (`scale(1)`), the default size of the paths are very big (hundreds of pixels), covering a lot of the svg.

I have figured out that once I know the original width and height values of a given path at scale(1), then I can divide **width** by the original width and **height** by the original height to get the scale value I am looking for. This method, however, requires rendering the path first at scale(1) to determine the original dimensions.

Is there a way to calculate the `transform: scale(x)` value that yeilds a path of size **width** and **height** before rendering the svg? Or are there other beneficial scaling methods or factors at play that I am missing? I am using jsx/React components for rendering the svg although this is probably inconsequential. 

---

Update
------

The [SVG.js](https://svgjs.com/docs/3.0/) library solves this issue another way by scaling the path strings themselves instead of using transforms. This is not as efficient as vanilla js but still quite fast.