@nova-ui/charts
Version:
Nova Charts is a library created to provide potential consumers with solutions for various data visualizations that conform with the Nova Design Language. It's designed to solve common patterns identified by UX designers, but also be very flexible so that
48 lines (47 loc) • 2.68 kB
TypeScript
import { Subject } from "rxjs";
import { IScale, Scales } from "../../core/common/scales/types";
import { IDataPoint, IDataSeries, IPosition, IRendererEventPayload } from "../../core/common/types";
import { IRectangleAccessors } from "../accessors/rectangle-accessors";
import { IBarRendererConfig, IRenderSeries } from "../types";
import { XYRenderer } from "../xy-renderer";
/**
* Renderer that is able to draw bar chart
*/
export declare class BarRenderer extends XYRenderer<IRectangleAccessors> {
config: IBarRendererConfig;
/**
* Creates an instance of BarRenderer.
* @param {IBarRendererConfig} [config] Renderer configuration object
*/
constructor(config?: IBarRendererConfig);
static THICK: number;
static THIN: number;
static MIN_BAR_SIZE_FOR_ICON: number;
static MIN_BAR_THICKNESS: number;
static readonly BAR_RECT_CLASS = "bar";
DEFAULT_CONFIG: IBarRendererConfig;
readonly barContainerClass = "bar-container";
/** See {@link Renderer#draw} */
draw(renderSeries: IRenderSeries<IRectangleAccessors>, rendererSubject: Subject<IRendererEventPayload>): void;
/** See {@link Renderer#getDataPointIndex} */
getDataPointIndex(series: IDataSeries<IRectangleAccessors>, values: {
[p: string]: any;
}, scales: Scales): number;
/** See {@link Renderer#highlightDataPoint} */
highlightDataPoint(renderSeries: IRenderSeries<IRectangleAccessors>, dataPointIndex: number, rendererSubject: Subject<IRendererEventPayload>): void;
/** See {@link Renderer#getDataPointPosition} */
getDataPointPosition(dataSeries: IDataSeries<IRectangleAccessors>, index: number, scales: Scales): IPosition;
getDataPoint(renderSeries: IRenderSeries<IRectangleAccessors>, data: any, i: number): IDataPoint;
filterDataByDomain(data: any[]): any[];
getDomain(data: any[], dataSeries: IDataSeries<IRectangleAccessors>, scaleKey: string, scale: IScale<any>): any[];
protected emitBarClick(renderSeries: IRenderSeries<IRectangleAccessors>, data: any, i: number, rendererSubject: Subject<IRendererEventPayload>): void;
/**
* Returns function to generate attributes to draw bar from dataSeries that typically comes from preprocessor with help of accessors that
* are aware of how to access renderParameters to draw individual bars
* @param dataSeries Series to draw
* @param scales Scales used to draw bars
* Except of bars this is also used for highlights (which may have a bit different values)
*/
protected getAttrsGenerator(dataSeries: IDataSeries<IRectangleAccessors>, scales: Scales): (d: any, i: number) => IPosition;
private getDimensions;
}