@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
139 lines • 5.13 kB
TypeScript
import { AXIS_TYPES, CHART_LINE_TYPES, CHART_RENDER_TYPES, KPIDetails } from '@c8y/ngx-components/datapoint-selector';
import { DateTimeContext } from '@c8y/ngx-components';
import { aggregationType, AlarmStatusType, IMeasurement, ISeries, Severity } from '@c8y/client';
import type { BarSeriesOption, LineSeriesOption, ScatterSeriesOption } from 'echarts';
import { AlarmDetails, EventDetails } from '@c8y/ngx-components/alarm-event-selector';
import { TooltipFormatterCallback } from 'echarts/types/src/util/types';
import { TopLevelFormatterParams } from 'echarts/types/src/component/tooltip/TooltipModel';
import { Interval } from '@c8y/ngx-components/interval-picker';
export type DatapointsGraphKPIDetails = KPIDetails & {
lineType?: DatapointLineType;
renderType?: DatapointChartRenderType;
};
export type DatapointsGraphWidgetConfig = {
activeAlarmTypesOutOfRange?: string[];
aggregation?: aggregationType | null;
alarmsEventsConfigs?: AlarmOrEventExtended[];
datapoints?: DatapointsGraphKPIDetails[] | null;
date?: DateTimeContext;
dateFrom?: Date | null;
dateTo?: Date | null;
displayAggregationSelection?: boolean | null;
displayDateSelection?: boolean | null;
displayMarkedLine?: boolean;
displayMarkedPoint?: boolean;
interval?: Interval['id'] | null;
mergeMatchingDatapoints?: boolean;
forceMergeDatapoints?: boolean;
realtime?: boolean | null;
showLabelAndUnit?: boolean;
showSlider?: boolean | null;
sliderChange?: boolean | null;
widgetInstanceGlobalTimeContext?: boolean | null;
xAxisSplitLines?: boolean | null;
yAxisSplitLines?: boolean | null;
numberOfDecimalPlaces?: number;
};
export type GraphDisplayOptions = {
displayMarkedLine: boolean;
displayMarkedPoint: boolean;
mergeMatchingDatapoints: boolean;
forceMergeDatapoints: boolean;
showLabelAndUnit: boolean;
showSlider: boolean;
showOnlyAlarmsOrEvents?: boolean;
numberOfDecimalPlaces?: number;
};
export type AlarmDetailsExtended = AlarmDetails & {
__hidden?: boolean;
__severity?: SeverityType[];
__status?: AlarmStatusType[];
};
export type EventDetailsExtended = EventDetails & {
__hidden?: boolean;
};
/**
* @description: Extended AlarmOrEvent type which includes properties from the incoming alarms/events. This interface can be used when the expected data can be either events or alarms.
*/
export type AlarmOrEventExtended = AlarmDetailsExtended | EventDetailsExtended;
export type DatapointsGraphWidgetTimeProps = Partial<Pick<DatapointsGraphWidgetConfig, 'interval' | 'dateFrom' | 'dateTo' | 'aggregation' | 'realtime'>>;
export declare enum DATE_SELECTION_EXTENDED {
CONFIG = "config",
DASHBOARD_CONTEXT = "dashboard_context"
}
type DatapointApiValues = ISeries['values'];
export interface DpWithValues extends DatapointsGraphKPIDetails {
values: DatapointApiValues;
}
type DataPointValues = {
min: number;
max: number;
};
export type DpValuesItem = {
time: number;
values: DataPointValues[];
};
export interface MarkPointData {
coord: [string, number | DataPointValues | null];
name: string;
itemType: string;
itemStyle: {
color: string;
};
symbol?: string;
symbolSize?: number;
}
export interface MarkLineData {
xAxis: string | undefined;
itemType: string;
label: {
show: boolean;
formatter: TooltipFormatterCallback<TopLevelFormatterParams> | string;
};
itemStyle: {
color: string;
};
}
export interface TimeContextProps {
temporaryUserSelectedFromDate?: string;
temporaryUserSelectedToDate?: string;
currentDateContextFromDate?: string;
currentDateContextToDate?: string;
realtime?: boolean;
currentDateContextInterval?: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';
aggregation?: aggregationType | null;
}
export type DatapointLineType = (typeof CHART_LINE_TYPES)[number]['val'];
export type EchartsSeriesOptions = LineSeriesOption | ScatterSeriesOption | BarSeriesOption;
export type DatapointAxisType = (typeof AXIS_TYPES)[number]['val'];
export type DatapointChartRenderType = (typeof CHART_RENDER_TYPES)[number]['val'];
export declare const REALTIME_TEXTS: {
readonly ACTIVE: "Realtime active";
readonly INACTIVE: "Realtime inactive";
};
export type DateString = string;
export type SeriesValue = [DateString, number];
export type DatapointRealtimeMeasurements = {
measurement: IMeasurement;
datapoint: DatapointsGraphKPIDetails;
};
export type YAxisOptions = {
showSplitLines: boolean;
mergeMatchingDatapoints: boolean;
forceMergeDatapoints: boolean;
showLabelAndUnit: boolean;
};
export interface SeriesDatapointInfo {
datapointId?: string;
datapointLabel?: string;
datapointUnit?: string;
}
export declare const SEVERITY_LABELS: {
readonly CRITICAL: "CRITICAL";
readonly MAJOR: "MAJOR";
readonly MINOR: "MINOR";
readonly WARNING: "WARNING";
};
export type SeverityType = keyof typeof Severity;
export {};
//# sourceMappingURL=datapoints-graph-widget.model.d.ts.map