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 5fdcbd4 commit 11f3fd3
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/report/reporters/boxplot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,17 @@ const getMinMaxAll = function (combinations) {
return {}
}

const minAll = Math.min(...combinationsA.map(getMinQuantile))
const maxAll = Math.max(...combinationsA.map(getMaxQuantile))
const minAll = Math.min(
...combinationsA.map((combination) => getQuantile(combination, 'min')),
)
const maxAll = Math.max(
...combinationsA.map((combination) => getQuantile(combination, 'max')),
)
return { minAll, maxAll }
}

const getMinQuantile = function ({
quantiles: {
min: { raw },
},
}) {
return raw
}

const getMaxQuantile = function ({
quantiles: {
max: { raw },
},
}) {
return raw
const getQuantile = function ({ quantiles }, statName) {
return quantiles[statName].raw
}

const getWidths = function (combinations, screenWidth, mini) {
Expand Down

0 comments on commit 11f3fd3

Please sign in to comment.