1 | import { AnimateCfg, BBox, IGroup, IShape, Point, ShapeAttrs } from '@antv/g-base';
|
2 | export declare type LocationType = 'point' | 'Region' | 'points' | 'circle' | 'none';
|
3 | export { Point, BBox };
|
4 |
|
5 | declare type ShapeAttrsCallback = (item: any, index: number, items: any[]) => ShapeAttrs;
|
6 |
|
7 | export interface LooseObject {
|
8 | [key: string]: any;
|
9 | }
|
10 | export interface OffsetPoint {
|
11 | offsetX: number;
|
12 | offsetY: number;
|
13 | }
|
14 | export interface Region {
|
15 | |
16 |
|
17 |
|
18 |
|
19 | start: Point;
|
20 | |
21 |
|
22 |
|
23 |
|
24 | end: Point;
|
25 | }
|
26 | export interface Range {
|
27 | |
28 |
|
29 |
|
30 |
|
31 | min: number;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | max: number;
|
37 | }
|
38 |
|
39 | export interface EnhancedTextBackgroundCfg {
|
40 |
|
41 | padding?: number | number[];
|
42 |
|
43 | style?: ShapeAttrs;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export interface EnhancedTextCfg {
|
51 |
|
52 | content: string | number;
|
53 |
|
54 | rotate?: number;
|
55 |
|
56 | style?: ShapeAttrs;
|
57 |
|
58 | background?: EnhancedTextBackgroundCfg;
|
59 |
|
60 | maxLength?: number;
|
61 |
|
62 | autoEllipsis?: boolean;
|
63 |
|
64 | isVertical?: boolean;
|
65 |
|
66 | ellipsisPosition?: 'head' | 'middle' | 'tail';
|
67 | }
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | export interface ListItem {
|
73 | |
74 |
|
75 |
|
76 |
|
77 | id?: string;
|
78 | |
79 |
|
80 |
|
81 |
|
82 | name: string;
|
83 | |
84 |
|
85 |
|
86 |
|
87 | value: any;
|
88 | |
89 |
|
90 |
|
91 |
|
92 | marker?: object | string;
|
93 | [key: string]: any;
|
94 | }
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | export interface GridItem {
|
100 | |
101 |
|
102 |
|
103 |
|
104 | id?: string;
|
105 | |
106 |
|
107 |
|
108 |
|
109 | points: Point[];
|
110 | [key: string]: any;
|
111 | }
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | export interface AxisLineCfg {
|
117 | |
118 |
|
119 |
|
120 |
|
121 | style?: ShapeAttrs;
|
122 | }
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | export interface AxisTickLineCfg {
|
128 | |
129 |
|
130 |
|
131 |
|
132 | style?: ShapeAttrs | ShapeAttrsCallback;
|
133 | |
134 |
|
135 |
|
136 |
|
137 | alignTick?: boolean;
|
138 | |
139 |
|
140 |
|
141 |
|
142 | length?: number;
|
143 | }
|
144 | declare type avoidCallback = (isVertical: boolean, labelGroup: IGroup, limitLength?: number) => boolean;
|
145 |
|
146 | export interface AxisLabelAutoHideCfg {
|
147 |
|
148 | minGap?: number;
|
149 | }
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | export interface AxisLabelCfg {
|
155 | |
156 |
|
157 |
|
158 |
|
159 | style?: ShapeAttrs | ShapeAttrsCallback;
|
160 | |
161 |
|
162 |
|
163 |
|
164 | offset?: number;
|
165 | |
166 |
|
167 |
|
168 |
|
169 | rotate?: number;
|
170 | |
171 |
|
172 |
|
173 |
|
174 | formatter?: formatterCallback;
|
175 | |
176 |
|
177 |
|
178 |
|
179 | autoRotate?: boolean | avoidCallback | string;
|
180 | |
181 |
|
182 |
|
183 |
|
184 | autoHide?: boolean | avoidCallback | string | {
|
185 | type: string;
|
186 | cfg?: AxisLabelAutoHideCfg;
|
187 | };
|
188 | |
189 |
|
190 |
|
191 |
|
192 | autoEllipsis?: boolean | avoidCallback | string;
|
193 | }
|
194 |
|
195 |
|
196 |
|
197 |
|
198 | export interface AxisSubTickLineCfg {
|
199 | |
200 |
|
201 |
|
202 |
|
203 | style?: ShapeAttrs | ShapeAttrsCallback;
|
204 | |
205 |
|
206 |
|
207 |
|
208 | count?: number;
|
209 | |
210 |
|
211 |
|
212 |
|
213 | length?: number;
|
214 | }
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | export interface AxisTitleCfg {
|
220 | |
221 |
|
222 |
|
223 |
|
224 | offset?: number;
|
225 | |
226 |
|
227 |
|
228 | spacing?: number;
|
229 | |
230 |
|
231 |
|
232 |
|
233 | style?: ShapeAttrs;
|
234 | |
235 |
|
236 |
|
237 |
|
238 | autoRotate?: boolean;
|
239 | |
240 |
|
241 |
|
242 |
|
243 | text?: string;
|
244 | }
|
245 | export interface BaseCfg {
|
246 | [key: string]: any;
|
247 | }
|
248 | export interface ComponentCfg extends BaseCfg {
|
249 | |
250 |
|
251 |
|
252 |
|
253 | id?: string;
|
254 | |
255 |
|
256 |
|
257 |
|
258 | LocationType?: string;
|
259 | |
260 |
|
261 |
|
262 |
|
263 | offsetX?: number;
|
264 | |
265 |
|
266 |
|
267 |
|
268 | offsetY?: number;
|
269 | |
270 |
|
271 |
|
272 |
|
273 | name?: string;
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 | type?: string;
|
280 | |
281 |
|
282 |
|
283 | capture?: boolean;
|
284 | |
285 |
|
286 |
|
287 |
|
288 | animate?: boolean;
|
289 | |
290 |
|
291 |
|
292 | updateAutoRender?: boolean;
|
293 | |
294 |
|
295 |
|
296 |
|
297 | animateOption?: AnimateOption;
|
298 | |
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 | events?: object;
|
313 | |
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 | defaultCfg?: object;
|
325 | }
|
326 | export interface AnimateOption {
|
327 |
|
328 | appear?: AnimateCfg | false | null;
|
329 |
|
330 | enter?: AnimateCfg | false | null;
|
331 |
|
332 | update?: AnimateCfg | false | null;
|
333 |
|
334 | leave?: AnimateCfg | false | null;
|
335 | }
|
336 | export interface GroupComponentCfg extends ComponentCfg {
|
337 | |
338 |
|
339 |
|
340 |
|
341 | container: IGroup;
|
342 | |
343 |
|
344 |
|
345 |
|
346 | group?: IGroup;
|
347 | |
348 |
|
349 |
|
350 |
|
351 | capture?: boolean;
|
352 | }
|
353 | export interface HtmlComponentCfg extends ComponentCfg {
|
354 | |
355 |
|
356 |
|
357 |
|
358 | container?: HTMLElement | string;
|
359 | |
360 |
|
361 |
|
362 | parent?: HTMLElement | string;
|
363 | |
364 |
|
365 |
|
366 | domStyles?: LooseObject;
|
367 | }
|
368 | export interface OptimizeCfg {
|
369 |
|
370 | enable: boolean;
|
371 |
|
372 | threshold?: number;
|
373 | }
|
374 | export interface AxisBaseCfg extends GroupComponentCfg {
|
375 | |
376 |
|
377 |
|
378 |
|
379 | ticks: ListItem[];
|
380 | |
381 |
|
382 |
|
383 |
|
384 | line?: AxisLineCfg;
|
385 | |
386 |
|
387 |
|
388 |
|
389 | tickLine?: AxisTickLineCfg;
|
390 | |
391 |
|
392 |
|
393 |
|
394 | subTickLine?: AxisSubTickLineCfg;
|
395 | |
396 |
|
397 |
|
398 |
|
399 | title?: AxisTitleCfg;
|
400 | |
401 |
|
402 |
|
403 | label?: AxisLabelCfg;
|
404 | |
405 |
|
406 |
|
407 | verticalFactor?: number;
|
408 | |
409 |
|
410 |
|
411 |
|
412 | verticalLimitLength?: number;
|
413 | |
414 |
|
415 |
|
416 | overlapOrder?: string[];
|
417 | |
418 |
|
419 |
|
420 | optimize?: OptimizeCfg;
|
421 | }
|
422 | export interface LineAxisCfg extends AxisBaseCfg {
|
423 | |
424 |
|
425 |
|
426 |
|
427 | start: Point;
|
428 | |
429 |
|
430 |
|
431 |
|
432 | end: Point;
|
433 | }
|
434 | export interface CircleAxisCfg extends AxisBaseCfg {
|
435 | |
436 |
|
437 |
|
438 |
|
439 | center: Point;
|
440 | |
441 |
|
442 |
|
443 |
|
444 | radius: number;
|
445 | |
446 |
|
447 |
|
448 |
|
449 | startAngle?: number;
|
450 | |
451 |
|
452 |
|
453 |
|
454 | endAngle?: number;
|
455 | }
|
456 | export interface GridLineCfg {
|
457 | |
458 |
|
459 |
|
460 |
|
461 | type?: string;
|
462 | |
463 |
|
464 |
|
465 |
|
466 | style?: ShapeAttrs | ShapeAttrsCallback;
|
467 | }
|
468 | export interface GridBaseCfg extends GroupComponentCfg {
|
469 | |
470 |
|
471 |
|
472 |
|
473 | line?: GridLineCfg;
|
474 | |
475 |
|
476 |
|
477 |
|
478 | alternateColor?: string | string[];
|
479 | |
480 |
|
481 |
|
482 |
|
483 | items: GridItem[];
|
484 | |
485 |
|
486 |
|
487 |
|
488 | closed?: boolean;
|
489 | }
|
490 | export interface CircleGridCfg extends GridBaseCfg {
|
491 | |
492 |
|
493 |
|
494 |
|
495 | center: Point;
|
496 | }
|
497 | export interface LegendBaseCfg extends GroupComponentCfg {
|
498 | |
499 |
|
500 |
|
501 |
|
502 | layout?: string;
|
503 | |
504 |
|
505 |
|
506 |
|
507 | x?: number;
|
508 | |
509 |
|
510 |
|
511 |
|
512 | y?: number;
|
513 | |
514 |
|
515 |
|
516 |
|
517 | title?: LegendTitleCfg;
|
518 | |
519 |
|
520 |
|
521 |
|
522 | background?: LegendBackgroundCfg;
|
523 | }
|
524 | export interface CategoryLegendCfg extends LegendBaseCfg {
|
525 | |
526 |
|
527 |
|
528 |
|
529 | itemSpacing?: number;
|
530 | |
531 |
|
532 |
|
533 | maxItemWidth?: number;
|
534 | |
535 |
|
536 |
|
537 |
|
538 | itemWidth?: number;
|
539 | |
540 |
|
541 |
|
542 |
|
543 | itemHeight?: number;
|
544 | |
545 |
|
546 |
|
547 |
|
548 | itemName?: LegendItemNameCfg;
|
549 | |
550 |
|
551 |
|
552 |
|
553 | itemValue?: LegendItemValueCfg;
|
554 | |
555 |
|
556 |
|
557 |
|
558 | maxWidth?: number;
|
559 | |
560 |
|
561 |
|
562 |
|
563 | maxHeight?: number;
|
564 | |
565 |
|
566 |
|
567 |
|
568 | marker?: LegendMarkerCfg;
|
569 | |
570 |
|
571 |
|
572 |
|
573 | items: ListItem[];
|
574 | }
|
575 | export interface ContinueLegendCfg extends LegendBaseCfg {
|
576 | |
577 |
|
578 |
|
579 |
|
580 | min: number;
|
581 | |
582 |
|
583 |
|
584 |
|
585 | max: number;
|
586 | |
587 |
|
588 |
|
589 |
|
590 | value: number[];
|
591 | |
592 |
|
593 |
|
594 |
|
595 | colors: number[];
|
596 | |
597 |
|
598 |
|
599 |
|
600 | track: ContinueLegendTrackCfg;
|
601 | |
602 |
|
603 |
|
604 |
|
605 | rail: ContinueLegendRailCfg;
|
606 | |
607 |
|
608 |
|
609 |
|
610 | label: ContinueLegendLabelCfg;
|
611 | |
612 |
|
613 |
|
614 |
|
615 | handler: ContinueLegendHandlerCfg;
|
616 | |
617 |
|
618 |
|
619 |
|
620 | slidable: boolean;
|
621 | }
|
622 | export interface ContinueLegendTrackCfg {
|
623 | |
624 |
|
625 |
|
626 |
|
627 | style?: ShapeAttrs;
|
628 | }
|
629 | export interface ContinueLegendHandlerCfg {
|
630 | |
631 |
|
632 |
|
633 |
|
634 | size?: number;
|
635 | |
636 |
|
637 |
|
638 |
|
639 | style?: ShapeAttrs;
|
640 | }
|
641 | export interface ContinueLegendRailCfg {
|
642 | |
643 |
|
644 |
|
645 |
|
646 | type?: string;
|
647 | |
648 |
|
649 |
|
650 |
|
651 | size?: number;
|
652 | |
653 |
|
654 |
|
655 |
|
656 | defaultLength?: number;
|
657 | |
658 |
|
659 |
|
660 |
|
661 | style?: ShapeAttrs;
|
662 | }
|
663 | export interface ContinueLegendLabelCfg {
|
664 | |
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 |
|
671 | align?: string;
|
672 | |
673 |
|
674 |
|
675 |
|
676 | spacing?: number;
|
677 | |
678 |
|
679 |
|
680 |
|
681 | style?: ShapeAttrs;
|
682 | }
|
683 | export interface LegendTitleCfg {
|
684 | |
685 |
|
686 |
|
687 |
|
688 | spacing?: number;
|
689 | |
690 |
|
691 |
|
692 |
|
693 | style?: ShapeAttrs;
|
694 | }
|
695 | export interface LegendBackgroundCfg {
|
696 | |
697 |
|
698 |
|
699 |
|
700 | padding?: number | number[];
|
701 | |
702 |
|
703 |
|
704 |
|
705 | style?: ShapeAttrs;
|
706 | }
|
707 | export interface LegendItemNameCfg {
|
708 | |
709 |
|
710 |
|
711 |
|
712 | spacing?: number;
|
713 | |
714 |
|
715 |
|
716 |
|
717 | formatter?: formatterCallback;
|
718 | |
719 |
|
720 |
|
721 |
|
722 | style?: ShapeAttrs;
|
723 | }
|
724 | declare type formatterCallback = (text: string, item: ListItem, index: number) => any;
|
725 | export interface LegendItemValueCfg {
|
726 | |
727 |
|
728 |
|
729 |
|
730 | alignRight?: boolean;
|
731 | |
732 |
|
733 |
|
734 |
|
735 | formatter?: formatterCallback;
|
736 | |
737 |
|
738 |
|
739 |
|
740 | style?: ShapeAttrs;
|
741 | }
|
742 | export interface LegendMarkerCfg {
|
743 | |
744 |
|
745 |
|
746 |
|
747 | spacing?: number;
|
748 | |
749 |
|
750 |
|
751 | symbol?: string | ((x: number, y: number, r: number) => any);
|
752 | /**
|
753 | * 图例项 marker 的配置项
|
754 | * @type {ShapeAttrs}
|
755 | */
|
756 | style?: ShapeAttrs;
|
757 | }
|
758 | export declare type TooltipPosition = 'top' | 'left' | 'right' | 'bottom' | 'auto';
|
759 | export 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 | * 是否跟随鼠标移动,会影响 x,y的定位
|
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 | }
|
836 | export interface LocationCfg {
|
837 | [key: string]: any;
|
838 | }
|
839 | export 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 | }
|
851 | export interface RegionLocationCfg extends LocationCfg {
|
852 | /**
|
853 | * 起始点
|
854 | * @type {Point}
|
855 | */
|
856 | start?: Point;
|
857 | /**
|
858 | * 结束点
|
859 | * @type {Point}
|
860 | */
|
861 | end?: Point;
|
862 | }
|
863 | export interface PointsLocationCfg extends LocationCfg {
|
864 | /**
|
865 | * 定位点的集合
|
866 | * @type {Point[]}
|
867 | */
|
868 | points?: Point[];
|
869 | }
|
870 | export 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 | */
|
895 | export interface ShapeAnnotationCfg extends GroupComponentCfg {
|
896 | /** 自定义 render 函数,注意绘制的 shape/group 需要设置 id */
|
897 | render: (container: IGroup) => void;
|
898 | }
|
899 |
|
900 |
|
901 |
|
902 | export interface HtmlAnnotationCfg extends HtmlComponentCfg {
|
903 |
|
904 | alignX?: 'left' | 'middle' | 'right';
|
905 |
|
906 | alignY?: 'top' | 'middle' | 'bottom';
|
907 |
|
908 | html: string | HTMLElement | ((container: HTMLElement) => void | string | HTMLElement);
|
909 | /** zIndex 设置 */
|
910 | zIndex?: number;
|
911 | }
|
912 | export 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 | }
|
924 | export 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 | }
|
946 | export 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 | }
|
968 | export 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 | }
|
985 | export 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 | }
|
1007 | export 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 | }
|
1034 | export interface DataMarkerTextCfg extends EnhancedTextCfg {
|
1035 | display?: boolean;
|
1036 | }
|
1037 | export 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 | * Coord 的 BBox,用于 autoAdjust
|
1068 | */
|
1069 | coordBBox?: BBox;
|
1070 | }
|
1071 | export interface DataRegionAnnotationCfg extends GroupComponentCfg {
|
1072 | /**
|
1073 | * 位置点信息
|
1074 | * @type {Point}
|
1075 | */
|
1076 | points: Point[];
|
1077 | region?: {
|
1078 | style?: ShapeAttrs;
|
1079 | };
|
1080 | text: EnhancedTextCfg;
|
1081 | }
|
1082 | export 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 | }
|
1102 | export 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 | }
|
1119 | export interface LineCrosshairCfg extends CrosshairBaseCfg {
|
1120 | /**
|
1121 | * 起始点
|
1122 | * @type {Point}
|
1123 | */
|
1124 | start: Point;
|
1125 | /**
|
1126 | * 结束点
|
1127 | * @type {Point}
|
1128 | */
|
1129 | end: Point;
|
1130 | }
|
1131 | export 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 | }
|
1153 | export interface CrosshairTextBaseCfg {
|
1154 | /**
|
1155 | * 文本位置,只支持 start, end
|
1156 | * @type {string}
|
1157 | */
|
1158 | position?: string;
|
1159 | /**
|
1160 | * 文本内容
|
1161 | */
|
1162 | content?: string;
|
1163 | /**
|
1164 | * 距离线的距离
|
1165 | * @type {number}
|
1166 | */
|
1167 | offset?: number;
|
1168 | }
|
1169 | export interface CrosshairTextCfg extends CrosshairTextBaseCfg {
|
1170 | /**
|
1171 | * 是否自动旋转
|
1172 | * @type {boolean}
|
1173 | */
|
1174 | autoRotate?: boolean;
|
1175 | /**
|
1176 | * 文本的配置项
|
1177 | * @type {ShapeAttrs}
|
1178 | */
|
1179 | style?: ShapeAttrs;
|
1180 | }
|
1181 | export 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 | }
|
1203 | export interface CrosshairLineCfg {
|
1204 | /**
|
1205 | * 线的配置项
|
1206 | * @type {ShapeAttrs}
|
1207 | */
|
1208 | style?: ShapeAttrs;
|
1209 | }
|
1210 | export interface CrosshairTextBackgroundCfg {
|
1211 | /**
|
1212 | * 文本背景周围的留白
|
1213 | * @type {number|number[]}
|
1214 | */
|
1215 | padding?: number | number[];
|
1216 | /**
|
1217 | * 文本背景的样式
|
1218 | * @type {ShapeAttrs}
|
1219 | */
|
1220 | style?: ShapeAttrs;
|
1221 | }
|
1222 | export { SliderCfg, TrendCfg } from './slider';
|
1223 | export { ScrollbarCfg, ScrollbarTheme } from './scrollbar';
|
1224 |
|
\ | No newline at end of file |