You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.1 KiB

4 months ago
import type { RuntimeContext } from '../runtime/types';
import { BasePlugin, BasePluginOptions } from './base-plugin';
/**
* <zh/> 线
*
* <en/> Grid line options
*/
export interface GridLineOptions extends BasePluginOptions {
/**
* <zh/> 线
*
* <en/> Grid line color
* @defaultValue '#0001'
*/
stroke?: string;
/**
* <zh/> 线
*
* <en/> Grid line width
* @defaultValue 1
*/
lineWidth?: number | string;
/**
* <zh/>
*
* <en/> The size of a single grid
* @defaultValue 20
*/
size?: number;
/**
* <zh/>
*
* <en/> Whether to show the border
* @defaultValue true
*/
border?: boolean;
/**
* <zh/> 线
*
* <en/> Border line width
* @defaultValue 1
*/
borderLineWidth?: number;
/**
* <zh/>
*
* <en/> Border color
* @defaultValue '#0001'
* @remarks
* <zh/> [CSS border-color](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-color)
*
* <en/> Refer to [CSS border-color](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color) for the complete property definition
*/
borderStroke?: string;
/**
* <zh/>
*
* <en/> Border style
* @defaultValue 'solid'
* @remarks
* <zh/> [CSS border-style](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-style)
*
* <en/> Refer to [CSS border-style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) for the complete property definition
*/
borderStyle?: string;
/**
* <zh/>
*
* <en/> Whether to follow with the graph
* @defaultValue false
*/
follow?: boolean | {
/**
* <zh/>
*
* <en/> Whether to follow the graph translation
*/
translate?: boolean;
/**
* <zh/>
*
* <en/> Whether to follow the graph zoom
*/
zoom?: boolean;
};
}
/**
* <zh/> 线
*
* <en/> Grid line
* @remarks
* <zh/> 线
*
* <en/> Grid line plugin, often used to auxiliary drawing
*/
export declare class GridLine extends BasePlugin<GridLineOptions> {
static defaultOptions: Partial<GridLineOptions>;
private $element;
private offset;
private currentScale;
private baseSize;
constructor(context: RuntimeContext, options: GridLineOptions);
/**
* <zh/> 线
*
* <en/> Update the configuration of the grid line
* @param options - <zh/> | <en/> options
* @internal
*/
update(options: Partial<GridLineOptions>): void;
private bindEvents;
private updateStyle;
private updateOffset;
private followZoom;
private followTranslate;
private parseFollow;
private onTransform;
/**
* <zh/> 线
*
* <en/> Destroy the grid line
* @internal
*/
destroy(): void;
}