Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 5, 2021
1 parent fc0357e commit dfcb87a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/report/reporters/boxplot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ const getWidths = function (combinations, screenWidth, mini) {
const minBlockWidth = mini
? 0
: Math.max(
getHeaderName('min').length,
getHeaderNameWidth('min'),
getMinMaxBlockWidth(combinations, 'min'),
)
const maxBlockWidth = mini
? 0
: Math.max(
getHeaderName('max').length,
getHeaderNameWidth('max'),
getMinMaxBlockWidth(combinations, 'max'),
)
const contentWidth = Math.max(
Expand Down Expand Up @@ -112,6 +112,10 @@ const getHeader = function ({
return [`${titleHeader}${minHeader}${boxHeader}${maxHeader}`]
}

const getHeaderNameWidth = function (statName) {
return getHeaderName(statName).length
}

const getHeaderName = function (statName) {
return addPadding(STAT_TITLES[statName])
}
Expand Down

0 comments on commit dfcb87a

Please sign in to comment.