@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
64 lines (63 loc) • 1.99 kB
TypeScript
import { LayerConfig } from '../../base/layer';
import ViewLayer, { ViewConfig } from '../../base/view-layer';
import { ICatAxis, ITimeAxis, IValueAxis } from '../../interface/config';
import './animation/clipIn-with-data';
import './apply-responsive/theme';
import './component/label/line-label';
import './component/label/point-label';
import './theme';
export interface LineStyle {
opacity?: number;
lineDash?: number[];
lineJoin?: 'bevel' | 'round' | 'miter';
lineCap?: 'butt' | 'round' | 'square';
}
export interface PointStyle {
lineDash?: number[];
lineWidth?: number;
opacity?: string;
fill?: string;
stroke?: string;
}
export interface LineViewConfig extends ViewConfig {
/** 分组字段 */
seriesField?: string;
/** 是否平滑 */
smooth?: boolean;
/** 是否连接空数据 */
connectNulls?: boolean;
/** 折线extra图形样式 */
lineStyle?: LineStyle | ((...args: any[]) => LineStyle);
/** 折线数据点图形样式 */
point?: {
visible?: boolean;
shape?: string;
size?: number;
color?: string;
style?: PointStyle;
};
xAxis?: IValueAxis | ICatAxis | ITimeAxis;
yAxis?: IValueAxis;
}
export interface LineLayerConfig extends LineViewConfig, LayerConfig {
}
export default class LineLayer<T extends LineLayerConfig = LineLayerConfig> extends ViewLayer<T> {
static getDefaultOptions(): Partial<LineLayerConfig>;
line: any;
point: any;
type: string;
getOptions(props: T): any;
afterRender(): void;
protected geometryParser(dim: any, type: any): any;
protected scale(): void;
protected coord(): void;
protected addGeometry(): void;
private addLine;
protected addPoint(): void;
protected label(): void;
protected animation(): void;
protected applyInteractions(): void;
protected parseEvents(eventParser: any): void;
private applyResponsive;
private singleLineLabelCheck;
}