@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
205 lines (204 loc) • 7.76 kB
TypeScript
import TwoDChartStyleService from '../../../base-pandora-visualization/services/chart-style/charts/two-d';
import CrossAxis from '../../../base-pandora-visualization/services/chart-style/components/cross-axis';
import MainAxis from '../../../base-pandora-visualization/services/chart-style/components/main-axis';
import { AxisType, EAxisMinMaxMode } from '../../../constants/chart-style';
import { ISeriesPiece } from '../transforms/two-d';
import { EShape } from '../../../constants';
import { IChartDataset } from '@qn-pandora/app-sdk';
import LegendChartStore from './legend-chart';
import { IHoverLabelPoint, ILabelTooltipStore } from '../components/LabelTooltip';
import { IBaseAnalysisChartsProps } from '../constants/model';
export declare const DEFAULT_AXIS_NAME_HEIGHT = 20;
export declare const FORTY_FIVE_DEGREE_RATIO: number;
export declare const NAME_LABEL_MARIN = 12;
export default abstract class TwoDChartStore<T extends TwoDChartStyleService = TwoDChartStyleService> extends LegendChartStore<T> implements ILabelTooltipStore {
hoveredSeries: any;
yAxisLabels: string[];
yAxis2Labels: string[];
xAxisLabels: string[];
hoveredLabel: IHoverLabelPoint | null;
abstract series: any;
abstract getOptions(): any;
readonly WRAP_CHAR_NUM = 15;
get labelUnitTransformer(): (value: any) => any;
get isDateSeries(): boolean;
get showMetricInName(): boolean;
get baseSeries(): ISeriesPiece[][];
get chartOptions(): any;
get mainAxisOptions(): IKeyValues<any>;
get isPercentageChart(): boolean;
get isVerticalChart(): boolean;
get crossAxis1Options(): {
splitLine: {
show: boolean;
lineStyle: {
type: string;
};
};
axisLine: {
show: boolean;
};
axisTick: {
show: boolean;
};
nameLocation: string;
} & IKeyValues<any> & {
name: string;
type: AxisType;
axisLabel: {
showMinLabel: boolean;
formatter: ((value: any) => any) | null;
hideOverlap: boolean;
};
min: string | number | null;
max: string | number | null;
};
get chartDataset(): IChartDataset;
get crossAxis1(): CrossAxis;
get mainAxis(): MainAxis;
get colors(): import("../../../base-pandora-visualization/services/chart-style/components/colors-style").default;
/**
* 可能会影响y轴变化的因子
*/
get yAxisLabelChangeFactors(): any[];
/**
* 可能会影响x轴变化的因子
*/
get xAxisLabelChangeFactors(): any[];
get mainAxisLabelDisplayOption(): {
show: boolean;
interval: string | number;
};
get mainAxisName(): string | null;
get mainAxisMin(): string | number | null;
get mainAxisMax(): string | number | null;
get crossAxis1Min(): string | number | null;
get crossAxis1Max(): string | number | null;
get crossAxisName(): string;
get axisData(): string[];
get timeFormater(): "YYYY-MM-DD HH:mm:ss" | "MM-DD HH:mm:ss" | "HH:mm:ss";
get allSeriesLength(): number;
get crossAxisNameGap(): any;
get crossAxis2NameGap(): any;
get mainAxisNameGap(): number;
get xLabelMaxWidth(): number;
get xLabelMaxHeight(): number;
get xLabelMaxLengthWith45Deg(): number;
get yLabelMaxWidth(): number;
get yLabelMaxHeight(): number;
get yLabelMaxLengthWith45Deg(): number;
get tooltipItemIsRevese(): boolean;
setHoveredLabel(hoveredLabel: IHoverLabelPoint | null): void;
getAxisOriginBoundary(boundType: 'min' | 'max', mode?: EAxisMinMaxMode, bound?: number | null | string): string | number | null | undefined;
getMainAxisBoundary(mainAxis: MainAxis, type: 'min' | 'max'): string | number | null;
getCrossAxisBoundary(crossAxis: CrossAxis | MainAxis, type: 'min' | 'max'): string | number | null;
getAxisBoundary(originBoundary?: number | null | string): string | number | null;
getXLabelMaxLengthWith45Deg(labelsArray: string[][]): number;
toLabelsArray(axisLabels?: any[]): any[];
getLabelMaxWidth(labelsArray: string[][]): number;
getLabelMaxHeight(labelsArray: string[][]): number;
setYAxisLabels(yAxisLabels: string[]): void;
setYAxis2Labels(yAxisLabels: string[]): void;
setXAxisLabels(xAxisLabels: string[]): void;
setHoverSeries(series: any): void;
getYAxisLabels(): any;
getYAxis2Labels(): any;
getXAxisLabels(): any;
/**
* 从echart对象上获取坐标轴的labels
* @param type x轴 or y轴:xAxis、yAxis
*/
private getAxisLabels;
getCrossAxisNameGap(labels?: string[]): any;
getTooltipItem(legend: any, metric: string, value: any, compareDelta: any, unitTransformer: (value: any) => any): string;
percentageChartUnitTransformer(value: any): string;
sortTooltipParams(params: any): any;
tooltipDisplays(params: any, buckets: string[]): string[];
tooltipLegendIcon(color: string, shape?: EShape, isOverlap?: boolean): string;
getTooltipTableCell(v: any, isName: boolean, color: string): string;
tooltipSize(): {
width: number;
height: number;
};
getRealUnitTransfrom(metric?: string): (value: any) => any;
tooltipTableFormatter(params: any, buckets: string[], shape?: EShape): string;
tooltipFormatter(params: any, buckets: string[], shape?: EShape): string;
handleLegendSelectChanged(params: any): void;
mainAxisFormatter(value: any): any;
/**
* 重载图表渲染Ready回调
* @param echart
*/
onChartReadyCallback(echart: any): void;
getMainAxisFormatter(): (params: any) => any;
getAxisLabelWidth(label: string): any;
processSeriesForLog(series?: any[]): number | null;
getDigits(num?: number): number;
handleChartMousemove(params: any): void;
handleChartMouseover(params: any): void;
handleChartMouseout(): void;
isNullData(): boolean;
getGrid(): any;
handleDrillDown(params: any): void;
get rightLineSeries(): {
current: ISeriesPiece[][];
};
get overlapLineSeries(): {
current: ISeriesPiece[][];
};
get independentLineSeries(): {
current: ISeriesPiece[][];
};
get crossAxis2(): import("../../../base-pandora-visualization/services/chart-style/components/cross-axis-2").default;
get crossAxis2Min(): string | number | null;
get crossAxis2Max(): string | number | null;
get crossAxisName2(): string | null;
get crossAxis2Options(): {
splitLine: {
show: boolean;
lineStyle: {
type: string;
};
};
axisLine: {
show: boolean;
};
axisTick: {
show: boolean;
};
nameLocation: string;
} & {
name: string | null;
type: AxisType;
axisLabel: {
showMinLabel: boolean;
formatter: (value: any) => any;
};
nameGap: any;
min: string | number | null;
max: string | number | null;
};
get yAxis2LabelChangeFactors(): any[];
get baseToolBox(): {
show: boolean;
feature: {
dataZoom: {
title: {
zoom: string;
back: string;
};
};
restore: {
title: string;
};
brush: {
show: boolean;
};
};
};
get brushChangeFactors(): any[];
handleLineSeries(sery: any, lineThemeOption: any, useCrossAxis2: boolean): void;
handleBrushStart(): void;
handleBrushEnd(params: any): void;
constructor(getProps: () => IBaseAnalysisChartsProps);
}