UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

84 lines (83 loc) 3.42 kB
import { EColorMode } from '@qn-pandora/pandora-app-component'; import { IKeyValues } from '../../../../models/base'; import { ChartType, IBaseLine, ETooltipType, IMarkLineType } from '../../../../constants/chart-style'; import Compare, { ICompare } from '../components/compare'; import MainAxis, { IMainAxis } from '../components/main-axis'; import CrossAxis, { ICrossAxis } from '../components/cross-axis'; import CrossAxis2, { ICrossAxis2 } from '../components/cross-axis-2'; import TwoDLegend, { ITwoDLegend } from '../components/two-d-legend'; import Colors, { IColors } from '../components/colors-style'; import ILegendChartStyleService from './legend'; import ChartStyleService, { IChartStyleInitOption, IChartStyleOption } from './base'; export interface ITwoDChartStyle extends IChartStyleOption { chartType: ChartType; mainAxis: IMainAxis; crossAxis1: ICrossAxis; crossAxis2: ICrossAxis2; legend: ITwoDLegend; colors: IColors; colorMode: EColorMode; compare: ICompare; baseLine: IBaseLine[]; showToolBox: boolean; tooltipType: ETooltipType; tooltipAppendToBody?: boolean; markLine?: IMarkLineType; } export default abstract class TwoDChartStyleService<T extends ITwoDChartStyle = ITwoDChartStyle> extends ChartStyleService<T> implements ILegendChartStyleService<TwoDLegend> { static getChartInitStyle: typeof getChartInitStyle; useCrossAxis2: boolean; abstract readonly chartType: ChartType; abstract option: T; mainAxis: MainAxis; crossAxis1: CrossAxis; crossAxis2: CrossAxis2; legend: TwoDLegend; colors: Colors; compare: Compare; baseLine: IBaseLine[]; colorMode: EColorMode; showToolBox: boolean; tooltipType: ETooltipType; tooltipAppendToBody: boolean; markLine?: IMarkLineType; getOptions(): ITwoDChartStyle; get contextOption(): { legend: ITwoDLegend; metrics: string[]; buckets: string[]; chartType: ChartType; mainAxis: IMainAxis; crossAxis1: ICrossAxis; crossAxis2: ICrossAxis2; colors: IColors; colorMode: EColorMode; compare: ICompare; baseLine: IBaseLine<any>[]; showToolBox: boolean; tooltipType: ETooltipType; tooltipAppendToBody?: boolean | undefined; markLine?: IMarkLineType | undefined; displayColors?: import("./base").IColor[] | undefined; }; setBaseLine(baseLine: IBaseLine[]): void; setColorMode(colorMode: EColorMode): void; setShowToolBox(showToolBox: boolean): void; setTooltipType(tooltipType: ETooltipType): void; setMarkLine(markLine: IMarkLineType): void; constructor(option: T); /** * 批量修改styleOption装饰过的值 * WARNING: 在父级类中使用请注意,此赋值方法也会识别到子类中styleOption装饰的 * @param obj 赋值操作的map映射 * @param allowNil 对obj中的nil值是否进行赋值操作 */ set(obj: Partial<T>, allowNil?: boolean): void; /** * 单独修改某个styleOption装饰过的值 * @param key 被装饰过的值的名称,如果名称不存在,或者未被装饰则函数调用无效 * @param value 值 */ set<K extends keyof T>(key: K, value: T[K]): void; } export declare function getChartInitStyle(option: IChartStyleInitOption, initFirst?: boolean, useCrossAxis2?: boolean): IKeyValues;