function fitGraphScale()

in src/app/components/queue-v2/queues-v2.component.ts [115:129]


  function fitGraphScale() {
    const baseSvgElem = svg.node() as SVGGElement;
    const bounds = baseSvgElem.getBBox();
    const parent = baseSvgElem.parentElement as HTMLElement;
    const fullWidth = parent.clientWidth;
    const fullHeight = parent.clientHeight;
    
    const xfactor: number = fullWidth / bounds.width;
    const yfactor: number = fullHeight / bounds.height;
    let scaleFactor: number = Math.min(xfactor, yfactor);

    const paddingPercent = 0.9;
    scaleFactor = scaleFactor * paddingPercent;
    return scaleFactor;
  }