@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
68 lines (67 loc) • 1.78 kB
TypeScript
import { Group, BBox, Shape } from '@antv/g';
import { View } from '@antv/g2';
export interface MatrixLegendConfig {
visible?: boolean;
position?: string;
width?: number;
height?: number;
text?: {
style?: any;
formatter?: () => string;
};
ticklineStyle?: any;
anchorStyle?: any;
triggerOn?: string;
}
export interface IMatrixLegend extends MatrixLegendConfig {
view: View;
plot: any;
}
export default class MatrixLegend {
options: IMatrixLegend;
container: Group;
anchor: Shape;
afterRender: boolean;
destroyed: boolean;
protected view: View;
protected layout: string;
protected width: number;
protected height: number;
protected position: string;
protected x: number;
protected y: number;
protected dataSlides: any;
protected colorScale: any;
constructor(cfg: IMatrixLegend);
init(): void;
render(): void;
hide(): void;
show(): void;
clear(): void;
destroy(): void;
getBBox(): BBox;
protected renderVertical(min: number, max: number, colors: string[]): void;
protected renderHorizontal(min: number, max: number, colors: string[]): void;
protected getLayout(): "horizontal" | "vertical";
protected getDefaultWidth(): any;
protected getDefaultHeight(): any;
protected legendLayout(): void;
protected getDefaultOptions(): {
text: {
style: {
fontSize: number;
fill: string;
};
};
ticklineStyle: {
lineWidth: number;
stroke: string;
};
anchorStyle: {
fill: string;
};
triggerOn: string;
};
protected addInteraction(): void;
private moveAnchor;
}