UNPKG

@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

47 lines (46 loc) 2.24 kB
import { Subject } from "rxjs"; import { Scales } from "../../core/common/scales/types"; import { D3Selection, IDataSeries, ILasagnaLayer, IPosition, IRendererEventPayload } from "../../core/common/types"; import { ILineRendererConfig, IRenderSeries } from "../types"; import { XYRenderer } from "../xy-renderer"; import { ILineAccessors } from "./line-accessors"; /** * Renderer that is able to draw line chart */ export declare class LineRenderer extends XYRenderer<ILineAccessors> { readonly config: ILineRendererConfig; static UNCLIPPED_DATA_LAYER_NAME: string; static LINE_CAP_CLASS_NAME: string; static getStrokeStyleDashed(width: number): string; static getStrokeStyleDotted(width: number): string; private DEFAULT_CONFIG; /** * Creates an instance of LineRenderer. * @param {ILineRendererConfig} [config={}] Renderer configuration object */ constructor(config?: ILineRendererConfig); /** See {@link Renderer#draw} */ draw(renderSeries: IRenderSeries<ILineAccessors>, rendererSubject: Subject<IRendererEventPayload>): void; /** * When the data contains only one data point with undefined 'x' value, it is considered an infinite line and special approach is applied * * @param renderSeries */ isInfiniteLineData(renderSeries: IRenderSeries<ILineAccessors>): boolean; /** * Renders the line in prepared <path> element * * @param {IRenderSeries<ILineAccessors>} renderSeries * @param {D3Selection} path D3 Selection with <path> element pre-created and pre-styled */ drawLine(renderSeries: IRenderSeries<ILineAccessors>, path: D3Selection<SVGPathElement>): void; /** See {@link Renderer#highlightDataPoint} */ highlightDataPoint(renderSeries: IRenderSeries<ILineAccessors>, dataPointIndex: number, rendererSubject: Subject<IRendererEventPayload>): void; /** See {@link Renderer#getRequiredLayers} */ getRequiredLayers(): ILasagnaLayer[]; /** See {@link Renderer#getDataPointPosition} */ getDataPointPosition(dataSeries: IDataSeries<ILineAccessors>, index: number, scales: Scales): IPosition | undefined; private drawStandardLine; private drawInfiniteLine; private updateLineCaps; }