text: export function calculateViewDimensions(_a) {
      var width = _a.width, height = _a.height, margins = _a.margins, _b = _a.showXAxis, showXAxis = _b === void 0 ? false : _b, _c = _a.showYAxis, showYAxis = _c === void 0 ? false : _c, _d = _a.xAxisHeight, xAxisHeight = _d === void 0 ? 0 : _d, _e = _a.yAxisWidth, yAxisWidth = _e === void 0 ? 0 : _e, _f = _a.showXLabel, showXLabel = _f === void 0 ? false : _f, _g = _a.showYLabel, showYLabel = _g === void 0 ? false : _g, _h = _a.showLegend, showLegend = _h === void 0 ? false : _h, _j = _a.legendType, legendType = _j === void 0 ? 'ordinal' : _j, _k = _a.columns, columns = _k === void 0 ? 12 : _k;
      var xOffset = margins[3];
      var chartWidth = width;
      var chartHeight = height - margins[0] - margins[2];
      var yOffset = margins[0];
      if (showLegend) {
          if (legendType === 'ordinal') {
              columns -= 2;
          }
          else {
              columns -= 1;
          }
      }
      chartWidth = chartWidth * columns / 12;
      chartWidth = chartWidth - margins[1] - margins[3];
      if (showXAxis) {
          chartHeight -= 5;
          chartHeight -= xAxisHeight;
          if (showXLabel) {
              // text height + spacing between axis label and tick labels
              var offset = 25 + 5;
              chartHeight -= offset;
          }
      }
      if (showYAxis) {
          chartWidth -= 5;
          chartWidth -= yAxisWidth;
          xOffset += yAxisWidth;
          xOffset += 10;
          if (showYLabel) {
              // text height + spacing between axis label and tick labels
              var offset = 25 + 5;
              chartWidth -= offset;
              xOffset += offset;
          }
      }
      chartWidth = Math.max(0, chartWidth);
      chartHeight = Math.max(0, chartHeight);
      return {
          width: ~~chartWidth,
          height: ~~chartHeight,
          xOffset: ~~xOffset,
          yOffset: ~~yOffset,
      };
  }
  //# sourceMappingURL=view-dimensions.helper.js.map