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 3108b57 commit f3abae3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/report/reporters/boxplot/width.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ export const getWidths = function ({
maxAll,
}) {
const titlesWidth = getCombinationPaddedName(combinations[0]).length
const postTitlesWidth = Math.max(screenWidth - titlesWidth, 1)
const contentWidth = Math.max(screenWidth - titlesWidth, 1)
const minBlockWidth = getMinMaxBlockWidth({
statName: 'min',
combinations,
mini,
minAll,
maxAll,
contentWidth: postTitlesWidth,
contentWidth,
})
const postMinBlockWidth = Math.max(postTitlesWidth - minBlockWidth, 1)
const contentWidthA = Math.max(contentWidth - minBlockWidth, 1)
const maxBlockWidth = getMinMaxBlockWidth({
statName: 'max',
combinations,
mini,
minAll,
maxAll,
contentWidth: postMinBlockWidth,
contentWidth: contentWidthA,
})
const contentWidth = Math.max(postMinBlockWidth - maxBlockWidth, 1)
return { titlesWidth, minBlockWidth, contentWidth }
const contentWidthB = Math.max(contentWidthA - maxBlockWidth, 1)
return { titlesWidth, minBlockWidth, contentWidth: contentWidthB }
}

// Finds the smallest `minBlockWidth`/`maxBlockWidth` that fits all `min`/`max`
Expand Down

0 comments on commit f3abae3

Please sign in to comment.