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 cff9453 commit 5c3567a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/report/reporters/boxplot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,35 @@ const serializeBoxPlot = function ({
return titleBlock
}

const blocks = getBlocks({
quantiles,
minAll,
maxAll,
minBlockWidth,
contentWidth,
maxBlockWidth,
mini,
})
return concatBlocks([titleBlock, ...blocks])
}

const getBlocks = function ({
quantiles,
minAll,
maxAll,
minBlockWidth,
contentWidth,
maxBlockWidth,
mini,
}) {
if (mini) {
const miniContent = getMiniContent({
quantiles,
minAll,
maxAll,
contentWidth,
})
return concatBlocks([titleBlock, miniContent])
return [miniContent]
}

const minBlock = getMinMaxBlock(quantiles, minBlockWidth, 'min')
Expand All @@ -163,7 +184,7 @@ const serializeBoxPlot = function ({
contentWidth,
})
const maxBlock = getMinMaxBlock(quantiles, maxBlockWidth, 'max')
return concatBlocks([titleBlock, minBlock, fullContent, maxBlock])
return [minBlock, fullContent, maxBlock]
}

const getTitleBlockWidth = function ([combination]) {
Expand Down

0 comments on commit 5c3567a

Please sign in to comment.