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 3f8a170 commit 3108b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/report/reporters/boxplot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getCombNamePaddedColor } from '../../utils/name.js'
import { getBox } from './box.js'
import { getLabels } from './labels.js'
import { getMinMaxAll } from './min_max.js'
import { normalizeQuantiles } from './normalize.js'
import { normalizeQuantiles, isMeasuredCombination } from './normalize.js'
import { getPositions } from './position.js'
import { getWidths } from './width.js'

Expand Down Expand Up @@ -40,7 +40,6 @@ const reportTerminal = function (

const serializeCombination = function ({
combination,
combination: { quantiles },
minAll,
maxAll,
titlesWidth,
Expand All @@ -50,11 +49,11 @@ const serializeCombination = function ({
}) {
const combinationTitles = getCombNamePaddedColor(combination)

if (quantiles === undefined) {
if (!isMeasuredCombination(combination)) {
return getEmptyCombination(combinationTitles, mini)
}

const positions = getPositions({ quantiles, minAll, maxAll, contentWidth })
const positions = getPositions({ combination, minAll, maxAll, contentWidth })
const box = getBox({ positions, minBlockWidth, combinationTitles, mini })
const labels = mini
? ''
Expand Down
2 changes: 1 addition & 1 deletion src/report/reporters/boxplot/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mapObj from 'map-obj'

// Compute the horizontal position on the screen of each quantile
export const getPositions = function ({
quantiles,
combination: { quantiles },
minAll,
maxAll,
contentWidth,
Expand Down

0 comments on commit 3108b57

Please sign in to comment.