{"version":3,"file":"get-legend-width.cjs","names":[],"sources":["../../../src/MatrixChart/get-legend-width/get-legend-width.ts"],"sourcesContent":["interface GetLegendWidthInput {\n  legendLabels: [string, string];\n  fontSize: number;\n  colorsCount: number;\n  cellSize: number;\n  gap: number;\n}\n\nexport function getLegendWidth({\n  legendLabels,\n  fontSize,\n  colorsCount,\n  cellSize,\n  gap,\n}: GetLegendWidthInput): number {\n  const textGap = 6;\n  const charWidth = fontSize * 0.6;\n  const lessWidth = legendLabels[0].length * charWidth;\n  const allColorsCount = 1 + colorsCount;\n  const rectsWidth = allColorsCount * cellSize + (allColorsCount - 1) * gap;\n  const moreWidth = legendLabels[1].length * charWidth;\n  return lessWidth + textGap + rectsWidth + textGap + moreWidth;\n}\n"],"mappings":";;AAQA,SAAgB,eAAe,EAC7B,cACA,UACA,aACA,UACA,OAC8B;CAC9B,MAAM,UAAU;CAChB,MAAM,YAAY,WAAW;CAC7B,MAAM,YAAY,aAAa,EAAE,CAAC,SAAS;CAC3C,MAAM,iBAAiB,IAAI;CAC3B,MAAM,aAAa,iBAAiB,YAAY,iBAAiB,KAAK;CACtE,MAAM,YAAY,aAAa,EAAE,CAAC,SAAS;CAC3C,OAAO,YAAY,UAAU,aAAa,UAAU;AACtD"}