UNPKG

2.78 kBTypeScriptView Raw
1import type { RuntimeContext } from '../runtime/types';
2import { BasePlugin, BasePluginOptions } from './base-plugin';
3/**
4 * <zh/> 网格线配置项
5 *
6 * <en/> Grid line options
7 */
8export interface GridLineOptions extends BasePluginOptions {
9 /**
10 * <zh/> 网格线颜色
11 *
12 * <en/> Grid line color
13 * @defaultValue '#0001'
14 */
15 stroke?: string;
16 /**
17 * <zh/> 网格线宽
18 *
19 * <en/> Grid line width
20 * @defaultValue 1
21 */
22 lineWidth?: number | string;
23 /**
24 * <zh/> 单个网格的大小
25 *
26 * <en/> The size of a single grid
27 * @defaultValue 20
28 */
29 size?: number;
30 /**
31 * <zh/> 是否显示边框
32 *
33 * <en/> Whether to show the border
34 * @defaultValue true
35 */
36 border?: boolean;
37 /**
38 * <zh/> 边框线宽
39 *
40 * <en/> Border line width
41 * @defaultValue 1
42 */
43 borderLineWidth?: number;
44 /**
45 * <zh/> 边框颜色
46 *
47 * <en/> Border color
48 * @defaultValue '#0001'
49 * @remarks
50 * <zh/> 完整属性定义参考 [CSS border-color](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-color)
51 *
52 * <en/> Refer to [CSS border-color](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color) for the complete property definition
53 */
54 borderStroke?: string;
55 /**
56 * <zh/> 边框样式
57 *
58 * <en/> Border style
59 * @defaultValue 'solid'
60 * @remarks
61 * <zh/> 完整属性定义参考 [CSS border-style](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-style)
62 *
63 * <en/> Refer to [CSS border-style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) for the complete property definition
64 */
65 borderStyle?: string;
66 /**
67 * <zh/> 是否跟随图移动
68 *
69 * <en/> Whether to follow with the graph
70 * @defaultValue false
71 */
72 follow?: boolean;
73}
74/**
75 * <zh/> 网格线
76 *
77 * <en/> Grid line
78 * @remarks
79 * <zh/> 网格线插件,多用于辅助绘图
80 *
81 * <en/> Grid line plugin, often used to auxiliary drawing
82 */
83export declare class GridLine extends BasePlugin<GridLineOptions> {
84 static defaultOptions: Partial<GridLineOptions>;
85 private $element;
86 private offset;
87 constructor(context: RuntimeContext, options: GridLineOptions);
88 /**
89 * <zh/> 更新网格线配置
90 *
91 * <en/> Update the configuration of the grid line
92 * @param options - <zh/> 配置项 | <en/> options
93 * @internal
94 */
95 update(options: Partial<GridLineOptions>): void;
96 private bindEvents;
97 private updateStyle;
98 private updateOffset;
99 private onTransform;
100 /**
101 * <zh/> 销毁网格线
102 *
103 * <en/> Destroy the grid line
104 * @internal
105 */
106 destroy(): void;
107}