@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
132 lines (131 loc) • 3.83 kB
TypeScript
import { ITimeFramePresetDictionary, UnitOption } from "@nova-ui/bits";
import { TimeseriesZoomPlugin, ZoomPlugin } from "@nova-ui/charts";
import { IProperties } from "../../types";
import { LegendPlacement } from "../../widget-types/common/widget/legend";
export interface ITimeseriesWidgetConfig {
interaction: null | "series" | "dataPoints";
displayedSeries: ITimeseriesWidgetSeries[];
legendPlacement: LegendPlacement;
leftAxisLabel?: string;
timeFramePickerPresets?: ITimeFramePresetDictionary;
enableZoom: boolean;
chartColors?: string[];
preset: TimeseriesChartPreset;
scales: ITimeseriesScalesConfig;
units: UnitOption;
collectionId?: string;
leftYAxisUnits?: UnitOption;
rightYAxisUnits?: UnitOption;
gridConfig?: {
[key: string]: any;
};
hasAdjacentChart?: boolean;
groupUniqueId?: string;
allowLegendMenu?: boolean;
metricIds?: string;
realTimeIds?: string[];
type?: number;
projectType?: TimeseriesWidgetProjectType;
}
export interface ITimeseriesWidgetSeries {
id: string;
label: string;
selectedSeriesId: string;
}
export interface ITimeseriesWidgetData<T = ITimeseriesWidgetSeriesData> {
id: string;
name: string;
description: string;
data: T[];
rawData?: T[];
transformer?: (data: T[], hasPercentile?: boolean) => T[];
link?: string;
secondaryLink?: string;
metricUnits?: UnitOption;
}
export interface ITimeseriesWidgetSeriesData {
x: any;
y: any;
[key: string]: any;
}
export interface ITimeseriesWidgetStatusData extends ITimeseriesWidgetSeriesData {
thick?: boolean;
color?: string;
icon?: string;
}
export interface ITimeseriesOutput<T = ITimeseriesWidgetSeriesData> {
series: ITimeseriesWidgetData<T>[];
summarySerie?: ITimeseriesWidgetData<T>;
}
export declare enum TimeseriesInteractionType {
DataPoints = "dataPoints",
Series = "series",
Values = "values"
}
/** Configuration for a chart preset */
export interface IChartPreset {
componentType: string;
}
/**
* Configuration of scales for a x/y chart
*/
export interface ITimeseriesScalesConfig {
x: ITimeseriesScaleConfig;
y: ITimeseriesScaleConfig;
yRight?: ITimeseriesScaleConfig;
}
/**
* Configuration of a scale for timeseries widget
*/
export interface ITimeseriesScaleConfig {
/** Type of the scale */
type: TimeseriesScaleType;
/** Additional properties of the scale */
properties?: IProperties;
}
/**
* List of supported scale types for the timeseries widget
*/
export declare enum TimeseriesScaleType {
/** Continous time scale */
Time = "time",
/** Time interval scale */
TimeInterval = "timeInterval",
/** Numeric linear scale */
Linear = "linear"
}
/** Enumeration of chart presets supported by the timeseries widget */
export declare enum TimeseriesChartPreset {
Line = "line",
StackedArea = "stackedArea",
StackedPercentageArea = "stackedPercentageArea",
StackedBar = "stackedBar",
StatusBar = "statusBar"
}
/** Enumeration of timeseries chart types recieved from the backend */
export declare enum TimeseriesChartTypes {
line = 1,
counter = 2,
event = 3,
alert = 4,
status = 5,
multi = 6,
dpaWaitTime = 7
}
export declare enum TimeseriesTransformer {
None = "none",
Normalize = "normalize",
ChangePoint = "changePoint",
Difference = "difference",
Linear = "linear",
PercentileStd = "percentileStd",
Smoothing = "smoothing",
LoessStandardize = "loessStandardize",
Standardize = "standardize",
FloatingAverage = "floatingAverage"
}
export declare enum TimeseriesWidgetProjectType {
ModernDashboard = 0,
PerfstackApp = 1
}
export type TimeseriesWidgetZoomPlugin = TimeseriesZoomPlugin | ZoomPlugin;