code: function (){
      var scale = Math.min(
        (_svg.width() - PADDING * 2) / _width,
        (_svg.height() - PADDING * 2) / _height
      ),
      panZoomValues = _panZoom();
  
      if(
        panZoomValues.panX !== PADDING ||
        panZoomValues.panY !== PADDING ||
        panZoomValues.scale !== scale
      ) {
        _panZoomValues = _panZoom(PADDING, PADDING, scale);
      }
      else {
        _panZoomValues = _panZoom(
          _panZoomValues.panX,
          _panZoomValues.panY,
          _panZoomValues.scale);
      }
    }
docs: Calling this function would fit the graph to the available space.