@nova-ui/dashboards
Version:
Nova Dashboards is a framework designed to provide feature developers with a common solution for presenting data coming from various sources within a single view, as well as a set of predefined widget visualizations that are 100% configuration-driven and
55 lines (54 loc) • 2.91 kB
TypeScript
import { ChangeDetectorRef, OnChanges, OnDestroy } from "@angular/core";
import { EventBus, IDataSource, IEvent } from "@nova-ui/bits";
import { ChartAssist, ChartPalette, IAccessors, IChartAssistSeries, IValueProvider, IXYScales, Renderer } from "@nova-ui/charts";
import { IHasChangeDetector } from "../../../../types";
import { TimeseriesScalesService } from "../../timeseries-scales.service";
import { ITimeseriesWidgetSeriesData, TimeseriesChartTypes, TimeseriesTransformer, TimeseriesWidgetZoomPlugin } from "../../types";
import { TimeseriesChartComponent } from "../timeseries-chart.component";
import * as i0 from "@angular/core";
interface ITransformerDescription {
displayName: string;
transformer?: (data: ITimeseriesWidgetSeriesData[], hasPercentile?: boolean) => ITimeseriesWidgetSeriesData[];
}
export declare abstract class XYChartComponent extends TimeseriesChartComponent implements OnChanges, OnDestroy, IHasChangeDetector {
protected eventBus: EventBus<IEvent>;
timeseriesScalesService: TimeseriesScalesService;
changeDetector: ChangeDetectorRef;
chartAssist: ChartAssist;
valueAccessorKey: string;
collectionId: string;
zoomPlugins: TimeseriesWidgetZoomPlugin[];
protected renderer: Renderer<IAccessors>;
protected accessors: IAccessors;
timeseriesChartTypes: typeof TimeseriesChartTypes;
summarySerie: IChartAssistSeries<IAccessors>;
summaryLegendBcgColor: string;
summaryLegendColor: string;
transformers: Map<TimeseriesTransformer, ITransformerDescription>;
constructor(eventBus: EventBus<IEvent>, dataSource: IDataSource, timeseriesScalesService: TimeseriesScalesService, changeDetector: ChangeDetectorRef);
protected abstract createAccessors(colorProvider: IValueProvider<string>): IAccessors;
protected abstract createChartAssist(palette: ChartPalette): ChartAssist;
mapSeriesSet(data: any[], scales: IXYScales): IChartAssistSeries<IAccessors>[];
/** Checks if legend should be shown. */
hasLegend(): boolean;
/** Checks if legend should be aligned to right. */
legendShouldBeAlignedRight(): boolean;
onPrimaryDescClick(event: MouseEvent, legendSeries: IChartAssistSeries<IAccessors>): void;
/** Updates chart data. */
protected updateChartData(): void;
/**
* Initialize chart
*/
protected buildChart(): void;
/**
* Subscribe to chart events and emit
*/
protected setupInteraction(): void;
displayLegendMenu(): boolean;
displayDeleteButton(): boolean;
transformData(metricId: string, trId: TimeseriesTransformer): void;
getLegendValue(legendSeries: IChartAssistSeries<IAccessors<any>>, valueAccessorKey: string): string | number | undefined;
static ɵfac: i0.ɵɵFactoryDeclaration<XYChartComponent, [null, { optional: true; }, null, null]>;
static ɵprov: i0.ɵɵInjectableDeclaration<XYChartComponent>;
}
export {};