diff --git a/scripts/lib/chartData.mjs b/scripts/lib/chartData.mjs index 49bf5e1f..90448201 100644 --- a/scripts/lib/chartData.mjs +++ b/scripts/lib/chartData.mjs @@ -344,6 +344,11 @@ const parseFreeText = (text, { delta = false } = {}) => { return matrixToDataset(matrix, 'txt') } +/** + * @typedef {{ label: string, value?: number, initial?: number, final?: number }} DatasetRow + * @typedef {{ name: string, rows: { label: string, value: number }[] }} DatasetSeries + */ + /** * Parse the raw input into `{ rows, format, issues }`. `buffer` is required for * xlsx/xls; `text` for csv/md/txt. `format` overrides the extension inference. @@ -351,6 +356,7 @@ const parseFreeText = (text, { delta = false } = {}) => { * final, header naming the two periods) instead of the single-measure path. * * @param {{ text?: string | null, buffer?: Buffer | null, format?: string | null, delta?: boolean }} [options] + * @returns {{ rows: DatasetRow[], series?: DatasetSeries[], startLabel?: string, endLabel?: string, format: string, issues: string[] }} */ export const parseInput = ({ text = null, buffer = null, format = null, delta = false } = {}) => { if (format === 'xlsx' || format === 'xls') { @@ -379,7 +385,7 @@ export const parseInput = ({ text = null, buffer = null, format = null, delta = * series (few periods as columns, many as a line); anything else is a * ranking/comparison in horizontal bars. * - * @param {{ label: string, value: number }[]} rows + * @param {DatasetRow[]} rows * @param {string | null} [forcedType] */ export const classifyRelation = (rows, forcedType = null) => {