UNPKG

26 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}
575export interface ContinueLegendCfg extends LegendBaseCfg {
576 /**
577 * 选择范围的最小值
578 * @type {number}
579 */
580 min: number;
581 /**
582 * 选择范围的最大值
583 * @type {number}
584 */
585 max: number;
586 /**
587 * 选择的值
588 * @type {number[]}
589 */
590 value: number[];
591 /**
592 * 图例的颜色,可以写多个颜色
593 * @type {number[]}
594 */
595 colors: number[];
596 /**
597 * 选择范围的色块配置项
598 * @type {ContinueLegendTrackCfg}
599 */
600 track: ContinueLegendTrackCfg;
601 /**
602 * 图例滑轨(背景)的配置项
603 * @type {ContinueLegendRailCfg}
604 */
605 rail: ContinueLegendRailCfg;
606 /**
607 * 文本的配置项
608 * @type {ContinueLegendLabelCfg}
609 */
610 label: ContinueLegendLabelCfg;
611 /**
612 * 滑块的配置项
613 * @type {ContinueLegendHandlerCfg}
614 */
615 handler: ContinueLegendHandlerCfg;
616 /**
617 * 是否可以滑动
618 * @type {boolean}
619 */
620 slidable: boolean;
621}
622export interface ContinueLegendTrackCfg {
623 /**
624 * 选定范围的样式
625 * @type {ShapeAttrs}
626 */
627 style?: ShapeAttrs;
628}
629export interface ContinueLegendHandlerCfg {
630 /**
631 * 滑块大小
632 * @type {number}
633 */
634 size?: number;
635 /**
636 * 滑块样式
637 * @type {ShapeAttrs}
638 */
639 style?: ShapeAttrs;
640}
641export interface ContinueLegendRailCfg {
642 /**
643 * rail 的类型,color, size
644 * @type {string}
645 */
646 type?: string;
647 /**
648 * 滑轨的宽度
649 * @type {number}
650 */
651 size?: number;
652 /**
653 * 滑轨的默认长度,,当限制了 maxWidth,maxHeight 时,不会使用这个属性会自动计算长度
654 * @type {number}
655 */
656 defaultLength?: number;
657 /**
658 * 滑轨的样式
659 * @type {ShapeAttrs}
660 */
661 style?: ShapeAttrs;
662}
663export interface ContinueLegendLabelCfg {
664 /**
665 * 文本同滑轨的对齐方式,有五种类型
666 * - rail : 同滑轨对齐,在滑轨的两端
667 * - top, bottom: 图例水平布局时有效
668 * - left, right: 图例垂直布局时有效
669 * @type {string}
670 */
671 align?: string;
672 /**
673 * 文本同滑轨的距离
674 * @type {number}
675 */
676 spacing?: number;
677 /**
678 * 文本样式
679 * @type {ShapeAttrs}
680 */
681 style?: ShapeAttrs;
682}
683export interface LegendTitleCfg {
684 /**
685 * 标题同图例项的间距
686 * @type {number}
687 */
688 spacing?: number;
689 /**
690 * 文本配置项
691 * @type {ShapeAttrs}
692 */
693 style?: ShapeAttrs;
694}
695export interface LegendBackgroundCfg {
696 /**
697 * @type {number|number[]}
698 * 背景的留白
699 */
700 padding?: number | number[];
701 /**
702 * @type {ShapeAttrs}
703 * 背景配置项
704 */
705 style?: ShapeAttrs;
706}
707export interface LegendItemNameCfg {
708 /**
709 * 图例项 name 同后面 value 的间距
710 * @type {number}
711 */
712 spacing?: number;
713 /**
714 * 格式化文本函数
715 * @type {formatterCallback}
716 */
717 formatter?: formatterCallback;
718 /**
719 * 文本配置项
720 * @type {ShapeAttrs}
721 */
722 style?: ShapeAttrs;
723}
724declare type formatterCallback = (text: string, item: ListItem, index: number) => any;
725export interface LegendItemValueCfg {
726 /**
727 * 是否右对齐,默认为 false,仅当设置图例项宽度时生效
728 * @type {boolean}
729 */
730 alignRight?: boolean;
731 /**
732 * 格式化文本函数
733 * @type {formatterCallback}
734 */
735 formatter?: formatterCallback;
736 /**
737 * 图例项附加值的配置
738 * @type {ShapeAttrs}
739 */
740 style?: ShapeAttrs;
741}
742export interface LegendMarkerCfg {
743 /**
744 * 图例项 marker 同后面 name 的间距
745 * @type {number}
746 */
747 spacing?: number;
748 /**
749 * 图例 marker 形状
750 */
751 symbol?: string | ((x: number, y: number, r: number) => any);
752 /**
753 * 图例项 marker 的配置项
754 * @type {ShapeAttrs}
755 */
756 style?: ShapeAttrs;
757}
758export declare type TooltipPosition = 'top' | 'left' | 'right' | 'bottom' | 'auto';
759export interface TooltipCfg extends HtmlComponentCfg {
760 /**
761 * 位置 x
762 * @type {number}
763 */
764 x?: number;
765 /**
766 * 位置 y
767 * @type {number}
768 */
769 y?: number;
770 /**
771 * 列表项集合
772 * @type {ListItem[]}
773 */
774 items: ListItem[];
775 /**
776 * 容器的模板
777 * @type {string}
778 */
779 containerTpl?: string;
780 /**
781 * 列表项的模板
782 * @type {[type]}
783 */
784 itemTpl?: string;
785 /**
786 * 根据 x 定位的 crosshair 的模板
787 * @type {string}
788 */
789 xCrosshairTpl?: string;
790 /**
791 * 根据 y 定位的 crosshair 的模板
792 * @type {[type]}
793 */
794 yCrosshairTpl?: string;
795 /**
796 * tooltip 限制的区域
797 * @type {Region}
798 */
799 region?: Region;
800 /**
801 * crosshairs 限制的区域
802 * @type {Region}
803 */
804 crosshairsRegion?: Region;
805 /**
806 * crosshairs 的类型, x,y,xy
807 * @type {string}
808 */
809 crosshairs?: string;
810 /**
811 * 是否跟随鼠标移动,会影响 xy的定位
812 * @type {boolean}
813 */
814 follow?: boolean;
815 /**
816 * 偏移量,同 position 相关
817 * @type {number}
818 */
819 offset?: number;
820 /**
821 * 位置,top, bottom, left, right
822 * @type {string}
823 */
824 position?: TooltipPosition;
825 /**
826 * 传入各个 dom 的样式
827 * @type {object}
828 */
829 domStyles?: object;
830 /**
831 * 默认的各个 dom 的样式
832 * @type {object}
833 */
834 defaultStyles?: object;
835}
836export interface LocationCfg {
837 [key: string]: any;
838}
839export interface PointLocationCfg extends LocationCfg {
840 /**
841 * 位置 x
842 * @type {number}
843 */
844 x?: number;
845 /**
846 * 位置 y
847 * @type {number}
848 */
849 y?: number;
850}
851export interface RegionLocationCfg extends LocationCfg {
852 /**
853 * 起始点
854 * @type {Point}
855 */
856 start?: Point;
857 /**
858 * 结束点
859 * @type {Point}
860 */
861 end?: Point;
862}
863export interface PointsLocationCfg extends LocationCfg {
864 /**
865 * 定位点的集合
866 * @type {Point[]}
867 */
868 points?: Point[];
869}
870export interface CircleLocationCfg extends LocationCfg {
871 /**
872 * 圆心
873 * @type {Point}
874 */
875 center?: Point;
876 /**
877 * 半径
878 * @type {number}
879 */
880 radius?: number;
881 /**
882 * 起始角度
883 * @type {number}
884 */
885 startAngle?: number;
886 /**
887 * 结束角度
888 * @type {number}
889 */
890 endAngle?: number;
891}
892/**
893 * 自定义 Shape annotation 组件配置
894 */
895export interface ShapeAnnotationCfg extends GroupComponentCfg {
896 /** 自定义 render 函数,注意绘制的 shape/group 需要设置 id */
897 render: (container: IGroup) => void;
898}
899/**
900 * Html Annotation 组件配置
901 */
902export interface HtmlAnnotationCfg extends HtmlComponentCfg {
903 /** X 方向对齐,默认 left */
904 alignX?: 'left' | 'middle' | 'right';
905 /** Y 方向对齐,默认 top */
906 alignY?: 'top' | 'middle' | 'bottom';
907 /** 自定义 html */
908 html: string | HTMLElement | ((container: HTMLElement) => void | string | HTMLElement);
909 /** zIndex 设置 */
910 zIndex?: number;
911}
912export interface TextAnnotationCfg extends GroupComponentCfg, EnhancedTextCfg {
913 /**
914 * 文本标注位置 x
915 * @type {number}
916 */
917 x: number;
918 /**
919 * 文本标注位置 y
920 * @type {number}
921 */
922 y: number;
923}
924export interface LineAnnotationCfg extends GroupComponentCfg {
925 /**
926 * 起始点
927 * @type {Point}
928 */
929 start?: Point;
930 /**
931 * 结束点
932 * @type {Point}
933 */
934 end?: Point;
935 /**
936 * 线上的文本配置
937 * @type {LineAnnotationTextCfg}
938 */
939 text?: LineAnnotationTextCfg;
940 /**
941 * 线的样式
942 * @type {ShapeAttrs}
943 */
944 style?: ShapeAttrs;
945}
946export interface LineAnnotationTextCfg extends EnhancedTextCfg {
947 /**
948 * 位置,可以选择: start, end, center 和 '50%' 这类的百分比写法,默认 'center'
949 * @type {string}
950 */
951 position?: string;
952 /**
953 * 自动旋转,沿着线的方向,默认 true
954 * @type {boolean}
955 */
956 autoRotate?: boolean;
957 /**
958 * 文本的偏移 x
959 * @type {number}
960 */
961 offsetX?: number;
962 /**
963 * 文本的偏移 y
964 * @type {number}
965 */
966 offsetY?: number;
967}
968export interface RegionAnnotationCfg extends GroupComponentCfg {
969 /**
970 * 起始点
971 * @type {Point}
972 */
973 start?: Point;
974 /**
975 * 结束点
976 * @type {Point}
977 */
978 end?: Point;
979 /**
980 * 区域的样式
981 * @type {ShapeAttrs}
982 */
983 style?: ShapeAttrs;
984}
985export interface ImageAnnotationCfg extends GroupComponentCfg {
986 /**
987 * 起始点
988 * @type {Point}
989 */
990 start?: Point;
991 /**
992 * 结束点
993 * @type {Point}
994 */
995 end?: Point;
996 /**
997 * 图片地址
998 * @type {string}
999 */
1000 src?: string;
1001 /**
1002 * 区域的样式
1003 * @type {ShapeAttrs}
1004 */
1005 style?: ShapeAttrs;
1006}
1007export interface ArcAnnotationCfg extends GroupComponentCfg {
1008 /**
1009 * 圆心
1010 * @type {Point}
1011 */
1012 center?: Point;
1013 /**
1014 * 半径
1015 * @type {number}
1016 */
1017 radius?: number;
1018 /**
1019 * 其实角度
1020 * @type {number}
1021 */
1022 startAngle?: number;
1023 /**
1024 * 结束角度
1025 * @type {number}
1026 */
1027 endAngle?: number;
1028 /**
1029 * 区域的样式
1030 * @type {ShapeAttrs}
1031 */
1032 style?: ShapeAttrs;
1033}
1034export interface DataMarkerTextCfg extends EnhancedTextCfg {
1035 display?: boolean;
1036}
1037export interface DataMarkerAnnotationCfg extends GroupComponentCfg {
1038 /**
1039 * 标注位置 x
1040 * @type {number}
1041 */
1042 x: number;
1043 /**
1044 * 标注位置 y
1045 * @type {number}
1046 */
1047 y: number;
1048 point?: {
1049 display?: boolean;
1050 style?: ShapeAttrs;
1051 };
1052 line?: {
1053 display?: boolean;
1054 length?: number;
1055 style?: ShapeAttrs;
1056 };
1057 text: DataMarkerTextCfg;
1058 /**
1059 * 方向
1060 */
1061 direction?: 'upward' | 'downward';
1062 /**
1063 * 是否自动调整
1064 */
1065 autoAdjust?: boolean;
1066 /**
1067 * CoordBBox,用于 autoAdjust
1068 */
1069 coordBBox?: BBox;
1070}
1071export interface DataRegionAnnotationCfg extends GroupComponentCfg {
1072 /**
1073 * 位置点信息
1074 * @type {Point}
1075 */
1076 points: Point[];
1077 region?: {
1078 style?: ShapeAttrs;
1079 };
1080 text: EnhancedTextCfg;
1081}
1082export interface RegionFilterAnnotationCfg extends GroupComponentCfg {
1083 /**
1084 * 起始点
1085 * @type {Point}
1086 */
1087 start: Point;
1088 /**
1089 * 结束点
1090 * @type {Point}
1091 */
1092 end: Point;
1093 /**
1094 * 染色色值
1095 */
1096 color: string;
1097 /**
1098 * 图形上的 Shapes
1099 */
1100 shapes: IShape[];
1101}
1102export interface CrosshairBaseCfg extends GroupComponentCfg {
1103 /**
1104 * 线的样式
1105 * @type {CrosshairLineCfg}
1106 */
1107 line?: CrosshairLineCfg;
1108 /**
1109 * 附加文本的样式
1110 * @type {CrosshairTextCfg}
1111 */
1112 text?: CrosshairTextCfg;
1113 /**
1114 * 文本背景的配置项
1115 * @type {CrosshairTextBackgroundCfg}
1116 */
1117 textBackground?: CrosshairTextBackgroundCfg;
1118}
1119export interface LineCrosshairCfg extends CrosshairBaseCfg {
1120 /**
1121 * 起始点
1122 * @type {Point}
1123 */
1124 start: Point;
1125 /**
1126 * 结束点
1127 * @type {Point}
1128 */
1129 end: Point;
1130}
1131export interface CircleCrosshairCfg extends CrosshairBaseCfg {
1132 /**
1133 * 圆心
1134 * @type {Point}
1135 */
1136 center: Point;
1137 /**
1138 * 半径
1139 * @type {number}
1140 */
1141 radius: number;
1142 /**
1143 * 开始角度
1144 * @type {number}
1145 */
1146 startAngle: number;
1147 /**
1148 * 结束角度
1149 * @type {number}
1150 */
1151 endAngle: number;
1152}
1153export interface CrosshairTextBaseCfg {
1154 /**
1155 * 文本位置,只支持 startend
1156 * @type {string}
1157 */
1158 position?: string;
1159 /**
1160 * 文本内容
1161 */
1162 content?: string;
1163 /**
1164 * 距离线的距离
1165 * @type {number}
1166 */
1167 offset?: number;
1168}
1169export interface CrosshairTextCfg extends CrosshairTextBaseCfg {
1170 /**
1171 * 是否自动旋转
1172 * @type {boolean}
1173 */
1174 autoRotate?: boolean;
1175 /**
1176 * 文本的配置项
1177 * @type {ShapeAttrs}
1178 */
1179 style?: ShapeAttrs;
1180}
1181export interface HtmlCrossHairCfg extends HtmlComponentCfg {
1182 /**
1183 * 起始位置
1184 */
1185 start: Point;
1186 /**
1187 * 结束位置
1188 */
1189 end: Point;
1190 /**
1191 * crosshair 的模板
1192 */
1193 crossHairTpl: string;
1194 /**
1195 * 文本的模板
1196 */
1197 textTpl: string;
1198 /**
1199 * 文本
1200 */
1201 text: CrosshairTextBaseCfg;
1202}
1203export interface CrosshairLineCfg {
1204 /**
1205 * 线的配置项
1206 * @type {ShapeAttrs}
1207 */
1208 style?: ShapeAttrs;
1209}
1210export interface CrosshairTextBackgroundCfg {
1211 /**
1212 * 文本背景周围的留白
1213 * @type {number|number[]}
1214 */
1215 padding?: number | number[];
1216 /**
1217 * 文本背景的样式
1218 * @type {ShapeAttrs}
1219 */
1220 style?: ShapeAttrs;
1221}
1222export { SliderCfg, TrendCfg } from './slider';
1223export { ScrollbarCfg, ScrollbarTheme } from './scrollbar';
1224
\No newline at end of file