Skip to content

Commit

Permalink
Move histogram reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 5, 2021
1 parent bf2a2de commit ffb360b
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 27 deletions.
9 changes: 1 addition & 8 deletions src/report/reporters/debug/main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { serializeHistograms } from '../../utils/histogram/main.js'

import { getStatsTables } from './stats.js'

// Debugging reporter only meant for development purpose
const reportTerminal = function ({ combinations, screenWidth }) {
const statsTables = getStatsTables(combinations, screenWidth)
const histograms = serializeHistograms(combinations, {
mini: true,
screenWidth,
})
return `${statsTables}\n\n${histograms}`
return getStatsTables(combinations, screenWidth)
}

export const debug = { reportTerminal, capabilities: { debugStats: true } }
8 changes: 0 additions & 8 deletions src/report/reporters/histogram.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { separatorColor } from '../colors.js'
import { separatorColor } from '../../utils/colors.js'

import { TICK_MIDDLE, HORIZONTAL_LINE } from './characters.js'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { concatBlocks } from '../concat.js'
import { concatBlocks } from '../../utils/concat.js'

import { EXTRA_HEIGHT } from './characters.js'
import { getContent } from './content.js'
Expand All @@ -10,10 +10,10 @@ import {
} from './min_max.js'
import { getTitleBlock, getTitleBlockWidth } from './title.js'

// Serialize combinations' histograms for reporting
export const serializeHistograms = function (
combinations,
{ mini, screenWidth },
// Reporter showing distribution of measures with a histogram
const reportTerminal = function (
{ combinations, screenWidth },
{ mini = false },
) {
const height = DEFAULT_HEIGHT
const width = getContentWidth(combinations, mini, screenWidth)
Expand Down Expand Up @@ -59,3 +59,5 @@ const serializeHistogram = function ({
const hasLowLoops = function ({ mean, meanMin }) {
return mean === undefined && meanMin === undefined
}

export const histogram = { reportTerminal }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import stringWidth from 'string-width'

import { separatorColor } from '../colors.js'
import { separatorColor } from '../../utils/colors.js'

import { TICK_LEFT, TICK_RIGHT } from './characters.js'

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphGradientColor } from '../colors.js'
import { graphGradientColor } from '../../utils/colors.js'

import {
HISTOGRAM_CHARS,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import stringWidth from 'string-width'

import { getCombinationNameColor } from '../name.js'
import { NAME_SEPARATOR_COLORED } from '../separator.js'
import { getCombinationNameColor } from '../../utils/name.js'
import { NAME_SEPARATOR_COLORED } from '../../utils/separator.js'

import { ABSCISSA_BOTTOM_HEIGHT, ABSCISSA_LABELS_HEIGHT } from './abscissa.js'

Expand Down
2 changes: 1 addition & 1 deletion src/report/reporters/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { boxplot } from './boxplot/main.js'
import { debug } from './debug/main.js'
import { histogram } from './histogram.js'
import { histogram } from './histogram/main.js'
import { historyReporter as history } from './history.js'

export const REPORTERS = { debug, boxplot, histogram, history }

0 comments on commit ffb360b

Please sign in to comment.