UNPKG

27 kBTypeScriptView Raw
1import { AnimateCfg, BBox, IGroup, IShape, Point, ShapeAttrs } from '@antv/g-base';
2export declare type LocationType = 'point' | 'Region' | 'points' | 'circle' | 'none';
3export { Point, BBox };
4/** 用于返回样式 ShapeAttrs 的 Callback 函数定义 */
5declare type ShapeAttrsCallback = (item: any, index: number, items: any[]) => ShapeAttrs;
6/** 对象 */
7export interface LooseObject {
8 [key: string]: any;
9}
10export interface OffsetPoint {
11 offsetX: number;
12 offsetY: number;
13}
14export interface Region {
15 /**
16 * 起始点
17 * @type {Point}
18 */
19 start: Point;
20 /**
21 * 结束点
22 * @type {Point}
23 */
24 end: Point;
25}
26export interface Range {
27 /**
28 * 开始值
29 * @type {number}
30 */
31 min: number;
32 /**
33 * 结束值
34 * @type {number}
35 */
36 max: number;
37}
38/** 文本背景框配置 */
39export interface EnhancedTextBackgroundCfg {
40 /** 文字内边距,同 css 盒模型 */
41 padding?: number | number[];
42 /** 文字包围盒样式 */
43 style?: ShapeAttrs;
44}
45/**
46 * 增强型文本配置:
47 * 1. 可自动缩略
48 * 2. 可绘制背景框
49 */
50export interface EnhancedTextCfg {
51 /** 文本标注内容 */
52 content: string | number;
53 /** 旋转,弧度制 */
54 rotate?: number;
55 /** 文本标注样式 */
56 style?: ShapeAttrs;
57 /** 文字包围盒样式设置 */
58 background?: EnhancedTextBackgroundCfg;
59 /** 文本的最大长度 */
60 maxLength?: number;
61 /** 超出 maxLength 是否自动省略 */
62 autoEllipsis?: boolean;
63 /** 文本在二维坐标系的显示位置,是沿着 x 轴显示 还是沿着 y 轴显示 */
64 isVertical?: boolean;
65 /** 文本截断的位置 */
66 ellipsisPosition?: 'head' | 'middle' | 'tail';
67}
68/**
69 * @interface
70 * 列表选项接口
71 */
72export interface ListItem {
73 /**
74 * 唯一值,用于动画或者查找
75 * @type {string}
76 */
77 id?: string;
78 /**
79 * 名称
80 * @type {string}
81 */
82 name: string;
83 /**
84 * 值
85 * @type {any}
86 */
87 value: any;
88 /**
89 * 图形标记
90 * @type {object|string}
91 */
92 marker?: object | string;
93 [key: string]: any;
94}
95/**
96 * @interface
97 * 栅格项的定义
98 */
99export interface GridItem {
100 /**
101 * 唯一值,用于动画或者查找
102 * @type {string}
103 */
104 id?: string;
105 /**
106 * 栅格线的点集合
107 * @type {Point[]}
108 */
109 points: Point[];
110 [key: string]: any;
111}
112/**
113 * @interface
114 * 坐标轴线定义
115 */
116export interface AxisLineCfg {
117 /**
118 * 坐标轴线的配置项
119 * @type {ShapeAttrs}
120 */
121 style?: ShapeAttrs;
122}
123/**
124 * @interface
125 * 坐标轴刻度定义
126 */
127export interface AxisTickLineCfg {
128 /**
129 * 坐标轴刻度线的配置项
130 * @type {ShapeAttrs}
131 */
132 style?: ShapeAttrs | ShapeAttrsCallback;
133 /**
134 * 是否同 tick 对齐
135 * @type {boolean}
136 */
137 alignTick?: boolean;
138 /**
139 * 长度
140 * @type {number}
141 */
142 length?: number;
143}
144declare type avoidCallback = (isVertical: boolean, labelGroup: IGroup, limitLength?: number) => boolean;
145/** 坐标轴自动隐藏的配置 */
146export interface AxisLabelAutoHideCfg {
147 /** 最小间距配置 */
148 minGap?: number;
149}
150/**
151 * @interface
152 * 坐标轴文本定义
153 */
154export interface AxisLabelCfg {
155 /**
156 * 坐标轴文本的样式
157 * @type {ShapeAttrs}
158 */
159 style?: ShapeAttrs | ShapeAttrsCallback;
160 /**
161 * label 的偏移量
162 * @type {number}
163 */
164 offset?: number;
165 /**
166 * 文本旋转角度
167 * @type {number}
168 */
169 rotate?: number;
170 /**
171 * 格式化函数
172 * @type {formatterCallback}
173 */
174 formatter?: formatterCallback;
175 /**
176 * 是否自动旋转,默认 true
177 * @type {boolean|avoidCallback|string}
178 */
179 autoRotate?: boolean | avoidCallback | string;
180 /**
181 * 是否自动隐藏,默认 false
182 * @type {boolean|avoidCallback|string|{type:string,cfg?:AxisLabelAutoHideCfg}}
183 */
184 autoHide?: boolean | avoidCallback | string | {
185 type: string;
186 cfg?: AxisLabelAutoHideCfg;
187 };
188 /**
189 * 是否自动省略,默认 false
190 * @type {boolean|avoidCallback|string}
191 */
192 autoEllipsis?: boolean | avoidCallback | string;
193}
194/**
195 * @interface
196 * 坐标轴子刻度定义
197 */
198export interface AxisSubTickLineCfg {
199 /**
200 * 坐标轴刻度线的配置项
201 * @type {ShapeAttrs}
202 */
203 style?: ShapeAttrs | ShapeAttrsCallback;
204 /**
205 * 子刻度个数
206 * @type {number}
207 */
208 count?: number;
209 /**
210 * 子刻度线长度
211 * @type {number}
212 */
213 length?: number;
214}
215/**
216 * @interface
217 * 坐标轴标题定义
218 */
219export interface AxisTitleCfg {
220 /**
221 * 标题距离坐标轴的距离
222 * @type {number}
223 */
224 offset?: number;
225 /**
226 * 标题距离坐标轴文本的距离
227 */
228 spacing?: number;
229 /**
230 * 标题文本配置项
231 * @type {ShapeAttrs}
232 */
233 style?: ShapeAttrs;
234 /**
235 * 是否自动旋转
236 * @type {boolean}
237 */
238 autoRotate?: boolean;
239 /**
240 * 设置文本
241 * @type {string}
242 */
243 text?: string;
244}
245export interface BaseCfg {
246 [key: string]: any;
247}
248export interface ComponentCfg extends BaseCfg {
249 /**
250 * 唯一标定组件的 id
251 * @type {string}
252 */
253 id?: string;
254 /**
255 * 定位的方式
256 * @type {string}
257 */
258 LocationType?: string;
259 /**
260 * 偏移位置 x
261 * @type {number}
262 */
263 offsetX?: number;
264 /**
265 * 偏移位置 y
266 * @type {number}
267 */
268 offsetY?: number;
269 /**
270 * 组件名称, axis, legend, tooltip
271 * @type {string}
272 */
273 name?: string;
274 /**
275 * 组件的类型,同 name 配合使用可以确定具体组件的类型,例如:
276 * name: 'axis',
277 * type: 'line'
278 */
279 type?: string;
280 /**
281 * 是否会捕捉事件
282 */
283 capture?: boolean;
284 /**
285 * 是否允许动画,不同组件允许动画的内容不同
286 * @type {boolean}
287 */
288 animate?: boolean;
289 /**
290 * 更新时自动渲染, 所有 html 的组件 update 时自动调用渲染,group 的组件默认 false
291 */
292 updateAutoRender?: boolean;
293 /**
294 * 动画的配置项
295 * @type {AnimateCfg}
296 */
297 animateOption?: AnimateOption;
298 /**
299 * 事件对象,可以在配置项中传入事件
300 * @example
301 * events: {
302 * itemclick: ev => {
303 *
304 * }
305 * }
306 * // 等效于
307 * component.on('itemclick', ev => {
308 *
309 * });
310 * @type {object}
311 */
312 events?: object;
313 /**
314 * @protected
315 * 配置项生效时的默认值,一些配置项是对象时,防止将一些内置的配置项清空,减少判空判断
316 * @example
317 * new Axis({
318 * tickLine: {
319 * length: 10 // 此时没有设置 style,内部调用 tickLine.style 时会出问题
320 * }
321 * })
322 * @type {object}
323 */
324 defaultCfg?: object;
325}
326export interface AnimateOption {
327 /** 初始化渲染时的入场动画,false/null 表示关闭入场动画 */
328 appear?: AnimateCfg | false | null;
329 /** 发生更新时,新增元素的入场动画,false/null 表示关闭入场动画 */
330 enter?: AnimateCfg | false | null;
331 /** 更新动画配置,false/null 表示关闭更新动画 */
332 update?: AnimateCfg | false | null;
333 /** 销毁动画配置,false/null 表示关闭销毁动画 */
334 leave?: AnimateCfg | false | null;
335}
336export interface GroupComponentCfg extends ComponentCfg {
337 /**
338 * 组件的容器
339 * @type {IGroup}
340 */
341 container: IGroup;
342 /**
343 * 当前组件对应的 group,一个 container 中可能会有多个组件,但是一个组件都有一个自己的 Group
344 * @type {IGroup}
345 */
346 group?: IGroup;
347 /**
348 * 组件是否可以被拾取
349 * @type {boolean}
350 */
351 capture?: boolean;
352}
353export interface HtmlComponentCfg extends ComponentCfg {
354 /**
355 * 组件的 DOM 容器
356 * @type {HTMLElement|string}
357 */
358 container?: HTMLElement | string;
359 /**
360 * 组件的父容器
361 */
362 parent?: HTMLElement | string;
363 /**
364 * 内部 DOM 的样式
365 */
366 domStyles?: LooseObject;
367}
368export interface OptimizeCfg {
369 /** 是否启动大数据量优化 */
370 enable: boolean;
371 /** 大数据数据量配置,达到 threshold 后启动优化,默认 400 */
372 threshold?: number;
373}
374export interface AxisBaseCfg extends GroupComponentCfg {
375 /**
376 * 坐标轴刻度的集合
377 * @type {ListItem[]}
378 */
379 ticks: ListItem[];
380 /**
381 * 坐标轴线的配置项
382 * @type {AxisLineCfg}
383 */
384 line?: AxisLineCfg;
385 /**
386 * 坐标轴刻度线线的配置项
387 * @type {AxisTickLineCfg}
388 */
389 tickLine?: AxisTickLineCfg;
390 /**
391 * 坐标轴子刻度线的配置项
392 * @type {AxisSubTickLineCfg}
393 */
394 subTickLine?: AxisSubTickLineCfg;
395 /**
396 * 标题的配置项
397 * @type {AxisTitleCfg}
398 */
399 title?: AxisTitleCfg;
400 /**
401 * 文本标签的配置项
402 */
403 label?: AxisLabelCfg;
404 /**
405 * 垂直于坐标轴方向的因子,决定文本、title、tickLine 在坐标轴的哪一侧,默认是 1,在坐标轴逆时针方向
406 */
407 verticalFactor?: number;
408 /**
409 * 垂直于坐标轴方向的限制长度,防止文本超出
410 * @type {number}
411 */
412 verticalLimitLength?: number;
413 /**
414 * 处理遮挡时的顺序,默认 ['autoRotate', 'autoHide']
415 */
416 overlapOrder?: string[];
417 /**
418 * 针对大数据量进行优化配置
419 */
420 optimize?: OptimizeCfg;
421}
422export interface LineAxisCfg extends AxisBaseCfg {
423 /**
424 * 坐标轴的起始点
425 * @type {Point}
426 */
427 start: Point;
428 /**
429 * 坐标轴的结束点
430 * @type {Point}
431 */
432 end: Point;
433}
434export interface CircleAxisCfg extends AxisBaseCfg {
435 /**
436 * 中心点, x, y
437 * @type {Point}
438 */
439 center: Point;
440 /**
441 * 半径
442 * @type {number}
443 */
444 radius: number;
445 /**
446 * 开始弧度
447 * @type {number}
448 */
449 startAngle?: number;
450 /**
451 * 结束弧度
452 * @type {number}
453 */
454 endAngle?: number;
455}
456export interface GridLineCfg {
457 /**
458 * 栅格线的类型
459 * @type {string}
460 */
461 type?: string;
462 /**
463 * 栅格线的配置项
464 * @type {ShapeAttrs}
465 */
466 style?: ShapeAttrs | ShapeAttrsCallback;
467}
468export interface GridBaseCfg extends GroupComponentCfg {
469 /**
470 * 线的样式
471 * @type {object}
472 */
473 line?: GridLineCfg;
474 /**
475 * 两个栅格线间的填充色,必须是一个数组
476 * @type {string|string[]}
477 */
478 alternateColor?: string | string[];
479 /**
480 * 绘制 grid 需要的点的集合
481 * @type {GridItem[]}
482 */
483 items: GridItem[];
484 /**
485 * 栅格线是否封闭
486 * @type {boolean}
487 */
488 closed?: boolean;
489}
490export interface CircleGridCfg extends GridBaseCfg {
491 /**
492 * 中心点
493 * @type {Point}
494 */
495 center: Point;
496}
497export interface LegendBaseCfg extends GroupComponentCfg {
498 /**
499 * 布局方式: horizontal,vertical
500 * @type {String}
501 */
502 layout?: string;
503 /**
504 * 位置 x
505 * @type {number}
506 */
507 x?: number;
508 /**
509 * 位置 y
510 * @type {number}
511 */
512 y?: number;
513 /**
514 * 标题
515 * @type {LegendTitleCfg}
516 */
517 title?: LegendTitleCfg;
518 /**
519 * 背景框配置项
520 * @type {LegendBackgroundCfg}
521 */
522 background?: LegendBackgroundCfg;
523}
524export interface CategoryLegendCfg extends LegendBaseCfg {
525 /**
526 * 图例项水平方向的间距
527 * @type {number}
528 */
529 itemSpacing?: number;
530 /**
531 * 图例项的最大宽度,默认为 null,由上层传入
532 */
533 maxItemWidth?: number;
534 /**
535 * 图例项的宽度, 默认为 null,自动计算
536 * @type {number}
537 */
538 itemWidth?: number;
539 /**
540 * 图例的高度,默认为 null
541 * @type {[type]}
542 */
543 itemHeight?: number;
544 /**
545 * 图例项 name 文本的配置
546 * @type {LegendItemNameCfg}
547 */
548 itemName?: LegendItemNameCfg;
549 /**
550 * 图例项 value 附加值的配置项
551 * @type {LegendItemValueCfg}
552 */
553 itemValue?: LegendItemValueCfg;
554 /**
555 * 最大宽度
556 * @type {number}
557 */
558 maxWidth?: number;
559 /**
560 * 最大高度
561 * @type {number}
562 */
563 maxHeight?: number;
564 /**
565 * 图例项的 marker 图标的配置
566 * @type {LegendMarkerCfg}
567 */
568 marker?: LegendMarkerCfg;
569 /**
570 * 图例项集合
571 * @type {ListItem[]}
572 */
573 items: ListItem[];
574 /**
575 * 分页器配置
576 * @type {LegendPageNavigatorCfg}
577 */
578 flipNavigation: LegendPageNavigatorCfg;
579}
580export interface ContinueLegendCfg extends LegendBaseCfg {
581 /**
582 * 选择范围的最小值
583 * @type {number}
584 */
585 min: number;
586 /**
587 * 选择范围的最大值
588 * @type {number}
589 */
590 max: number;
591 /**
592 * 选择的值
593 * @type {number[]}
594 */
595 value: number[];
596 /**
597 * 图例的颜色,可以写多个颜色
598 * @type {number[]}
599 */
600 colors: number[];
601 /**
602 * 选择范围的色块配置项
603 * @type {ContinueLegendTrackCfg}
604 */
605 track: ContinueLegendTrackCfg;
606 /**
607 * 图例滑轨(背景)的配置项
608 * @type {ContinueLegendRailCfg}
609 */
610 rail: ContinueLegendRailCfg;
611 /**
612 * 文本的配置项
613 * @type {ContinueLegendLabelCfg}
614 */
615 label: ContinueLegendLabelCfg;
616 /**
617 * 滑块的配置项
618 * @type {ContinueLegendHandlerCfg}
619 */
620 handler: ContinueLegendHandlerCfg;
621 /**
622 * 是否可以滑动
623 * @type {boolean}
624 */
625 slidable: boolean;
626}
627export interface ContinueLegendTrackCfg {
628 /**
629 * 选定范围的样式
630 * @type {ShapeAttrs}
631 */
632 style?: ShapeAttrs;
633}
634export interface ContinueLegendHandlerCfg {
635 /**
636 * 滑块大小
637 * @type {number}
638 */
639 size?: number;
640 /**
641 * 滑块样式
642 * @type {ShapeAttrs}
643 */
644 style?: ShapeAttrs;
645}
646export interface ContinueLegendRailCfg {
647 /**
648 * rail 的类型,color, size
649 * @type {string}
650 */
651 type?: string;
652 /**
653 * 滑轨的宽度
654 * @type {number}
655 */
656 size?: number;
657 /**
658 * 滑轨的默认长度,,当限制了 maxWidth,maxHeight 时,不会使用这个属性会自动计算长度
659 * @type {number}
660 */
661 defaultLength?: number;
662 /**
663 * 滑轨的样式
664 * @type {ShapeAttrs}
665 */
666 style?: ShapeAttrs;
667}
668export interface ContinueLegendLabelCfg {
669 /**
670 * 文本同滑轨的对齐方式,有五种类型
671 * - rail : 同滑轨对齐,在滑轨的两端
672 * - top, bottom: 图例水平布局时有效
673 * - left, right: 图例垂直布局时有效
674 * @type {string}
675 */
676 align?: string;
677 /**
678 * 文本格式化
679 * @type {string}
680 */
681 formatter?: (text: string | number | null) => string;
682 /**
683 * 文本同滑轨的距离
684 * @type {number}
685 */
686 spacing?: number;
687 /**
688 * 文本样式
689 * @type {ShapeAttrs}
690 */
691 style?: ShapeAttrs;
692}
693export interface LegendTitleCfg {
694 /**
695 * 标题同图例项的间距
696 * @type {number}
697 */
698 spacing?: number;
699 /**
700 * 文本配置项
701 * @type {ShapeAttrs}
702 */
703 style?: ShapeAttrs;
704}
705export interface LegendBackgroundCfg {
706 /**
707 * @type {number|number[]}
708 * 背景的留白
709 */
710 padding?: number | number[];
711 /**
712 * @type {ShapeAttrs}
713 * 背景配置项
714 */
715 style?: ShapeAttrs;
716}
717export interface LegendItemNameCfg {
718 /**
719 * 图例项 name 同后面 value 的间距
720 * @type {number}
721 */
722 spacing?: number;
723 /**
724 * 格式化文本函数
725 * @type {formatterCallback}
726 */
727 formatter?: formatterCallback;
728 /**
729 * 文本配置项
730 * @type {ShapeAttrs}
731 */
732 style?: ShapeAttrs;
733}
734declare type formatterCallback = (text: string, item: ListItem, index: number) => any;
735export interface LegendItemValueCfg {
736 /**
737 * 是否右对齐,默认为 false,仅当设置图例项宽度时生效
738 * @type {boolean}
739 */
740 alignRight?: boolean;
741 /**
742 * 格式化文本函数
743 * @type {formatterCallback}
744 */
745 formatter?: formatterCallback;
746 /**
747 * 图例项附加值的配置
748 * @type {ShapeAttrs}
749 */
750 style?: ShapeAttrs;
751}
752export interface LegendMarkerCfg {
753 /**
754 * 图例项 marker 同后面 name 的间距
755 * @type {number}
756 */
757 spacing?: number;
758 /**
759 * 图例 marker 形状
760 */
761 symbol?: string | ((x: number, y: number, r: number) => any);
762 /**
763 * 图例项 marker 的配置项
764 * @type {ShapeAttrs}
765 */
766 style?: ShapeAttrs;
767}
768/**
769 * 图例导航器,代指分页器
770 */
771export interface LegendPageNavigatorCfg {
772 marker?: {
773 style?: {
774 /** 分页导航器 icon 填充色, 默认 #000 */
775 fill?: string;
776 /** 分页导航器 icon 填充色 透明度, 默认 1 */
777 opacity?: number;
778 /** 分页导航器 icon 非激活时的填充色 */
779 inactiveFill?: string;
780 /** 分页导航器 icon 非激活时的填充色 透明度, 默认 0.45 */
781 inactiveOpacity?: number;
782 /** 分页器的大小 */
783 size?: number;
784 };
785 };
786 text?: {
787 style?: {
788 /** 分页导航器 文本 填充色,默认 #ccc */
789 fill?: string;
790 /** 字体大小, 默认 12px */
791 fontSize?: number;
792 };
793 };
794}
795export declare type TooltipPosition = 'top' | 'left' | 'right' | 'bottom' | 'auto';
796export interface TooltipCfg extends HtmlComponentCfg {
797 /**
798 * 位置 x
799 * @type {number}
800 */
801 x?: number;
802 /**
803 * 位置 y
804 * @type {number}
805 */
806 y?: number;
807 /**
808 * 列表项集合
809 * @type {ListItem[]}
810 */
811 items: ListItem[];
812 /**
813 * 容器的模板
814 * @type {string}
815 */
816 containerTpl?: string;
817 /**
818 * 列表项的模板
819 * @type {[type]}
820 */
821 itemTpl?: string;
822 /**
823 * 根据 x 定位的 crosshair 的模板
824 * @type {string}
825 */
826 xCrosshairTpl?: string;
827 /**
828 * 根据 y 定位的 crosshair 的模板
829 * @type {[type]}
830 */
831 yCrosshairTpl?: string;
832 /**
833 * tooltip 限制的区域
834 * @type {Region}
835 */
836 region?: Region;
837 /**
838 * crosshairs 限制的区域
839 * @type {Region}
840 */
841 crosshairsRegion?: Region;
842 /**
843 * crosshairs 的类型, x,y,xy
844 * @type {string}
845 */
846 crosshairs?: string;
847 /**
848 * 是否跟随鼠标移动,会影响 xy的定位
849 * @type {boolean}
850 */
851 follow?: boolean;
852 /**
853 * 偏移量,同 position 相关
854 * @type {number}
855 */
856 offset?: number;
857 /**
858 * 位置,top, bottom, left, right
859 * @type {string}
860 */
861 position?: TooltipPosition;
862 /**
863 * 传入各个 dom 的样式
864 * @type {object}
865 */
866 domStyles?: object;
867 /**
868 * 默认的各个 dom 的样式
869 * @type {object}
870 */
871 defaultStyles?: object;
872}
873export interface LocationCfg {
874 [key: string]: any;
875}
876export interface PointLocationCfg extends LocationCfg {
877 /**
878 * 位置 x
879 * @type {number}
880 */
881 x?: number;
882 /**
883 * 位置 y
884 * @type {number}
885 */
886 y?: number;
887}
888export interface RegionLocationCfg extends LocationCfg {
889 /**
890 * 起始点
891 * @type {Point}
892 */
893 start?: Point;
894 /**
895 * 结束点
896 * @type {Point}
897 */
898 end?: Point;
899}
900export interface PointsLocationCfg extends LocationCfg {
901 /**
902 * 定位点的集合
903 * @type {Point[]}
904 */
905 points?: Point[];
906}
907export interface CircleLocationCfg extends LocationCfg {
908 /**
909 * 圆心
910 * @type {Point}
911 */
912 center?: Point;
913 /**
914 * 半径
915 * @type {number}
916 */
917 radius?: number;
918 /**
919 * 起始角度
920 * @type {number}
921 */
922 startAngle?: number;
923 /**
924 * 结束角度
925 * @type {number}
926 */
927 endAngle?: number;
928}
929/**
930 * 自定义 Shape annotation 组件配置
931 */
932export interface ShapeAnnotationCfg extends GroupComponentCfg {
933 /** 自定义 render 函数,注意绘制的 shape/group 需要设置 id */
934 render: (container: IGroup) => void;
935}
936/**
937 * Html Annotation 组件配置
938 */
939export interface HtmlAnnotationCfg extends HtmlComponentCfg {
940 /** X 方向对齐,默认 left */
941 alignX?: 'left' | 'middle' | 'right';
942 /** Y 方向对齐,默认 top */
943 alignY?: 'top' | 'middle' | 'bottom';
944 /** 自定义 html */
945 html: string | HTMLElement | ((container: HTMLElement) => void | string | HTMLElement);
946 /** zIndex 设置 */
947 zIndex?: number;
948}
949export interface TextAnnotationCfg extends GroupComponentCfg, EnhancedTextCfg {
950 /**
951 * 文本标注位置 x
952 * @type {number}
953 */
954 x: number;
955 /**
956 * 文本标注位置 y
957 * @type {number}
958 */
959 y: number;
960}
961export interface LineAnnotationCfg extends GroupComponentCfg {
962 /**
963 * 起始点
964 * @type {Point}
965 */
966 start?: Point;
967 /**
968 * 结束点
969 * @type {Point}
970 */
971 end?: Point;
972 /**
973 * 线上的文本配置
974 * @type {LineAnnotationTextCfg}
975 */
976 text?: LineAnnotationTextCfg;
977 /**
978 * 线的样式
979 * @type {ShapeAttrs}
980 */
981 style?: ShapeAttrs;
982}
983export interface LineAnnotationTextCfg extends EnhancedTextCfg {
984 /**
985 * 位置,可以选择: start, end, center 和 '50%' 这类的百分比写法,默认 'center'
986 * @type {string}
987 */
988 position?: string;
989 /**
990 * 自动旋转,沿着线的方向,默认 true
991 * @type {boolean}
992 */
993 autoRotate?: boolean;
994 /**
995 * 文本的偏移 x
996 * @type {number}
997 */
998 offsetX?: number;
999 /**
1000 * 文本的偏移 y
1001 * @type {number}
1002 */
1003 offsetY?: number;
1004}
1005export interface RegionAnnotationCfg extends GroupComponentCfg {
1006 /**
1007 * 起始点
1008 * @type {Point}
1009 */
1010 start?: Point;
1011 /**
1012 * 结束点
1013 * @type {Point}
1014 */
1015 end?: Point;
1016 /**
1017 * 区域的样式
1018 * @type {ShapeAttrs}
1019 */
1020 style?: ShapeAttrs;
1021}
1022export interface ImageAnnotationCfg extends GroupComponentCfg {
1023 /**
1024 * 起始点
1025 * @type {Point}
1026 */
1027 start?: Point;
1028 /**
1029 * 结束点
1030 * @type {Point}
1031 */
1032 end?: Point;
1033 /**
1034 * 图片地址
1035 * @type {string}
1036 */
1037 src?: string;
1038 /**
1039 * 区域的样式
1040 * @type {ShapeAttrs}
1041 */
1042 style?: ShapeAttrs;
1043}
1044export interface ArcAnnotationCfg extends GroupComponentCfg {
1045 /**
1046 * 圆心
1047 * @type {Point}
1048 */
1049 center?: Point;
1050 /**
1051 * 半径
1052 * @type {number}
1053 */
1054 radius?: number;
1055 /**
1056 * 其实角度
1057 * @type {number}
1058 */
1059 startAngle?: number;
1060 /**
1061 * 结束角度
1062 * @type {number}
1063 */
1064 endAngle?: number;
1065 /**
1066 * 区域的样式
1067 * @type {ShapeAttrs}
1068 */
1069 style?: ShapeAttrs;
1070}
1071export interface DataMarkerTextCfg extends EnhancedTextCfg {
1072 display?: boolean;
1073}
1074export interface DataMarkerAnnotationCfg extends GroupComponentCfg {
1075 /**
1076 * 标注位置 x
1077 * @type {number}
1078 */
1079 x: number;
1080 /**
1081 * 标注位置 y
1082 * @type {number}
1083 */
1084 y: number;
1085 point?: {
1086 display?: boolean;
1087 style?: ShapeAttrs;
1088 };
1089 line?: {
1090 display?: boolean;
1091 length?: number;
1092 style?: ShapeAttrs;
1093 };
1094 text: DataMarkerTextCfg;
1095 /**
1096 * 方向
1097 */
1098 direction?: 'upward' | 'downward';
1099 /**
1100 * 是否自动调整
1101 */
1102 autoAdjust?: boolean;
1103 /**
1104 * CoordBBox,用于 autoAdjust
1105 */
1106 coordBBox?: BBox;
1107}
1108export interface DataRegionAnnotationCfg extends GroupComponentCfg {
1109 /**
1110 * 位置点信息
1111 * @type {Point}
1112 */
1113 points: Point[];
1114 region?: {
1115 style?: ShapeAttrs;
1116 };
1117 text: EnhancedTextCfg;
1118}
1119export interface RegionFilterAnnotationCfg extends GroupComponentCfg {
1120 /**
1121 * 起始点
1122 * @type {Point}
1123 */
1124 start: Point;
1125 /**
1126 * 结束点
1127 * @type {Point}
1128 */
1129 end: Point;
1130 /**
1131 * 染色色值
1132 */
1133 color: string;
1134 /**
1135 * 图形上的 Shapes
1136 */
1137 shapes: IShape[];
1138}
1139export interface CrosshairBaseCfg extends GroupComponentCfg {
1140 /**
1141 * 线的样式
1142 * @type {CrosshairLineCfg}
1143 */
1144 line?: CrosshairLineCfg;
1145 /**
1146 * 附加文本的样式
1147 * @type {CrosshairTextCfg}
1148 */
1149 text?: CrosshairTextCfg;
1150 /**
1151 * 文本背景的配置项
1152 * @type {CrosshairTextBackgroundCfg}
1153 */
1154 textBackground?: CrosshairTextBackgroundCfg;
1155}
1156export interface LineCrosshairCfg extends CrosshairBaseCfg {
1157 /**
1158 * 起始点
1159 * @type {Point}
1160 */
1161 start: Point;
1162 /**
1163 * 结束点
1164 * @type {Point}
1165 */
1166 end: Point;
1167}
1168export interface CircleCrosshairCfg extends CrosshairBaseCfg {
1169 /**
1170 * 圆心
1171 * @type {Point}
1172 */
1173 center: Point;
1174 /**
1175 * 半径
1176 * @type {number}
1177 */
1178 radius: number;
1179 /**
1180 * 开始角度
1181 * @type {number}
1182 */
1183 startAngle: number;
1184 /**
1185 * 结束角度
1186 * @type {number}
1187 */
1188 endAngle: number;
1189}
1190export interface CrosshairTextBaseCfg {
1191 /**
1192 * 文本位置,只支持 startend
1193 * @type {string}
1194 */
1195 position?: string;
1196 /**
1197 * 文本内容
1198 */
1199 content?: string;
1200 /**
1201 * 距离线的距离
1202 * @type {number}
1203 */
1204 offset?: number;
1205}
1206export interface CrosshairTextCfg extends CrosshairTextBaseCfg {
1207 /**
1208 * 是否自动旋转
1209 * @type {boolean}
1210 */
1211 autoRotate?: boolean;
1212 /**
1213 * 文本的配置项
1214 * @type {ShapeAttrs}
1215 */
1216 style?: ShapeAttrs;
1217}
1218export interface HtmlCrossHairCfg extends HtmlComponentCfg {
1219 /**
1220 * 起始位置
1221 */
1222 start: Point;
1223 /**
1224 * 结束位置
1225 */
1226 end: Point;
1227 /**
1228 * crosshair 的模板
1229 */
1230 crossHairTpl: string;
1231 /**
1232 * 文本的模板
1233 */
1234 textTpl: string;
1235 /**
1236 * 文本
1237 */
1238 text: CrosshairTextBaseCfg;
1239}
1240export interface CrosshairLineCfg {
1241 /**
1242 * 线的配置项
1243 * @type {ShapeAttrs}
1244 */
1245 style?: ShapeAttrs;
1246}
1247export interface CrosshairTextBackgroundCfg {
1248 /**
1249 * 文本背景周围的留白
1250 * @type {number|number[]}
1251 */
1252 padding?: number | number[];
1253 /**
1254 * 文本背景的样式
1255 * @type {ShapeAttrs}
1256 */
1257 style?: ShapeAttrs;
1258}
1259export { SliderCfg, TrendCfg } from './slider';
1260export { ScrollbarCfg, ScrollbarTheme } from './scrollbar';
1261
\No newline at end of file