rms-sparklines
Version:
A sparkline collection, written as web components
100 lines (99 loc) • 3.17 kB
TypeScript
export declare class BoxPlot {
canvasEl: HTMLCanvasElement;
axisColor: string;
axisLineWidth: number;
chartType: string;
className: string;
drawingMethod: string;
lowWhiskerColor: string;
lowWhiskerLineWidth: number;
height: number;
interQuartileRangeLineColor: string;
interQuartileRangeFillColor: string;
interQuartileRangeLineWidth: number;
highWhiskerColor: string;
highWhiskerLineWidth: number;
medianColor: string;
medianLineWidth: number;
population: number[];
width: number;
maximum: number;
quartile_3: number;
median: number;
quartile_1: number;
minimum: number;
x_axis_canvas_gap: number;
x_axis_translation: number;
whiskerHeight: number;
medianHeight: number;
coordinatesTips: any;
tootipBoxMargin: number;
tooltipId: string;
constructor(axisColor: string, axisLineWidth: number, chartType: string, className: string, drawingMethod: string, height: number, highWhiskerColor: string, highWhiskerLineWidth: number, interQuartileRangeLineColor: string, interQuartileRangeFillColor: string, interQuartileRangeLineWidth: number, lowWhiskerColor: string, lowWhiskerLineWidth: number, medianColor: string, medianLineWidth: number, population: number[], width: number);
/**
* Compute the amount of white space between the canvas vertical boundaries
*
* @param {number} width
* @returns {number}
*/
static calculateX_axis_canvas_gap(width: number): number;
/**
* Computer the whisker height
*
* @param {number} height
* @returns {number}
*/
static calculateWhiskerHeight(height: number): number;
/**
* Computer the median height
*
* @param {number} height
* @returns {number}
*/
static calculateMedianHeight(height: number): number;
/**
* Compute the distance to move the x-axis
*
* @param {number} height
* @returns {number}
*/
static calculateX_axis_translation(height: number): number;
static helloWorld(): string;
/**
* Sort an array
*
* @param {number[]} array
* @returns {number[]}
*/
static sortArray(array: number[]): number[];
/**
* Calculate the median of a sorted array
* @param {number[]} population
* @returns {number}
*/
static calculateMedian(population: number[]): number;
/**
* Calculate the first quartile of a sorted array
* @param {number[]} population
* @returns {number}
*/
static calculateQuartile_1(population: number[]): number;
/**
* Calculate the third quartile of a sorted array
* @param {number[]} population
* @returns {number}
*/
static calculateQuartile_3(population: number[]): number;
draw(): HTMLElement;
_draw_canvas(): HTMLElement;
_draw_svg(): HTMLElement;
_draw_invalid(): HTMLElement;
getDivContainer(insertMe: any): HTMLElement;
/**
* Sparkline Boxplot Mouse Move Handler
* @param $event
* @param canvasEl
*/
handleMouseMove($event: MouseEvent, canvasEl: HTMLElement): void;
handleMouseOut(): void;
}