thistogram
Version:
A simple text based histogram and chart generator
30 lines • 1.57 kB
TypeScript
/**
* Draw a simple histogram with a single line of characters.
* @param data - the data to draw
* @param min - optional minimum value, defaults to the minimum value in the data
* @param max - optional maximum value, defaults to the maximum value in the data
* @param barChars - the characters to use for the bar, defaults to `['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█']`
* @returns a string of the histogram
*/
export declare function simpleHistogram(data: readonly number[], min?: number, max?: number, barChars?: string[]): string;
/**
* Generate a bar line for a value
* @param value - between 0 and 1 inclusive.
* @param width - the width of the bar in characters
* @param padding - optional padding character, defaults to space.
* @param barChars - the characters to use for the bar, defaults to `['▏', '▎', '▍', '▌', '▋', '▊', '▉', '█']`
* @returns a string of the bar
*/
export declare function barHorizontal(value: number, width: number, padding?: string, barChars?: string[]): string;
/**
*
* @param point - the point to plot
* @param sd - the standard deviation
* @param mean - the mean
* @param width - the width of the plot in characters
* @param range - the +/- range to plot, defaults to 2.5 SD.
* A value of 1 would mean to show only the range of a single standard deviation.
* @returns a string representing the plot
*/
export declare function plotPointRelativeToStandardDeviation(point: number, sd: number, mean: number, width: number, range?: number): string;
//# sourceMappingURL=bars.d.ts.map