@rdkmaster/jigsaw-labs
Version:
Jigsaw, the next generation component set for RDK
759 lines (758 loc) • 24.8 kB
TypeScript
import { TableDataBase } from "./table-data";
import { EchartLegend, EchartOptions, EchartSeriesItem, EchartTitle, EchartToolbox, EchartTooltip, EchartXAxis, EchartYAxis } from "./echart-types";
import { GraphDataField, GraphDataHeader, GraphDataMatrix } from "./graph-data";
import { AggregateAlgorithm, Grouped } from "../utils/data-collection-utils";
export declare abstract class AbstractModeledGraphTemplate {
abstract getInstance(): EchartOptions;
themes?: {
name: string;
theme: {
color: string[];
textStyle: {
fontWeight: string;
fontStyle: string;
fontFamily: string;
fontFamily2: string;
};
title: {
left: string;
top: string;
backgroundColor: string;
borderColor: string;
borderWidth: number;
padding: number;
itemGap: number;
textStyle: {
fontSize: number;
fontWeight: string;
fontStyle: string;
fontFamily: string;
};
subtextStyle: {
color: string;
};
};
legend: {
orient: string;
left: string;
top: string;
backgroundColor: string;
borderColor: string;
borderWidth: number;
padding: number;
itemGap: number;
itemWidth: number;
itemHeight: number;
};
dataRange: {
orient: string;
x: string;
y: string;
backgroundColor: string;
borderColor: string;
borderWidth: number;
padding: number;
itemGap: number;
itemWidth: number;
itemHeight: number;
splitNumber: number;
color: string[];
};
toolbox: {
orient: string;
x: string;
y: string;
color: string[];
backgroundColor: string;
borderColor: string;
borderWidth: number;
padding: number;
itemGap: number;
itemSize: number;
featureImageIcon: {};
featureTitle: {
mark: string;
markUndo: string;
markClear: string;
dataZoom: string;
dataZoomReset: string;
dataView: string;
lineChart: string;
barChart: string;
restore: string;
saveAsImage: string;
};
};
tooltip: {
trigger: string;
showDelay: number;
hideDelay: number;
transitionDuration: number;
backgroundColor: string;
borderColor: string;
borderRadius: number;
borderWidth: number;
padding: number;
axisPointer: {
type: string;
lineStyle: {
color: string;
width: number;
type: string;
};
shadowStyle: {
width: string;
color: string;
};
};
color: string;
};
dataZoom: {
orient: string;
backgroundColor: string;
dataBackgroundColor: string;
fillerColor: string;
handleColor: string;
};
grid: {
x: number;
y: number;
x2: number;
y2: number;
backgroundColor: string;
borderWidth: number;
borderColor: string;
};
categoryAxis: {
position: string;
nameLocation: string;
boundaryGap: boolean;
axisLine: {
show: boolean;
lineStyle: {
color: string;
width: number;
type: string;
};
};
axisTick: {
show: boolean;
interval: string;
inside: boolean;
length: number;
lineStyle: {
width: number;
};
};
axisLabel: {
show: boolean;
interval: string;
rotate: number;
margin: number;
color: string;
};
splitLine: {
show: boolean;
lineStyle: {
color: string[];
width: number;
type: string;
};
};
splitArea: {
show: boolean;
areaStyle: {
color: string[];
};
};
};
valueAxis: {
position: string;
nameLocation: string;
color: string[];
fontSize: number;
boundaryGap: number[];
splitNumber: number;
axisLine: {
show: boolean;
lineStyle: {
color: string;
width: number;
type: string;
};
};
axisTick: {
show: boolean;
inside: boolean;
length: number;
lineStyle: {
color: string;
width: number;
};
};
axisLabel: {
show: boolean;
rotate: number;
margin: number;
color: string;
formatter: any;
};
splitLine: {
show: boolean;
lineStyle: {
color: string[];
width: number;
type: string;
};
};
splitArea: {
show: boolean;
areaStyle: {
color: string[];
};
};
};
polar: {
center: string[];
radius: string;
startAngle: number;
splitNumber: number;
name: {
show: boolean;
color: string;
};
axisLine: {
show: boolean;
lineStyle: {
color: string;
width: number;
type: string;
};
};
axisLabel: {
show: boolean;
color: string;
};
splitArea: {
show: boolean;
areaStyle: {
color: string[];
};
};
splitLine: {
show: boolean;
lineStyle: {
width: number;
color: string;
};
};
};
bar: {
barMinHeight: number;
barGap: string;
barCategoryGap: string;
itemStyle: {
normal: {
barBorderColor: string;
barBorderWidth: number;
label: {
show: boolean;
};
};
emphasis: {
barBorderColor: string;
barBorderWidth: number;
label: {
show: boolean;
};
};
};
};
line: {
calculable: boolean;
itemStyle: {
normal: {
label: {
show: boolean;
};
lineStyle: {
width: number;
type: string;
shadowColor: string;
shadowBlur: number;
shadowOffsetX: number;
shadowOffsetY: number;
};
};
emphasis: {
label: {
show: boolean;
};
};
};
smooth: boolean;
symbolSize: number;
showAllSymbol: boolean;
};
k: {
itemStyle: {
normal: {
color: string;
color0: string;
lineStyle: {
width: number;
color: string;
color0: string;
};
};
emphasis: {};
};
};
scatter: {
symbolSize: number;
large: boolean;
largeThreshold: number;
itemStyle: {
normal: {
label: {
show: boolean;
};
};
emphasis: {
label: {
show: boolean;
};
};
};
};
radar: {
itemStyle: {
normal: {
label: {
show: boolean;
};
lineStyle: {
width: number;
type: string;
};
};
emphasis: {
label: {
show: boolean;
};
};
};
symbolSize: number;
};
pie: {
center: string[];
radius: (string | number)[];
clockWise: boolean;
startAngle: number;
minAngle: number;
selectedOffset: number;
hoverAnimation: boolean;
calculable: boolean;
itemStyle: {
normal: {
borderColor: string;
borderWidth: number;
label: {
show: boolean;
position: string;
};
labelLine: {
show: boolean;
length: number;
lineStyle: {
width: number;
type: string;
};
};
};
emphasis: {
borderColor: string;
borderWidth: number;
label: {
show: boolean;
};
labelLine: {
show: boolean;
length: number;
lineStyle: {
width: number;
type: string;
};
};
};
};
};
map: {
mapType: string;
mapLocation: {
x: string;
y: string;
};
showLegendSymbol: boolean;
itemStyle: {
normal: {
borderColor: string;
borderWidth: number;
areaStyle: {
color: string;
};
label: {
show: boolean;
color: string;
};
};
emphasis: {
borderColor: string;
borderWidth: number;
areaStyle: {
color: string;
};
label: {
show: boolean;
color: string;
};
};
};
};
force: {
minRadius: number;
maxRadius: number;
density: number;
attractiveness: number;
initSize: number;
centripetal: number;
coolDown: number;
itemStyle: {
normal: {
label: {
show: boolean;
};
nodeStyle: {
brushType: string;
color: string;
strokeColor: string;
};
linkStyle: {
strokeColor: string;
};
};
emphasis: {
label: {
show: boolean;
};
nodeStyle: {};
linkStyle: {};
};
};
};
chord: {
radius: string[];
center: string[];
padding: number;
sort: string;
sortSub: string;
startAngle: number;
clockWise: boolean;
showScale: boolean;
showScaleText: boolean;
itemStyle: {
normal: {
label: {
show: boolean;
};
lineStyle: {
width: number;
color: string;
};
chordStyle: {
lineStyle: {
width: number;
color: string;
};
};
};
emphasis: {
lineStyle: {
width: number;
color: string;
};
chordStyle: {
lineStyle: {
width: number;
color: string;
};
};
};
};
};
island: {
r: number;
calculateStep: number;
};
markPoint: {
symbol: string;
symbolSize: number;
itemStyle: {
normal: {
borderWidth: number;
label: {
show: boolean;
position: string;
};
};
emphasis: {
label: {
show: boolean;
};
};
};
};
markLine: {
symbol: string[];
symbolSize: number[];
itemStyle: {
normal: {
borderWidth: number;
label: {
position: string;
fontSize: number;
};
lineStyle: {
type: string;
shadowColor: string;
shadowBlur: number;
shadowOffsetX: number;
shadowOffsetY: number;
};
};
emphasis: {
label: {
show: boolean;
};
lineStyle: {};
};
};
};
symbolList: string[];
loadingText: string;
calculable: boolean;
calculableColor: string;
calculableHolderColor: string;
nameConnector: string;
valueConnector: string;
animation: boolean;
animationThreshold: number;
addDataAnimation: boolean;
animationDuration: number;
animationEasing: string;
};
}[];
title?: EchartTitle;
tooltip?: EchartTooltip;
toolbox?: EchartToolbox;
legend?: EchartLegend;
}
export declare abstract class AbstractModeledGraphData extends TableDataBase {
protected abstract createChartOptions(): EchartOptions;
/**
* 图形的数据,二维数组。
*/
data: GraphDataMatrix;
/**
* 图形的列字段描述。
*/
header: GraphDataHeader;
/**
* 图形的列字段。
*/
field: GraphDataField;
/**
* 一个适合输入给 echarts 的参数,由本类的子类自动构建出来
*/
options: EchartOptions;
/**
* 图形个关键配置项的模板
*/
template: AbstractModeledGraphTemplate;
protected constructor(data?: GraphDataMatrix, header?: GraphDataHeader, field?: GraphDataField);
getIndex(field: string): number;
protected getRealDimensions(dimField: string, dimensions: Dimension[], usingAllDimensions: boolean): Dimension[];
protected pruneData(records: (string | number)[][], dimIndex: number, dimensions: Dimension[], indicators: Indicator[]): string[][];
}
export declare class Dimension {
name?: string;
yAxisIndex?: 0 | 1;
stack?: string;
shade?: 'bar' | 'line' | 'area';
constructor(name?: string);
}
export declare class Indicator {
name?: string;
field?: string;
index?: number;
yAxisIndex?: 0 | 1;
stack?: string;
shade?: 'bar' | 'line' | 'area';
defaultValue?: number;
aggregateBy?: AggregateAlgorithm;
constructor(field?: string);
}
export declare abstract class ModeledRectangularTemplate extends AbstractModeledGraphTemplate {
xAxis?: EchartXAxis;
yAxis1?: EchartYAxis;
yAxis2?: EchartYAxis;
seriesItem?: EchartSeriesItem;
}
export declare class BasicModeledRectangularTemplate extends ModeledRectangularTemplate {
getInstance(): EchartOptions;
tooltip: {
trigger: string;
axisPointer: {
type: string;
crossStyle: {
color: string;
};
};
};
toolbox: {
feature: {
dataView: {
show: boolean;
readOnly: boolean;
};
magicType: {
show: boolean;
type: string[];
};
restore: {
show: boolean;
};
saveAsImage: {
show: boolean;
};
};
};
legend: {
data: any;
};
xAxis: {
type: string;
axisPointer: {
type: string;
};
};
yAxis1: {
type: string;
axisLabel: {
formatter: string;
};
};
yAxis2: {
type: string;
axisLabel: {
formatter: string;
};
};
seriesItem: {
type: string;
data: any;
};
}
export declare class ModeledRectangularGraphData extends AbstractModeledGraphData {
template: ModeledRectangularTemplate;
xAxis: {
field?: string;
style?: EchartXAxis;
};
yAxis1: EchartYAxis;
yAxis2: EchartYAxis;
dimensionField: string;
dimensions: Dimension[];
usingAllDimensions: boolean;
indicators: Indicator[];
legend: EchartLegend;
title: EchartTitle;
constructor(data?: GraphDataMatrix, header?: GraphDataHeader, field?: GraphDataField);
private _options;
readonly options: EchartOptions;
protected createChartOptions(): EchartOptions;
/**
* 单指标多维度
*/
protected createMultiDimensionOptions(dimensions: Dimension[]): EchartOptions;
/**
* 确保给定的数据中,每一个给定的维度,都有且只有一个记录,缺少的记录用默认值补齐,多出的记录删除, 重复的记录用聚集算法聚集,
* 并且要保证每组中的维度顺序一致。
*
* @param xAxisIndex
* @param dimIndex
* @param dimensions
*/
protected pruneAllData(xAxisIndex: number, dimIndex: number, dimensions: Dimension[]): Grouped;
protected createMultiKPIOptions(dim: Dimension): EchartOptions;
}
export declare class PieSeries {
dimensionField: string;
dimensions: Dimension[];
usingAllDimensions: boolean;
indicators: Indicator[];
radius: number[];
center: number[];
name?: string;
model?: any[];
constructor(name?: string);
}
export declare abstract class ModeledPieTemplate extends AbstractModeledGraphTemplate {
seriesItem?: EchartSeriesItem;
}
export declare class BasicModeledPieTemplate extends ModeledRectangularTemplate {
getInstance(): EchartOptions;
title: {
x: string;
textStyle: {};
subtextStyle: {};
};
tooltip: {
trigger: string;
formatter: string;
};
legend: {
type: string;
orient: string;
right: number;
top: number;
bottom: number;
data: any;
};
seriesItem: {
type: string;
data: any;
name: string;
radius: string[];
center: string[];
itemStyle: {
emphasis: {
shadowBlur: number;
shadowOffsetX: number;
shadowColor: string;
};
};
};
}
export declare class ModeledPieGraphData extends AbstractModeledGraphData {
constructor(data?: GraphDataMatrix, header?: GraphDataHeader, field?: GraphDataField);
template: ModeledPieTemplate;
series: PieSeries[];
legend: EchartLegend;
title: EchartTitle;
private _options;
readonly options: EchartOptions;
protected createChartOptions(): EchartOptions;
private _mergeLegend(legendObject, candidates);
refresh(): void;
}