From bf2a2deb799a03361718ed7613c1933c17f7600b Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 5 Sep 2021 11:08:53 +0200 Subject: [PATCH] Move history reporter --- src/report/reporters/debug/main.js | 11 +++-------- .../{debug/time_series.js => history.js} | 19 ++++++++++++------- src/report/reporters/main.js | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) rename src/report/reporters/{debug/time_series.js => history.js} (76%) diff --git a/src/report/reporters/debug/main.js b/src/report/reporters/debug/main.js index fd384ee01..ea3bc7620 100644 --- a/src/report/reporters/debug/main.js +++ b/src/report/reporters/debug/main.js @@ -1,20 +1,15 @@ import { serializeHistograms } from '../../utils/histogram/main.js' import { getStatsTables } from './stats.js' -import { getTimeSeries } from './time_series.js' // Debugging reporter only meant for development purpose -const reportTerminal = function ({ combinations, screenWidth, history }) { +const reportTerminal = function ({ combinations, screenWidth }) { const statsTables = getStatsTables(combinations, screenWidth) - const timeSeries = getTimeSeries(history, combinations, screenWidth) const histograms = serializeHistograms(combinations, { mini: true, screenWidth, }) - return [statsTables, timeSeries, histograms].join('\n\n') + return `${statsTables}\n\n${histograms}` } -export const debug = { - reportTerminal, - capabilities: { debugStats: true, history: true }, -} +export const debug = { reportTerminal, capabilities: { debugStats: true } } diff --git a/src/report/reporters/debug/time_series.js b/src/report/reporters/history.js similarity index 76% rename from src/report/reporters/debug/time_series.js rename to src/report/reporters/history.js index c7a715feb..2226e07ee 100644 --- a/src/report/reporters/debug/time_series.js +++ b/src/report/reporters/history.js @@ -1,11 +1,11 @@ -import { isSameDimension } from '../../../combination/ids.js' -import { fieldColor } from '../../utils/colors.js' -import { getCombinationNameColor } from '../../utils/name.js' -import { STATS_SEPARATOR_COLORED } from '../../utils/separator.js' -import { getTables } from '../../utils/table.js' +import { isSameDimension } from '../../combination/ids.js' +import { fieldColor } from '../utils/colors.js' +import { getCombinationNameColor } from '../utils/name.js' +import { STATS_SEPARATOR_COLORED } from '../utils/separator.js' +import { getTables } from '../utils/table.js' -// Show `result.history` as a time series -export const getTimeSeries = function (history, combinations, screenWidth) { +// Show `result.history` as a table +const reportTerminal = function ({ combinations, history, screenWidth }) { const headerRows = getHeaderRows(history) const bodyRows = getBodyRows(combinations, history) return getTables([...headerRows, ...bodyRows], screenWidth) @@ -67,3 +67,8 @@ const getCell = function (historyResult, combination) { return '' } + +export const historyReporter = { + reportTerminal, + capabilities: { history: true }, +} diff --git a/src/report/reporters/main.js b/src/report/reporters/main.js index 0f9f6c800..cddbb2963 100644 --- a/src/report/reporters/main.js +++ b/src/report/reporters/main.js @@ -1,5 +1,6 @@ import { boxplot } from './boxplot/main.js' import { debug } from './debug/main.js' import { histogram } from './histogram.js' +import { historyReporter as history } from './history.js' -export const REPORTERS = { debug, boxplot, histogram } +export const REPORTERS = { debug, boxplot, histogram, history }