zz-chart
Version:
Alauda Chart components by Alauda Frontend Team
102 lines (101 loc) • 2.5 kB
TypeScript
/// <reference types="react" resolution-mode="require"/>
/// <reference types="web" />
import UPlot from 'uplot';
import { Data, Size } from '../types/index.js';
import { ViewStrategy } from './abstract.js';
import { Quadtree } from './quadtree.js';
/**
* 渲染策略
* uPlot 渲染图表
*/
export declare class UPlotViewStrategy extends ViewStrategy {
shapes: ("line" | "area" | "bar" | "point")[];
qt: Quadtree;
private cursor;
get name(): string;
get component(): string[];
private uPlot;
get isElementAction(): boolean;
private recordActive;
activeId: number;
init(): void;
private get transposed();
/**
* 监听 chart 事件
*/
getChartEvent(): void;
render(size?: Size): void;
/**
* 修改 uPlot 视图大小
* @param size 宽 高
*/
private changeSize;
/**
* 获取 uPlot 配置
* 将原始 option 转换 uPlot 配置
*/
private readonly getOption;
/**
* 获取数据
* 原始数据转换为 uPlot 数据
* @returns uPlot.AlignedData
*/
getData(): uPlot.AlignedData;
/**
* 将数据处理成 uPlot 数据格式
* @param data 源数据
* @returns uPlot 数据源哥是
*/
handleData(data: Data): uPlot.AlignedData;
/**
* 获取 series
* @param data 源数据
* @returns uPlot series
*/
getSeries(): any[];
/**
* 获取 shape uPlot 配置
* @returns uPlot option
*/
getShapeChartOption(): {};
getInteractionOption(): {
cursor: {
bind: {
mousedown: (_u: uPlot, _t: HTMLElement, handler: (e: MouseEvent) => null) => (e: MouseEvent) => void;
};
drag: {
x: boolean;
};
};
};
/**
* 获取主题 配置
*/
getThemeOption(): {
axes: ({
stroke: () => string;
ticks: {
stroke: () => string;
};
border: {
stroke: () => string;
};
grid?: undefined;
} | {
stroke: () => string;
grid: {
stroke: () => string;
};
ticks: {
stroke: () => string;
};
border: {
stroke: () => string;
};
})[];
};
getUPlotChart(): UPlot;
private getPlugins;
private getTooltipPlugin;
destroy(): void;
}