1 | import { COMPONENT_TYPE, DIRECTION, LAYER } from './constant';
|
2 | import { AxisLabelCfg, AxisLineCfg, AxisSubTickLineCfg, AxisTickLineCfg, AxisTitleCfg, ContinueLegendHandlerCfg, ContinueLegendLabelCfg, ContinueLegendRailCfg, ContinueLegendTrackCfg, Coordinate, CrosshairLineCfg, CrosshairTextBackgroundCfg, CrosshairTextCfg, EnhancedTextCfg, GridLineCfg, GroupComponent, HtmlComponent, ICanvas, IGroup, IShape, CategoryLegendCfg, LegendBackgroundCfg, LegendItemNameCfg, LegendItemValueCfg, LegendMarkerCfg, LegendTitleCfg, LegendPageNavigatorCfg, PathCommand, Scale, ScaleConfig, ShapeAttrs, LineAnnotationTextCfg, TrendCfg } from './dependents';
|
3 | import { View } from './chart';
|
4 | import { Facet } from './facet';
|
5 | import Element from './geometry/element';
|
6 | import { PaddingCalCtor } from './chart/layout/padding-cal';
|
7 | import { LegendRadio } from '@antv/component';
|
8 |
|
9 | export interface LooseObject {
|
10 | [key: string]: any;
|
11 | }
|
12 |
|
13 | export interface Point {
|
14 | readonly x: number;
|
15 | readonly y: number;
|
16 | }
|
17 |
|
18 | export interface Region {
|
19 | readonly start: Point;
|
20 | readonly end: Point;
|
21 | }
|
22 |
|
23 | export interface Size {
|
24 | readonly width: number;
|
25 | readonly height: number;
|
26 | }
|
27 |
|
28 | export interface RangePoint {
|
29 | readonly x?: number | number[];
|
30 | readonly y?: number | number[];
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 | export declare type AriaOption = false | {
|
36 | readonly label: string;
|
37 | };
|
38 |
|
39 | export interface MappingDatum {
|
40 |
|
41 | _origin: Datum;
|
42 |
|
43 | points?: ShapeVertices;
|
44 |
|
45 | nextPoints?: ShapeVertices;
|
46 |
|
47 | x?: number[] | number;
|
48 |
|
49 | y?: number[] | number;
|
50 |
|
51 | color?: string;
|
52 |
|
53 | shape?: string | string[];
|
54 |
|
55 | size?: number;
|
56 | }
|
57 |
|
58 | export interface ShapeInfo {
|
59 |
|
60 | x: number | number[];
|
61 |
|
62 | y: number | number[];
|
63 |
|
64 | shape?: string | string[];
|
65 |
|
66 | size?: number;
|
67 |
|
68 | color?: string;
|
69 |
|
70 | style?: LooseObject;
|
71 |
|
72 | isInCircle?: boolean;
|
73 |
|
74 | data?: Datum | Data;
|
75 |
|
76 | mappingData?: MappingDatum | MappingDatum[];
|
77 |
|
78 | points?: ShapeVertices;
|
79 |
|
80 | nextPoints?: ShapeVertices;
|
81 |
|
82 | text?: string;
|
83 |
|
84 | isStack?: boolean;
|
85 |
|
86 | connectNulls?: boolean;
|
87 |
|
88 | background?: {
|
89 | style?: ShapeAttrs;
|
90 | };
|
91 |
|
92 | showSinglePoint?: boolean;
|
93 |
|
94 | defaultStyle?: LooseObject;
|
95 |
|
96 | customInfo?: CustomOption;
|
97 | }
|
98 |
|
99 | export interface AnimateCfg {
|
100 |
|
101 | readonly easing?: string | AnimateEasingCallback;
|
102 |
|
103 | readonly animation?: string;
|
104 |
|
105 | readonly duration?: number | AnimateDurationCallback;
|
106 |
|
107 | readonly delay?: number | AnimateDelayCallback;
|
108 |
|
109 | readonly callback?: () => any;
|
110 |
|
111 | readonly repeat?: boolean;
|
112 | }
|
113 |
|
114 | export interface GAnimateCfg {
|
115 |
|
116 | readonly duration: number;
|
117 |
|
118 | readonly easing?: string;
|
119 |
|
120 | readonly animation?: string;
|
121 |
|
122 | readonly delay?: number;
|
123 |
|
124 | readonly callback?: () => any;
|
125 |
|
126 | readonly repeat?: boolean;
|
127 | }
|
128 |
|
129 | export interface AttributeOption {
|
130 |
|
131 | fields?: string[];
|
132 |
|
133 | callback?: (...args: any[]) => any;
|
134 |
|
135 | values?: any[];
|
136 | }
|
137 |
|
138 | export interface AdjustOption {
|
139 |
|
140 | readonly type: AdjustType;
|
141 | |
142 |
|
143 |
|
144 |
|
145 |
|
146 | readonly marginRatio?: number;
|
147 | |
148 |
|
149 |
|
150 | readonly dodgeBy?: string;
|
151 | |
152 |
|
153 |
|
154 | readonly reverseOrder?: boolean;
|
155 | }
|
156 |
|
157 | export interface StyleOption {
|
158 |
|
159 | readonly fields?: string[];
|
160 |
|
161 | readonly callback?: (...args: any[]) => LooseObject;
|
162 |
|
163 | readonly cfg?: LooseObject;
|
164 | }
|
165 |
|
166 | export declare type CustomOption = any;
|
167 |
|
168 | export interface GeometryTooltipOption {
|
169 |
|
170 | readonly fields: string[];
|
171 |
|
172 | readonly callback?: (...args: any[]) => LooseObject;
|
173 | }
|
174 | export interface GeometryLabelLayoutCfg {
|
175 |
|
176 | type: string;
|
177 |
|
178 | cfg?: LooseObject;
|
179 | }
|
180 |
|
181 | export interface GeometryLabelCfg {
|
182 | |
183 |
|
184 |
|
185 |
|
186 | type?: string;
|
187 |
|
188 | offset?: number | string;
|
189 |
|
190 | offsetX?: number;
|
191 |
|
192 | offsetY?: number;
|
193 | |
194 |
|
195 |
|
196 |
|
197 |
|
198 | content?: string | IGroup | IShape | GeometryLabelContentCallback;
|
199 |
|
200 | style?: LooseObject;
|
201 |
|
202 | autoRotate?: boolean;
|
203 | |
204 |
|
205 |
|
206 | rotate?: number;
|
207 |
|
208 | labelHeight?: number;
|
209 | |
210 |
|
211 |
|
212 | labelLine?: null | boolean | {
|
213 | style?: object;
|
214 | };
|
215 |
|
216 | labelEmit?: boolean;
|
217 | |
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 | layout?: GeometryLabelLayoutCfg | GeometryLabelLayoutCfg[];
|
233 | |
234 |
|
235 |
|
236 | background?: {
|
237 | |
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 | style?: ShapeAttrs;
|
245 |
|
246 | padding?: number | number[];
|
247 | };
|
248 | |
249 |
|
250 |
|
251 | position?: ((data: Datum, mappingData: MappingDatum, index: number) => IntervalGeometryLabelPosition) | IntervalGeometryLabelPosition;
|
252 | /** 动画配置。 */
|
253 | animate?: AnimateOption | false | null;
|
254 | }
|
255 | /** `geometry().label({})` 配置定义 */
|
256 | export interface LabelOption {
|
257 | /** 映射的字段。 */
|
258 | fields?: string[];
|
259 | /** 回调函数。 */
|
260 | callback?: LabelCallback;
|
261 | cfg?: GeometryLabelCfg;
|
262 | }
|
263 | /** Geometry 下每个 state 的配置结构 */
|
264 | export interface StateCfg {
|
265 | /** 状态样式配置。 */
|
266 | style?: object | StateStyleCallback;
|
267 | }
|
268 | /** geometry.state({}) 配置定义 */
|
269 | export interface StateOption {
|
270 | /** 默认状态样式。 */
|
271 | default?: StateCfg;
|
272 | /** active 状态配置。 */
|
273 | active?: StateCfg;
|
274 | /** inactive 状态配置。 */
|
275 | inactive?: StateCfg;
|
276 | /** selected 状态配置。 */
|
277 | selected?: StateCfg;
|
278 | }
|
279 | /** interval label 的位置 */
|
280 | export declare type IntervalGeometryLabelPosition = 'top' | 'bottom' | 'middle' | 'left' | 'right';
|
281 | /** G2 提供的 adjust 类型 */
|
282 | export declare type AdjustType = 'stack' | 'jitter' | 'dodge' | 'symmetric';
|
283 | /** geometry.color() 图形属性回调函数定义 */
|
284 | export declare type ColorAttrCallback = (...args: any[]) => string;
|
285 |
|
286 | export declare type ShapeAttrCallback = (...args: any[]) => string | any[];
|
287 |
|
288 | export declare type SizeAttrCallback = (...args: any[]) => number;
|
289 |
|
290 | export declare type TooltipCallback = (...args: any[]) => LooseObject;
|
291 |
|
292 | export declare type StyleCallback = (...args: any[]) => LooseObject;
|
293 |
|
294 | export declare type LabelCallback = (...args: any[]) => GeometryLabelCfg | null | undefined;
|
295 |
|
296 | export declare type GeometryLabelContentCallback = (data: Datum, mappingData: MappingDatum, index: number) => string | IShape | IGroup;
|
297 |
|
298 | export declare type StateStyleCallback = (element: Element) => LooseObject;
|
299 |
|
300 | export interface ShapeMarkerCfg {
|
301 |
|
302 | color: string;
|
303 |
|
304 | isInPolar: boolean;
|
305 | }
|
306 |
|
307 | export interface ShapeMarkerAttrs {
|
308 |
|
309 | symbol: string | ShapeMarkerSymbol;
|
310 | |
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 | style: ShapeAttrs;
|
378 | }
|
379 |
|
380 | export interface ShapePoint {
|
381 |
|
382 | readonly x: number | number[];
|
383 |
|
384 | readonly y?: number | number[];
|
385 |
|
386 | readonly y0?: number;
|
387 | size?: number;
|
388 | }
|
389 |
|
390 | export declare type ViolinShapePoint = ShapePoint & {
|
391 | _size?: number[];
|
392 | };
|
393 |
|
394 | export interface RegisterShapeFactory {
|
395 |
|
396 | readonly defaultShapeType: string;
|
397 |
|
398 | readonly getDefaultPoints?: (pointInfo: ShapePoint) => Point[];
|
399 |
|
400 | readonly getDefaultStyle?: (geometryTheme: LooseObject) => LooseObject;
|
401 |
|
402 | readonly getMarker?: (shapeType: string, markerCfg: ShapeMarkerCfg) => ShapeMarkerAttrs;
|
403 |
|
404 | readonly drawShape?: (shapeType: string, cfg: ShapeInfo, container: IGroup) => IShape | IGroup;
|
405 | }
|
406 |
|
407 | export interface RegisterShape {
|
408 |
|
409 | readonly getPoints?: (pointInfo: ShapePoint) => Point[];
|
410 |
|
411 | readonly getMarker?: (markerCfg: ShapeMarkerCfg) => ShapeMarkerAttrs;
|
412 |
|
413 | readonly draw: (cfg: ShapeInfo, container: IGroup) => IShape | IGroup | void;
|
414 | }
|
415 |
|
416 | export interface Shape extends RegisterShape {
|
417 |
|
418 | coordinate: Coordinate;
|
419 |
|
420 | parsePath: (path: any) => PathCommand[];
|
421 |
|
422 | parsePoint: (point: Point) => Point;
|
423 |
|
424 | parsePoints: (points: Point[]) => Point[];
|
425 | }
|
426 |
|
427 | export interface ShapeFactory extends RegisterShapeFactory {
|
428 |
|
429 | geometryType: string;
|
430 |
|
431 | coordinate: Coordinate;
|
432 |
|
433 | theme: LooseObject;
|
434 |
|
435 | getShape: (shapeType: string | string[]) => Shape;
|
436 |
|
437 | getShapePoints: (shapeType: string | string[], pointInfo: ShapePoint) => Point[];
|
438 | }
|
439 |
|
440 | export declare type ShapeMarkerSymbol = (x: number, y: number, r: number) => PathCommand[];
|
441 |
|
442 | export declare type AnnotationPositionCallback = (xScales: Scale[] | Record<string, Scale>, yScales: Scale[] | Record<string, Scale>) => [number | string, number | string];
|
443 |
|
444 | export declare type AnnotationPosition = [number | string, number | string] | Record<string, number | string> | AnnotationPositionCallback;
|
445 |
|
446 | export interface AnnotationBaseOption {
|
447 | readonly type?: string;
|
448 |
|
449 | readonly top?: boolean;
|
450 |
|
451 | readonly animate?: boolean;
|
452 |
|
453 | readonly animateOption?: ComponentAnimateOption;
|
454 |
|
455 | readonly offsetX?: number;
|
456 |
|
457 | readonly offsetY?: number;
|
458 | }
|
459 |
|
460 | export interface RegionPositionBaseOption extends AnnotationBaseOption {
|
461 |
|
462 | readonly start: AnnotationPosition;
|
463 |
|
464 | readonly end: AnnotationPosition;
|
465 |
|
466 | readonly style?: ShapeAttrs;
|
467 | }
|
468 |
|
469 | export interface PointPositionBaseOption extends AnnotationBaseOption {
|
470 |
|
471 | readonly position: AnnotationPosition;
|
472 | }
|
473 |
|
474 | export interface ImageOption extends RegionPositionBaseOption {
|
475 |
|
476 | readonly src: string;
|
477 | }
|
478 |
|
479 | export interface LineOption extends RegionPositionBaseOption {
|
480 |
|
481 | readonly text?: LineAnnotationTextCfg;
|
482 | }
|
483 |
|
484 | export declare type ArcOption = RegionPositionBaseOption;
|
485 |
|
486 | export declare type RegionOption = RegionPositionBaseOption;
|
487 |
|
488 | export interface TextOption extends PointPositionBaseOption, Omit<EnhancedTextCfg, 'content'> {
|
489 | content?: string | number | ((filteredData: object[]) => string | number);
|
490 | }
|
491 | /** 使用 DataMarker Annotation 组件的配置定义 */
|
492 | export interface DataMarkerOption extends PointPositionBaseOption {
|
493 | /** point 设置 */
|
494 | readonly point?: null | {
|
495 | style?: ShapeAttrs;
|
496 | };
|
497 | /** line 设置 */
|
498 | readonly line?: null | {
|
499 | style?: ShapeAttrs;
|
500 | length?: number;
|
501 | };
|
502 | /** text 设置 */
|
503 | readonly text: null | EnhancedTextCfg;
|
504 | /** 文本超出绘制区域时,是否自动调节文本方向,默认为 true */
|
505 | readonly autoAdjust?: boolean;
|
506 | /** 朝向,默认为 upward,可选值为 'upward' 或者 'downward' */
|
507 | readonly direction?: 'upward' | 'downward';
|
508 | }
|
509 | /** 使用 DataRegion Annotation 组件的配置定义 */
|
510 | export interface DataRegionOption extends RegionPositionBaseOption {
|
511 | /** line长度,default为 0 */
|
512 | readonly lineLength?: number;
|
513 | /** 标注区间的配置 */
|
514 | readonly region?: null | {
|
515 | style?: ShapeAttrs;
|
516 | };
|
517 | /** 文本的配置 */
|
518 | readonly text?: null | EnhancedTextCfg;
|
519 | }
|
520 | /** 使用 RegionFilter Annotation 组件的配置定义 */
|
521 | export interface RegionFilterOption extends RegionPositionBaseOption {
|
522 | /** 染色色值 */
|
523 | readonly color: string;
|
524 | readonly apply?: string[];
|
525 | }
|
526 | /** Shape Annotation 的配置 */
|
527 | export interface ShapeAnnotationOption extends AnnotationBaseOption {
|
528 | /** 自定义 Annotation 绘制函数 */
|
529 | render: (container: IGroup, view: View, helpers: {
|
530 | parsePosition: (position: [string | number, string | number] | Datum) => Point;
|
531 | }) => void;
|
532 | }
|
533 |
|
534 |
|
535 |
|
536 | export interface HtmlAnnotationOption extends PointPositionBaseOption {
|
537 |
|
538 | container?: string | HTMLElement;
|
539 |
|
540 | html: string | HTMLElement | ((container: HTMLElement, view: View) => void | string | HTMLElement);
|
541 | /** X 方向对齐 */
|
542 | alignX?: 'left' | 'middle' | 'right';
|
543 | /** Y 方向对齐 */
|
544 | alignY?: 'top' | 'middle' | 'bottom';
|
545 | /** X 方向偏移 */
|
546 | offsetX?: number;
|
547 | /** Y 方向偏移 */
|
548 | offsetY?: number;
|
549 | }
|
550 | /** Tooltip 内容框的 css 样式定义 */
|
551 | export interface TooltipDomStyles {
|
552 | 'g2-tooltip'?: LooseObject;
|
553 | 'g2-tooltip-title'?: LooseObject;
|
554 | 'g2-tooltip-list'?: LooseObject;
|
555 | 'g2-tooltip-list-item'?: LooseObject;
|
556 | 'g2-tooltip-marker'?: LooseObject;
|
557 | 'g2-tooltip-value'?: LooseObject;
|
558 | 'g2-tooltip-name'?: LooseObject;
|
559 | }
|
560 | /** 目前组件动画允许的参数配置 */
|
561 | export interface ComponentAnimateCfg {
|
562 | /** 动画执行时间 */
|
563 | readonly duration?: number;
|
564 | /** 动画缓动函数 */
|
565 | readonly easing?: string;
|
566 | /** 动画延迟时间 */
|
567 | readonly delay?: number;
|
568 | }
|
569 | /** 组件各个动画类型配置 */
|
570 | export interface ComponentAnimateOption {
|
571 | /** 初入场动画配置 */
|
572 | appear?: ComponentAnimateCfg;
|
573 | /** 更新动画配置 */
|
574 | update?: ComponentAnimateCfg;
|
575 | /** 更新后新入场的动画配置 */
|
576 | enter?: ComponentAnimateCfg;
|
577 | /** 离场动画配置 */
|
578 | leave?: ComponentAnimateCfg;
|
579 | }
|
580 | /** 列定义配置项 */
|
581 | export interface ScaleOption extends ScaleConfig {
|
582 | /** 声明度量类型。 */
|
583 | type?: ScaleType;
|
584 | /**
|
585 | * 同步 scale。
|
586 | *
|
587 | * @example
|
588 | * ```ts
|
589 | * chart.scale({
|
590 | * x: { sync: true },
|
591 | * y: { sync: true },
|
592 | * x1: { sync: 'x1' },
|
593 | * x2: { sync: 'x1' },
|
594 | * });
|
595 | * ```
|
596 | *
|
597 | * 通过以上配置,我们会分别对 x 和 y 两个字段,x1 和 x2 两个字段进行同步度量操作。
|
598 | */
|
599 | sync?: boolean | string;
|
600 | /**
|
601 | * 只对 type: 'time' 的 scale 生效,强制显示最后的日期 tick。
|
602 | */
|
603 | showLast?: boolean;
|
604 | /**
|
605 | * 用于声明使用数据记录中的哪些字段来组成一条数据的唯一 id(如有多个字段,则使用 '-' 连接)。
|
606 | * 数据 id 用于标识 Element 图形元素,应用于 Geometry 中的图形元素 Element 更新。
|
607 | * 默认 G2 内部会有一套 ID 生成规则,如果不能满足用户需求,用户既可以使用该属性配置 id。
|
608 | * @example
|
609 | *
|
610 | * 下面的例子中,声明了将 'x' 和 'y' 字段的数值来作为每条数据记录的 id,即下面数据两条数据的 id 分别为:'1-23' 和 '2-2'。
|
611 | * ```ts
|
612 | * const data = [
|
613 | * { x: 1, y: 23, z: 'a' },
|
614 | * { x: 2, y: 2, z: 'b' },
|
615 | * ];
|
616 | *
|
617 | * chart.scale({
|
618 | * x: { key: true },
|
619 | * y: { key: true },
|
620 | * });
|
621 | * ```
|
622 | */
|
623 | key?: boolean;
|
624 | }
|
625 | /** Geometry 动画参数配置。geometry.animate() */
|
626 | export interface AnimateOption {
|
627 | /** chart 初始化渲染时的入场动画,false/null 表示关闭入场动画。 */
|
628 | appear?: AnimateCfg | false | null;
|
629 | /** chart 发生更新时,新增元素的入场动画,false/null 表示关闭入场动画。 */
|
630 | enter?: AnimateCfg | false | null;
|
631 | /** 更新动画配置,false/null 表示关闭更新动画。 */
|
632 | update?: AnimateCfg | false | null;
|
633 | /** 销毁动画配置,false/null 表示关闭销毁动画。 */
|
634 | leave?: AnimateCfg | false | null;
|
635 | }
|
636 | /** 用于配置项式声明交互行为 */
|
637 | export interface InteractionOption {
|
638 | /** 交互名称 */
|
639 | type: string;
|
640 | /** 交互配置 */
|
641 | cfg?: LooseObject;
|
642 | }
|
643 | /** 用于配置项式的 Geometry 创建方式 */
|
644 | export interface GeometryOption {
|
645 | /** Geometry 的类型。 */
|
646 | type?: 'interval' | 'line' | 'path' | 'point' | 'area' | 'polygon' | 'schema' | 'edge' | 'heatmap' | string;
|
647 | /** position 通道映射规则,对应 `geometry.position()`。 */
|
648 | position?: string | AttributeOption;
|
649 | /** color 通道映射规则,对应 `geometry.color()`。 */
|
650 | color?: string | AttributeOption;
|
651 | /** shape 通道映射规则,对应 `geometry.shape()`。 */
|
652 | shape?: string | AttributeOption;
|
653 | /** size 通道映射规则,对应 `geometry.size()`。 */
|
654 | size?: number | string | AttributeOption;
|
655 | /** adjust 数据调整方式,对应 `geometry.adjust()`。 */
|
656 | adjust?: string | string[] | AdjustOption | AdjustOption[];
|
657 | /** style 样式配置,对应 `geometry.size()`。 */
|
658 | style?: StyleOption | LooseObject;
|
659 | /** tooltip 配置,对应 `geometry.tooltip()`。 */
|
660 | tooltip?: GeometryTooltipOption | boolean | string;
|
661 | /** Geometry 动画配置,对应 `geometry.animate()`。 */
|
662 | animate?: AnimateOption | boolean;
|
663 | /** Label 配置,对应 `geometry.label()`。 */
|
664 | label?: LabelOption | false | string;
|
665 | /** state 样式配置,对应 `geometry.state()`。 */
|
666 | state?: StateOption;
|
667 | /** 其他配置 */
|
668 | cfg?: {
|
669 | /** 是否对数据进行排序 */
|
670 | sortable?: boolean;
|
671 | /** 是否可见 */
|
672 | visible?: boolean;
|
673 | /** 是否连接空值,仅对 'line', 'area' 和 'path' 生效 */
|
674 | connectNulls?: boolean;
|
675 | };
|
676 | }
|
677 | /** 用于配置型式的 View 声明方式 */
|
678 | export interface ViewOption {
|
679 | /** view 的唯一表示 ID */
|
680 | readonly id?: string;
|
681 | /** view 的绘制范围,起始点为左上角。 */
|
682 | readonly region?: Region;
|
683 | /**
|
684 | * 设置图表的内边距,使用方式参考 CSS 盒模型。
|
685 | * 下图黄色区域即为 padding 的范围。
|
686 | * ![](https:
|
687 | *
|
688 | * @example
|
689 | * 1. padding: 20
|
690 | * 2. padding: [ 10, 30, 30 ]
|
691 | */
|
692 | readonly padding?: ViewPadding;
|
693 |
|
694 | readonly theme?: LooseObject | string;
|
695 |
|
696 | readonly visible?: boolean;
|
697 | |
698 |
|
699 |
|
700 | readonly options?: Options;
|
701 | }
|
702 |
|
703 | export interface ChartCfg extends Omit<ViewCfg, 'parent' | 'canvas' | 'foregroundGroup' | 'middleGroup' | 'backgroundGroup' | 'region'> {
|
704 |
|
705 | readonly container: string | HTMLElement;
|
706 |
|
707 | readonly width?: number;
|
708 |
|
709 | readonly height?: number;
|
710 | |
711 |
|
712 |
|
713 |
|
714 | readonly autoFit?: boolean;
|
715 |
|
716 | readonly renderer?: Renderer;
|
717 |
|
718 | readonly pixelRatio?: number;
|
719 | |
720 |
|
721 |
|
722 | readonly localRefresh?: boolean;
|
723 |
|
724 | readonly supportCSSTransform?: boolean;
|
725 | |
726 |
|
727 |
|
728 | readonly defaultInteractions?: string[];
|
729 | }
|
730 | export declare type SyncViewPaddingFn = (chart: View, views: View[], PC: PaddingCalCtor) => void;
|
731 |
|
732 | export interface ViewCfg {
|
733 |
|
734 | readonly id?: string;
|
735 |
|
736 | readonly parent: View;
|
737 |
|
738 | readonly canvas: ICanvas;
|
739 |
|
740 | readonly foregroundGroup: IGroup;
|
741 |
|
742 | readonly middleGroup: IGroup;
|
743 |
|
744 | readonly backgroundGroup: IGroup;
|
745 |
|
746 | readonly region?: Region;
|
747 |
|
748 | readonly limitInPlot?: boolean;
|
749 | |
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 | readonly padding?: ViewPadding;
|
759 | |
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 | readonly appendPadding?: ViewAppendPadding;
|
766 | |
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 | readonly syncViewPadding?: boolean | SyncViewPaddingFn;
|
776 |
|
777 | readonly theme?: LooseObject | string;
|
778 | |
779 |
|
780 |
|
781 | readonly options?: Options;
|
782 |
|
783 | readonly visible?: boolean;
|
784 | }
|
785 |
|
786 |
|
787 |
|
788 |
|
789 | export interface ComponentOption {
|
790 | readonly id?: string;
|
791 | readonly component: GroupComponent | HtmlComponent;
|
792 | readonly layer: LAYER;
|
793 | direction: DIRECTION;
|
794 | readonly type: COMPONENT_TYPE;
|
795 | readonly extra?: any;
|
796 | }
|
797 |
|
798 | export interface MarkerCfg extends LegendMarkerCfg {
|
799 |
|
800 | symbol?: Marker | MarkerCallback;
|
801 | style?: ShapeAttrs | ((style: ShapeAttrs) => ShapeAttrs);
|
802 | }
|
803 |
|
804 | export interface LegendItem {
|
805 | |
806 |
|
807 |
|
808 | id?: string;
|
809 |
|
810 | name: string;
|
811 |
|
812 | value: any;
|
813 |
|
814 | marker?: MarkerCfg | ((name: string, index: number, item: {
|
815 | name: string;
|
816 | value: string;
|
817 | } & MarkerCfg) => MarkerCfg);
|
818 |
|
819 | unchecked?: boolean;
|
820 | }
|
821 | export interface G2LegendTitleCfg extends LegendTitleCfg {
|
822 |
|
823 | text?: string;
|
824 | }
|
825 |
|
826 |
|
827 |
|
828 | export interface LegendCfg extends Omit<CategoryLegendCfg, 'marker'> {
|
829 | |
830 |
|
831 |
|
832 | readonly custom?: boolean;
|
833 | |
834 |
|
835 |
|
836 | layout?: 'horizontal' | 'vertical';
|
837 | |
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 | title?: G2LegendTitleCfg;
|
852 | |
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 | background?: LegendBackgroundCfg;
|
867 |
|
868 | position?: 'top' | 'top-left' | 'top-right' | 'right' | 'right-top' | 'right-bottom' | 'left' | 'left-top' | 'left-bottom' | 'bottom' | 'bottom-left' | 'bottom-right';
|
869 |
|
870 | animate?: boolean;
|
871 |
|
872 | animateOption?: ComponentAnimateOption;
|
873 | |
874 |
|
875 |
|
876 | itemSpacing?: number;
|
877 | |
878 |
|
879 |
|
880 | itemMarginBottom?: number;
|
881 | |
882 |
|
883 |
|
884 |
|
885 |
|
886 | maxItemWidth?: number;
|
887 | |
888 |
|
889 |
|
890 | itemWidth?: number;
|
891 | |
892 |
|
893 |
|
894 | itemHeight?: number;
|
895 | |
896 |
|
897 |
|
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 | itemName?: LegendItemNameCfg;
|
910 | |
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 | itemValue?: LegendItemValueCfg;
|
925 | |
926 |
|
927 |
|
928 | maxWidth?: number;
|
929 | |
930 |
|
931 |
|
932 | maxHeight?: number;
|
933 | |
934 |
|
935 |
|
936 | maxWidthRatio?: number;
|
937 | |
938 |
|
939 |
|
940 | maxHeightRatio?: number;
|
941 | |
942 |
|
943 |
|
944 | marker?: MarkerCfg | ((name: string, index: number, item: {
|
945 | name: string;
|
946 | value: string;
|
947 | } & MarkerCfg) => MarkerCfg);
|
948 | |
949 |
|
950 |
|
951 | flipPage?: boolean;
|
952 | |
953 |
|
954 |
|
955 | pageNavigator?: LegendPageNavigatorCfg;
|
956 | |
957 |
|
958 |
|
959 | items?: LegendItem[];
|
960 | |
961 |
|
962 |
|
963 | radio?: LegendRadio;
|
964 | |
965 |
|
966 |
|
967 | reversed?: boolean;
|
968 | |
969 |
|
970 |
|
971 | min?: number;
|
972 | |
973 |
|
974 |
|
975 | max?: number;
|
976 | |
977 |
|
978 |
|
979 | value?: number[];
|
980 | |
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 | track?: ContinueLegendTrackCfg;
|
993 | |
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 | rail?: ContinueLegendRailCfg;
|
1009 | |
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 | label?: ContinueLegendLabelCfg;
|
1028 | |
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 | handler?: ContinueLegendHandlerCfg;
|
1042 | |
1043 |
|
1044 |
|
1045 | slidable?: boolean;
|
1046 |
|
1047 | offsetX?: number;
|
1048 |
|
1049 | offsetY?: number;
|
1050 |
|
1051 | padding?: number[];
|
1052 | |
1053 |
|
1054 |
|
1055 | selected?: {
|
1056 | [key: string]: boolean;
|
1057 | };
|
1058 | }
|
1059 |
|
1060 |
|
1061 |
|
1062 | export interface TooltipCrosshairsText extends CrosshairTextCfg {
|
1063 |
|
1064 | content?: string;
|
1065 | }
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 | export declare type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
|
1075 |
|
1076 | export interface TooltipCrosshairs {
|
1077 | |
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 |
|
1085 |
|
1086 | type?: 'x' | 'y' | 'xy';
|
1087 | |
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 | line?: CrosshairLineCfg;
|
1100 | |
1101 |
|
1102 |
|
1103 | text?: TooltipCrosshairsText | TooltipCrosshairsTextCallback;
|
1104 | |
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 | textBackground?: CrosshairTextBackgroundCfg;
|
1118 |
|
1119 | follow?: boolean;
|
1120 | }
|
1121 | export declare type TooltipTitle = string | ((title: string, datum: Datum) => string);
|
1122 | export declare type TooltipItem = {
|
1123 |
|
1124 | readonly data: Datum;
|
1125 |
|
1126 | readonly mappingData: Datum;
|
1127 |
|
1128 | readonly name: string;
|
1129 |
|
1130 | readonly value: string | number;
|
1131 |
|
1132 | readonly color: string;
|
1133 |
|
1134 | readonly marker: string;
|
1135 | };
|
1136 |
|
1137 | export interface TooltipCfg {
|
1138 | |
1139 |
|
1140 |
|
1141 |
|
1142 | follow?: boolean;
|
1143 |
|
1144 | enterable?: boolean;
|
1145 |
|
1146 | showDelay?: number;
|
1147 |
|
1148 | showTitle?: boolean;
|
1149 | |
1150 |
|
1151 |
|
1152 |
|
1153 | title?: TooltipTitle;
|
1154 |
|
1155 | position?: 'top' | 'bottom' | 'left' | 'right';
|
1156 |
|
1157 | shared?: boolean;
|
1158 |
|
1159 | showCrosshairs?: boolean;
|
1160 |
|
1161 | crosshairs?: TooltipCrosshairs;
|
1162 |
|
1163 | showMarkers?: boolean;
|
1164 |
|
1165 | marker?: object;
|
1166 |
|
1167 | showContent?: boolean | ((datum: Datum) => boolean);
|
1168 |
|
1169 | container?: string | HTMLElement;
|
1170 |
|
1171 | containerTpl?: string;
|
1172 |
|
1173 | itemTpl?: string;
|
1174 |
|
1175 | domStyles?: TooltipDomStyles;
|
1176 |
|
1177 | offset?: number;
|
1178 |
|
1179 | reversed?: boolean;
|
1180 |
|
1181 | showNil?: boolean;
|
1182 |
|
1183 | customItems?: (originalItems: TooltipItem[]) => TooltipItem[];
|
1184 |
|
1185 | customContent?: (title: string, data: any[]) => string | HTMLElement;
|
1186 | }
|
1187 |
|
1188 | export interface CoordinateOption {
|
1189 |
|
1190 | type?: 'polar' | 'theta' | 'rect' | 'cartesian' | 'helix';
|
1191 |
|
1192 | cfg?: CoordinateCfg;
|
1193 | |
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 | actions?: CoordinateActions[];
|
1201 | }
|
1202 |
|
1203 | export interface CoordinateCfg {
|
1204 | |
1205 |
|
1206 |
|
1207 | startAngle?: number;
|
1208 | |
1209 |
|
1210 |
|
1211 | endAngle?: number;
|
1212 | |
1213 |
|
1214 |
|
1215 | radius?: number;
|
1216 | |
1217 |
|
1218 |
|
1219 | innerRadius?: number;
|
1220 | }
|
1221 |
|
1222 | export interface AxisGridCfg {
|
1223 | |
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 | line?: GridLineCfg;
|
1237 | |
1238 |
|
1239 |
|
1240 | alternateColor?: string | string[];
|
1241 | |
1242 |
|
1243 |
|
1244 | closed?: boolean;
|
1245 | |
1246 |
|
1247 |
|
1248 |
|
1249 | alignTick?: boolean;
|
1250 | }
|
1251 |
|
1252 | export interface AxisCfg {
|
1253 | |
1254 |
|
1255 |
|
1256 | top?: boolean;
|
1257 | |
1258 |
|
1259 |
|
1260 | position?: 'top' | 'bottom' | 'right' | 'left';
|
1261 | |
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 | line?: AxisLineCfg | null;
|
1274 | |
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 | tickLine?: AxisTickLineCfg | null;
|
1289 | |
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 | subTickLine?: AxisSubTickLineCfg | null;
|
1304 | |
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 | title?: AxisTitleCfg | null;
|
1319 | |
1320 |
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 | label?: AxisLabelCfg | null;
|
1345 |
|
1346 | grid?: AxisGridCfg | null;
|
1347 |
|
1348 | animate?: boolean;
|
1349 |
|
1350 | animateOption?: ComponentAnimateOption;
|
1351 |
|
1352 | verticalFactor?: number;
|
1353 | |
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | verticalLimitLength?: number;
|
1361 | }
|
1362 | export interface SliderCfg {
|
1363 |
|
1364 | readonly height?: number;
|
1365 |
|
1366 | readonly trendCfg?: Omit<TrendCfg, 'data'> & {
|
1367 | data?: number[];
|
1368 | };
|
1369 |
|
1370 | readonly backgroundStyle?: any;
|
1371 |
|
1372 | readonly foregroundStyle?: any;
|
1373 |
|
1374 | readonly handlerStyle?: any;
|
1375 |
|
1376 | readonly textStyle?: any;
|
1377 |
|
1378 | readonly minLimit?: number;
|
1379 |
|
1380 | readonly maxLimit?: number;
|
1381 |
|
1382 | readonly start?: number;
|
1383 |
|
1384 | readonly end?: number;
|
1385 |
|
1386 | readonly padding?: number[];
|
1387 |
|
1388 | formatter?: (val: any, datum: Datum, idx: number) => any;
|
1389 | }
|
1390 |
|
1391 |
|
1392 |
|
1393 | export declare type EventPayload = LooseObject & {
|
1394 |
|
1395 | source?: string;
|
1396 | };
|
1397 | export declare type EventCallback = (event: LooseObject) => void;
|
1398 |
|
1399 |
|
1400 |
|
1401 |
|
1402 | export interface EventCfg {
|
1403 | [key: string]: EventCallback;
|
1404 | }
|
1405 |
|
1406 |
|
1407 |
|
1408 | export declare type SliderOption = SliderCfg | boolean;
|
1409 |
|
1410 | export interface ScrollbarCfg {
|
1411 |
|
1412 | type?: 'horizontal' | 'vertical';
|
1413 |
|
1414 | width?: number;
|
1415 |
|
1416 | height?: number;
|
1417 |
|
1418 | padding?: Padding;
|
1419 |
|
1420 | categorySize?: number;
|
1421 |
|
1422 | animate?: boolean;
|
1423 |
|
1424 | style?: {
|
1425 |
|
1426 | trackColor?: string;
|
1427 |
|
1428 | thumbColor?: string;
|
1429 |
|
1430 | thumbHighlightColor?: string;
|
1431 | lineCap?: string;
|
1432 | };
|
1433 | }
|
1434 |
|
1435 | export declare type ScrollbarOption = ScrollbarCfg | boolean;
|
1436 |
|
1437 | export interface Options {
|
1438 |
|
1439 | readonly data?: Data;
|
1440 |
|
1441 | readonly filters?: Record<string, FilterCondition>;
|
1442 |
|
1443 | readonly axes?: Record<string, AxisOption> | boolean;
|
1444 |
|
1445 | readonly legends?: AllLegendsOptions;
|
1446 |
|
1447 | readonly scales?: Record<string, ScaleOption>;
|
1448 |
|
1449 | readonly tooltip?: TooltipOption;
|
1450 |
|
1451 | readonly coordinate?: CoordinateOption;
|
1452 |
|
1453 | readonly annotations?: (ArcOption | RegionFilterOption | ImageOption | LineOption | TextOption | RegionOption | DataMarkerOption | DataRegionOption)[];
|
1454 |
|
1455 | readonly geometries?: GeometryOption[];
|
1456 |
|
1457 | readonly animate?: boolean;
|
1458 |
|
1459 | readonly interactions?: InteractionOption[];
|
1460 |
|
1461 | readonly events?: EventCfg;
|
1462 |
|
1463 | readonly slider?: SliderOption;
|
1464 |
|
1465 | readonly scrollbar?: ScrollbarOption;
|
1466 |
|
1467 | readonly views?: ViewOption[];
|
1468 |
|
1469 | readonly facets?: (RectCfg | MirrorCfg | CircleCfg | ListCfg | TreeCfg)[];
|
1470 |
|
1471 | readonly [name: string]: any;
|
1472 | }
|
1473 |
|
1474 | export declare type Marker = 'circle' | 'square' | 'diamond' | 'triangle' | 'triangle-down' | 'hexagon' | 'bowtie' | 'cross' | 'tick' | 'plus' | 'hyphen' | 'line';
|
1475 |
|
1476 | export declare type MarkerCallback = (x: number, y: number, r: number) => PathCommand[];
|
1477 |
|
1478 | export declare type TooltipOption = TooltipCfg | boolean;
|
1479 | export declare type FilterCondition = (value: any, datum: Datum, idx?: number) => boolean;
|
1480 |
|
1481 | export declare type AxisOption = AxisCfg | boolean;
|
1482 |
|
1483 | export declare type LegendOption = LegendCfg | boolean;
|
1484 |
|
1485 | export declare type AllLegendsOptions = LegendCfg | Record<string, LegendOption> | boolean;
|
1486 |
|
1487 | export declare type ScaleType = 'linear' | 'cat' | 'category' | 'identity' | 'log' | 'pow' | 'time' | 'timeCat' | 'quantize' | 'quantile';
|
1488 | export declare type CoordinateRotate = ['rotate', number];
|
1489 | export declare type CoordinateReflect = ['reflect', 'x' | 'y'];
|
1490 | export declare type CoordinateScale = ['scale', number, number];
|
1491 | export declare type CoordinateTranspose = ['transpose'];
|
1492 |
|
1493 | export declare type CoordinateActions = CoordinateRotate | CoordinateReflect | CoordinateScale | CoordinateTranspose;
|
1494 | export declare type FacetCtor = new (view: View, cfg: any) => Facet;
|
1495 | export interface Condition {
|
1496 | readonly field: string;
|
1497 | readonly value: any;
|
1498 | readonly values: any[];
|
1499 | }
|
1500 | export declare type FacetDataFilter = (data: Datum[]) => boolean;
|
1501 |
|
1502 |
|
1503 |
|
1504 | export interface FacetCfg<D> {
|
1505 |
|
1506 | readonly type?: string;
|
1507 |
|
1508 | readonly eachView: (innerView: View, facet?: D) => any;
|
1509 |
|
1510 | readonly spacing?: [number | string, number | string];
|
1511 |
|
1512 | readonly padding?: ViewPadding;
|
1513 |
|
1514 | readonly showTitle?: boolean;
|
1515 |
|
1516 | readonly fields: string[];
|
1517 | }
|
1518 |
|
1519 |
|
1520 |
|
1521 | export interface FacetTitle {
|
1522 |
|
1523 | readonly offsetX?: number;
|
1524 |
|
1525 | readonly offsetY?: number;
|
1526 |
|
1527 | readonly style?: object;
|
1528 | readonly formatter?: (val: any) => any;
|
1529 | }
|
1530 |
|
1531 |
|
1532 |
|
1533 | export interface FacetData {
|
1534 |
|
1535 | readonly type: string;
|
1536 |
|
1537 | readonly data: object[];
|
1538 |
|
1539 | readonly region: Region;
|
1540 |
|
1541 | readonly padding?: number;
|
1542 |
|
1543 | view?: View;
|
1544 |
|
1545 | readonly rowField: string;
|
1546 |
|
1547 | readonly columnField: string;
|
1548 |
|
1549 | readonly rowValue: string;
|
1550 |
|
1551 | readonly columnValue: string;
|
1552 |
|
1553 | readonly rowIndex: number;
|
1554 |
|
1555 | readonly columnIndex: number;
|
1556 |
|
1557 | readonly rowValuesLength: number;
|
1558 |
|
1559 | readonly columnValuesLength: number;
|
1560 | }
|
1561 |
|
1562 | export interface RectCfg extends FacetCfg<RectData> {
|
1563 |
|
1564 | readonly columnTitle?: FacetTitle;
|
1565 |
|
1566 | readonly rowTitle?: FacetTitle;
|
1567 | }
|
1568 | export declare type RectData = FacetData;
|
1569 |
|
1570 | export interface MirrorCfg extends FacetCfg<MirrorData> {
|
1571 |
|
1572 | readonly transpose?: boolean;
|
1573 |
|
1574 | readonly title?: FacetTitle;
|
1575 | }
|
1576 | export declare type MirrorData = FacetData;
|
1577 |
|
1578 | export interface ListCfg extends FacetCfg<ListData> {
|
1579 |
|
1580 | readonly cols?: number;
|
1581 |
|
1582 | readonly title?: FacetTitle;
|
1583 | }
|
1584 | export interface ListData extends FacetData {
|
1585 | readonly total?: number;
|
1586 | }
|
1587 |
|
1588 | export interface MatrixCfg extends FacetCfg<MirrorData> {
|
1589 |
|
1590 | readonly columnTitle?: FacetTitle;
|
1591 |
|
1592 | readonly rowTitle?: FacetTitle;
|
1593 | }
|
1594 | export declare type MatrixData = FacetData;
|
1595 |
|
1596 | export interface CircleCfg extends FacetCfg<CircleData> {
|
1597 |
|
1598 | readonly title?: FacetTitle;
|
1599 | }
|
1600 | export declare type CircleData = FacetData;
|
1601 | export interface Line {
|
1602 | readonly style?: ShapeAttrs;
|
1603 | readonly smooth?: boolean;
|
1604 | }
|
1605 |
|
1606 | export interface TreeCfg extends FacetCfg<TreeData> {
|
1607 | readonly line?: Line;
|
1608 | readonly title?: FacetTitle;
|
1609 | }
|
1610 | export interface TreeData extends FacetData {
|
1611 | children?: TreeData[];
|
1612 | originColIndex?: number;
|
1613 | }
|
1614 |
|
1615 |
|
1616 |
|
1617 | export interface FacetCfgMap {
|
1618 |
|
1619 | readonly rect: RectCfg;
|
1620 |
|
1621 | readonly mirror: MirrorCfg;
|
1622 |
|
1623 | readonly list: ListCfg;
|
1624 |
|
1625 | readonly matrix: MatrixCfg;
|
1626 |
|
1627 | readonly circle: CircleCfg;
|
1628 |
|
1629 | readonly tree: TreeCfg;
|
1630 | }
|
1631 | export interface StyleSheet {
|
1632 |
|
1633 | backgroundColor?: string;
|
1634 |
|
1635 | brandColor?: string;
|
1636 |
|
1637 | subColor?: string;
|
1638 |
|
1639 | paletteQualitative10?: string[];
|
1640 |
|
1641 | paletteQualitative20?: string[];
|
1642 |
|
1643 | paletteSemanticRed?: string;
|
1644 |
|
1645 | paletteSemanticGreen?: string;
|
1646 |
|
1647 | paletteSemanticYellow?: string;
|
1648 |
|
1649 | paletteSequence?: string[];
|
1650 |
|
1651 | fontFamily?: string;
|
1652 |
|
1653 | axisLineBorderColor?: string;
|
1654 |
|
1655 | axisLineBorder?: number;
|
1656 |
|
1657 | axisLineDash?: number[];
|
1658 |
|
1659 | axisTitleTextFillColor?: string;
|
1660 |
|
1661 | axisTitleTextFontSize?: number;
|
1662 |
|
1663 | axisTitleTextLineHeight?: number;
|
1664 |
|
1665 | axisTitleTextFontWeight?: number | string;
|
1666 |
|
1667 | axisTitleSpacing?: number;
|
1668 |
|
1669 | axisTickLineBorderColor?: string;
|
1670 |
|
1671 | axisTickLineLength?: number;
|
1672 |
|
1673 | axisTickLineBorder?: number;
|
1674 |
|
1675 | axisSubTickLineBorderColor?: string;
|
1676 |
|
1677 | axisSubTickLineLength?: number;
|
1678 |
|
1679 | axisSubTickLineBorder?: number;
|
1680 |
|
1681 | axisLabelFillColor?: string;
|
1682 |
|
1683 | axisLabelFontSize?: number;
|
1684 |
|
1685 | axisLabelLineHeight?: number;
|
1686 |
|
1687 | axisLabelFontWeight?: number | string;
|
1688 |
|
1689 | axisLabelOffset: number;
|
1690 |
|
1691 | axisGridBorderColor?: string;
|
1692 |
|
1693 | axisGridBorder?: number;
|
1694 |
|
1695 | axisGridLineDash?: number[];
|
1696 |
|
1697 | legendTitleTextFillColor?: string;
|
1698 |
|
1699 | legendTitleTextFontSize?: number;
|
1700 |
|
1701 | legendTitleTextLineHeight?: number;
|
1702 |
|
1703 | legendTitleTextFontWeight?: number | string;
|
1704 |
|
1705 | legendMarkerColor?: string;
|
1706 |
|
1707 | legendMarkerSpacing?: number;
|
1708 |
|
1709 | legendMarkerSize?: number;
|
1710 |
|
1711 | legendCircleMarkerSize?: number;
|
1712 |
|
1713 | legendSquareMarkerSize?: number;
|
1714 |
|
1715 | legendLineMarkerSize?: number;
|
1716 |
|
1717 | legendItemNameFillColor?: string;
|
1718 |
|
1719 | legendItemNameFontSize?: number;
|
1720 |
|
1721 | legendItemNameLineHeight?: number;
|
1722 |
|
1723 | legendItemNameFontWeight?: number | string;
|
1724 |
|
1725 | legendItemSpacing?: number;
|
1726 |
|
1727 | legendItemMarginBottom?: number;
|
1728 |
|
1729 | legendPadding?: number[];
|
1730 |
|
1731 | legendHorizontalPadding?: number[];
|
1732 |
|
1733 | legendVerticalPadding?: number[];
|
1734 |
|
1735 | legendPageNavigatorMarkerSize: number;
|
1736 |
|
1737 | legendPageNavigatorMarkerInactiveFillColor: string;
|
1738 |
|
1739 | legendPageNavigatorMarkerInactiveFillOpacity: number;
|
1740 |
|
1741 | legendPageNavigatorMarkerFillColor: string;
|
1742 |
|
1743 | legendPageNavigatorMarkerFillOpacity: number;
|
1744 |
|
1745 | legendPageNavigatorTextFillColor: string;
|
1746 |
|
1747 | legendPageNavigatorTextFontSize: number;
|
1748 |
|
1749 | sliderRailFillColor?: string;
|
1750 |
|
1751 | sliderRailBorder?: number;
|
1752 |
|
1753 | sliderRailBorderColor?: string;
|
1754 |
|
1755 | sliderRailWidth?: number;
|
1756 |
|
1757 | sliderRailHeight?: number;
|
1758 |
|
1759 | sliderLabelTextFillColor?: string;
|
1760 |
|
1761 | sliderLabelTextFontSize?: number;
|
1762 |
|
1763 | sliderLabelTextLineHeight?: number;
|
1764 |
|
1765 | sliderLabelTextFontWeight?: number | string;
|
1766 |
|
1767 | sliderHandlerFillColor?: string;
|
1768 |
|
1769 | sliderHandlerWidth?: number;
|
1770 |
|
1771 | sliderHandlerHeight?: number;
|
1772 |
|
1773 | sliderHandlerBorder?: number;
|
1774 |
|
1775 | sliderHandlerBorderColor?: string;
|
1776 |
|
1777 | annotationArcBorderColor?: string;
|
1778 |
|
1779 | annotationArcBorder?: number;
|
1780 |
|
1781 | annotationLineBorderColor?: string;
|
1782 |
|
1783 | annotationLineBorder?: number;
|
1784 |
|
1785 | annotationLineDash?: number[];
|
1786 |
|
1787 | annotationTextFillColor?: string;
|
1788 |
|
1789 | annotationTextFontSize?: number;
|
1790 |
|
1791 | annotationTextLineHeight?: number;
|
1792 |
|
1793 | annotationTextFontWeight?: number | string;
|
1794 |
|
1795 | annotationTextBorderColor?: string;
|
1796 |
|
1797 | annotationTextBorder?: number;
|
1798 |
|
1799 | annotationRegionFillColor?: string;
|
1800 |
|
1801 | annotationRegionFillOpacity?: number;
|
1802 |
|
1803 | annotationRegionBorder?: number;
|
1804 |
|
1805 | annotationRegionBorderColor?: string;
|
1806 |
|
1807 | annotationDataMarkerLineLength?: number;
|
1808 |
|
1809 | tooltipCrosshairsBorderColor?: string;
|
1810 |
|
1811 | tooltipCrosshairsBorder?: number;
|
1812 |
|
1813 | tooltipCrosshairsLineDash?: number[];
|
1814 |
|
1815 | tooltipContainerFillColor?: string;
|
1816 |
|
1817 | tooltipContainerFillOpacity?: number;
|
1818 |
|
1819 | tooltipContainerShadow?: string;
|
1820 |
|
1821 | tooltipContainerBorderRadius?: number;
|
1822 |
|
1823 | tooltipTextFillColor?: string;
|
1824 |
|
1825 | tooltipTextFontSize?: number;
|
1826 |
|
1827 | tooltipTextLineHeight?: number;
|
1828 |
|
1829 | tooltipTextFontWeight?: number | string;
|
1830 |
|
1831 | labelFillColor?: string;
|
1832 |
|
1833 | labelFillColorDark?: string;
|
1834 |
|
1835 | labelFillColorLight?: string;
|
1836 |
|
1837 | labelFontSize?: number;
|
1838 |
|
1839 | labelLineHeight?: number;
|
1840 |
|
1841 | labelFontWeight?: number | string;
|
1842 |
|
1843 | labelBorderColor?: string;
|
1844 |
|
1845 | labelBorder?: number;
|
1846 |
|
1847 | innerLabelFillColor?: string;
|
1848 |
|
1849 | innerLabelFontSize?: number;
|
1850 |
|
1851 | innerLabelLineHeight?: number;
|
1852 |
|
1853 | innerLabelFontWeight?: number | string;
|
1854 |
|
1855 | innerLabelBorderColor?: string;
|
1856 |
|
1857 | innerLabelBorder?: number;
|
1858 |
|
1859 | overflowLabelFillColor?: string;
|
1860 |
|
1861 | overflowLabelFillColorDark?: string;
|
1862 |
|
1863 | overflowLabelFillColorLight?: string;
|
1864 |
|
1865 | overflowLabelFontSize?: number;
|
1866 |
|
1867 | overflowLabelLineHeight?: number;
|
1868 |
|
1869 | overflowLabelFontWeight?: number | string;
|
1870 |
|
1871 | overflowLabelBorderColor?: string;
|
1872 |
|
1873 | overflowLabelBorder?: number;
|
1874 |
|
1875 | labelLineBorder?: number;
|
1876 |
|
1877 | labelLineBorderColor?: string;
|
1878 |
|
1879 | cSliderRailHieght?: number;
|
1880 |
|
1881 | cSliderBackgroundFillColor?: string;
|
1882 |
|
1883 | cSliderBackgroundFillOpacity?: number;
|
1884 |
|
1885 | cSliderForegroundFillColor?: string;
|
1886 |
|
1887 | cSliderForegroundFillOpacity?: number;
|
1888 |
|
1889 | cSliderHandlerHeight?: number;
|
1890 |
|
1891 | cSliderHandlerWidth?: number;
|
1892 |
|
1893 | cSliderHandlerFillColor?: string;
|
1894 |
|
1895 | cSliderHandlerFillOpacity?: number;
|
1896 |
|
1897 | cSliderHandlerHighlightFillColor?: string;
|
1898 |
|
1899 | cSliderHandlerBorderColor?: string;
|
1900 |
|
1901 | cSliderHandlerBorder?: number;
|
1902 |
|
1903 | cSliderHandlerBorderRadius?: number;
|
1904 |
|
1905 | cSliderTextFillColor?: string;
|
1906 |
|
1907 | cSliderTextFillOpacity?: number;
|
1908 |
|
1909 | cSliderTextFontSize?: number;
|
1910 |
|
1911 | cSliderTextLineHeight?: number;
|
1912 |
|
1913 | cSliderTextFontWeight?: number | string;
|
1914 |
|
1915 | cSliderTextBorderColor?: string;
|
1916 |
|
1917 | cSliderTextBorder?: number;
|
1918 |
|
1919 | scrollbarTrackFillColor?: string;
|
1920 |
|
1921 | scrollbarThumbFillColor?: string;
|
1922 |
|
1923 | scrollbarThumbHighlightFillColor?: string;
|
1924 |
|
1925 | pointSizeRange?: [number, number];
|
1926 |
|
1927 | pointFillColor?: string;
|
1928 |
|
1929 | pointFillOpacity?: number;
|
1930 |
|
1931 | pointSize?: number;
|
1932 |
|
1933 | pointBorder?: number;
|
1934 |
|
1935 | pointBorderColor?: string;
|
1936 |
|
1937 | pointBorderOpacity?: number;
|
1938 |
|
1939 | pointActiveFillColor?: string;
|
1940 |
|
1941 | pointActiveFillOpacity?: number;
|
1942 |
|
1943 | pointActiveSize?: number;
|
1944 |
|
1945 | pointActiveBorder?: number;
|
1946 |
|
1947 | pointActiveBorderColor?: string;
|
1948 |
|
1949 | pointActiveBorderOpacity?: number;
|
1950 |
|
1951 | pointSelectedFillColor?: string;
|
1952 |
|
1953 | pointSelectedFillOpacity?: number;
|
1954 |
|
1955 | pointSelectedSize?: number;
|
1956 |
|
1957 | pointSelectedBorder?: number;
|
1958 |
|
1959 | pointSelectedBorderColor?: string;
|
1960 |
|
1961 | pointSelectedBorderOpacity?: number;
|
1962 |
|
1963 | pointInactiveFillColor?: string;
|
1964 |
|
1965 | pointInactiveFillOpacity?: number;
|
1966 |
|
1967 | pointInactiveSize?: number;
|
1968 |
|
1969 | pointInactiveBorder?: number;
|
1970 |
|
1971 | pointInactiveBorderColor?: string;
|
1972 |
|
1973 | pointInactiveBorderOpacity?: number;
|
1974 |
|
1975 | hollowPointSize?: number;
|
1976 |
|
1977 | hollowPointBorder?: number;
|
1978 |
|
1979 | hollowPointBorderColor?: string;
|
1980 |
|
1981 | hollowPointBorderOpacity?: number;
|
1982 |
|
1983 | hollowPointFillColor?: string;
|
1984 |
|
1985 | hollowPointFillOpacity?: number;
|
1986 |
|
1987 | hollowPointActiveSize?: number;
|
1988 |
|
1989 | hollowPointActiveBorder?: number;
|
1990 |
|
1991 | hollowPointActiveBorderColor?: string;
|
1992 |
|
1993 | hollowPointActiveBorderOpacity?: number;
|
1994 |
|
1995 | hollowPointSelectedSize?: number;
|
1996 |
|
1997 | hollowPointSelectedBorder?: number;
|
1998 |
|
1999 | hollowPointSelectedBorderColor?: string;
|
2000 |
|
2001 | hollowPointSelectedBorderOpacity?: number;
|
2002 |
|
2003 | hollowPointInactiveSize?: number;
|
2004 |
|
2005 | hollowPointInactiveBorder?: number;
|
2006 |
|
2007 | hollowPointInactiveBorderColor?: string;
|
2008 |
|
2009 | hollowPointInactiveBorderOpacity?: number;
|
2010 |
|
2011 | lineBorder?: number;
|
2012 |
|
2013 | lineBorderColor?: string;
|
2014 |
|
2015 | lineBorderOpacity?: number;
|
2016 |
|
2017 | lineActiveBorder?: number;
|
2018 |
|
2019 | lineActiveBorderColor?: string;
|
2020 |
|
2021 | lineActiveBorderOpacity?: number;
|
2022 |
|
2023 | lineSelectedBorder?: number;
|
2024 |
|
2025 | lineSelectedBorderColor?: string;
|
2026 |
|
2027 | lineSelectedBorderOpacity?: number;
|
2028 |
|
2029 | lineInactiveBorder?: number;
|
2030 |
|
2031 | lineInactiveBorderColor?: string;
|
2032 |
|
2033 | lineInactiveBorderOpacity?: number;
|
2034 | areaBorder?: number;
|
2035 |
|
2036 | areaBorderColor?: string;
|
2037 |
|
2038 | areaBorderOpacity?: number;
|
2039 |
|
2040 | areaFillColor?: string;
|
2041 |
|
2042 | areaFillOpacity?: number;
|
2043 |
|
2044 | areaActiveBorder?: number;
|
2045 |
|
2046 | areaActiveBorderColor?: string;
|
2047 |
|
2048 | areaActiveBorderOpacity?: number;
|
2049 |
|
2050 | areaActiveFillColor?: string;
|
2051 |
|
2052 | areaActiveFillOpacity?: number;
|
2053 |
|
2054 | areaSelectedBorder?: number;
|
2055 |
|
2056 | areaSelectedBorderColor?: string;
|
2057 |
|
2058 | areaSelectedBorderOpacity?: number;
|
2059 |
|
2060 | areaSelectedFillColor?: string;
|
2061 |
|
2062 | areaSelectedFillOpacity?: number;
|
2063 |
|
2064 | areaInactiveBorder?: number;
|
2065 |
|
2066 | areaInactiveBorderColor?: string;
|
2067 |
|
2068 | areaInactiveBorderOpacity?: number;
|
2069 |
|
2070 | areaInactiveFillColor?: string;
|
2071 |
|
2072 | areaInactiveFillOpacity?: number;
|
2073 |
|
2074 | hollowAreaBorder?: number;
|
2075 |
|
2076 | hollowAreaBorderColor?: string;
|
2077 |
|
2078 | hollowAreaBorderOpacity?: number;
|
2079 |
|
2080 | hollowAreaActiveBorder?: number;
|
2081 |
|
2082 | hollowAreaActiveBorderColor?: string;
|
2083 |
|
2084 | hollowAreaActiveBorderOpacity?: number;
|
2085 |
|
2086 | hollowAreaSelectedBorder?: number;
|
2087 |
|
2088 | hollowAreaSelectedBorderColor?: string;
|
2089 |
|
2090 | hollowAreaSelectedBorderOpacity?: number;
|
2091 |
|
2092 | hollowAreaInactiveBorder?: number;
|
2093 |
|
2094 | hollowAreaInactiveBorderColor?: string;
|
2095 |
|
2096 | hollowAreaInactiveBorderOpacity?: number;
|
2097 |
|
2098 | intervalBorder?: number;
|
2099 |
|
2100 | intervalBorderColor?: string;
|
2101 |
|
2102 | intervalBorderOpacity?: number;
|
2103 |
|
2104 | intervalFillColor?: string;
|
2105 |
|
2106 | intervalFillOpacity?: number;
|
2107 |
|
2108 | intervalActiveBorder?: number;
|
2109 |
|
2110 | intervalActiveBorderColor?: string;
|
2111 |
|
2112 | intervalActiveBorderOpacity?: number;
|
2113 |
|
2114 | intervalActiveFillColor?: string;
|
2115 |
|
2116 | intervalActiveFillOpacity?: number;
|
2117 |
|
2118 | intervalSelectedBorder?: number;
|
2119 |
|
2120 | intervalSelectedBorderColor?: string;
|
2121 |
|
2122 | intervalSelectedBorderOpacity?: number;
|
2123 |
|
2124 | intervalSelectedFillColor?: string;
|
2125 |
|
2126 | intervalSelectedFillOpacity?: number;
|
2127 |
|
2128 | intervalInactiveBorder?: number;
|
2129 |
|
2130 | intervalInactiveBorderColor?: string;
|
2131 |
|
2132 | intervalInactiveBorderOpacity?: number;
|
2133 |
|
2134 | intervalInactiveFillColor?: string;
|
2135 |
|
2136 | intervalInactiveFillOpacity?: number;
|
2137 |
|
2138 | hollowIntervalBorder?: number;
|
2139 |
|
2140 | hollowIntervalBorderColor?: string;
|
2141 |
|
2142 | hollowIntervalBorderOpacity?: number;
|
2143 |
|
2144 | hollowIntervalFillColor?: string;
|
2145 |
|
2146 | hollowIntervalFillOpacity?: number;
|
2147 |
|
2148 | hollowIntervalActiveBorder?: number;
|
2149 |
|
2150 | hollowIntervalActiveBorderColor?: string;
|
2151 |
|
2152 | hollowIntervalActiveBorderOpacity?: number;
|
2153 |
|
2154 | hollowIntervalSelectedBorder?: number;
|
2155 |
|
2156 | hollowIntervalSelectedBorderColor?: string;
|
2157 |
|
2158 | hollowIntervalSelectedBorderOpacity?: number;
|
2159 |
|
2160 | hollowIntervalInactiveBorder?: number;
|
2161 |
|
2162 | hollowIntervalInactiveBorderColor?: string;
|
2163 |
|
2164 | hollowIntervalInactiveBorderOpacity?: number;
|
2165 | }
|
2166 |
|
2167 | export declare type StyleSheetCfg = Pick<StyleSheet, 'backgroundColor' | 'subColor' | 'brandColor' | 'paletteQualitative10' | 'paletteQualitative20' | 'paletteSemanticRed' | 'paletteSemanticGreen' | 'paletteSemanticYellow' | 'paletteSequence' | 'fontFamily'>;
|
2168 |
|
2169 | export interface IAction {
|
2170 | |
2171 |
|
2172 |
|
2173 | init(): any;
|
2174 | |
2175 |
|
2176 |
|
2177 | name: string;
|
2178 | |
2179 |
|
2180 |
|
2181 | context: IInteractionContext;
|
2182 | |
2183 |
|
2184 |
|
2185 | destroy(): any;
|
2186 | }
|
2187 |
|
2188 | export interface IInteractionContext extends LooseObject {
|
2189 |
|
2190 | event: LooseObject;
|
2191 | |
2192 |
|
2193 |
|
2194 | view: View;
|
2195 |
|
2196 | actions: IAction[];
|
2197 | |
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 | cache(key: string, value?: any): any;
|
2203 | |
2204 |
|
2205 |
|
2206 |
|
2207 |
|
2208 | getAction(name: any): IAction;
|
2209 | |
2210 |
|
2211 |
|
2212 |
|
2213 | getCurrentPoint(): Point;
|
2214 | |
2215 |
|
2216 |
|
2217 | getCurrentShape(): IShape;
|
2218 | |
2219 |
|
2220 |
|
2221 |
|
2222 | addAction(action: IAction): any;
|
2223 | |
2224 |
|
2225 |
|
2226 |
|
2227 | removeAction(action: IAction): any;
|
2228 | |
2229 |
|
2230 |
|
2231 | isInPlot(): any;
|
2232 | |
2233 |
|
2234 |
|
2235 |
|
2236 | isInComponent(name?: string): any;
|
2237 | |
2238 |
|
2239 |
|
2240 |
|
2241 | isInShape(name: any): any;
|
2242 | |
2243 |
|
2244 |
|
2245 | destroy(): any;
|
2246 | }
|
2247 |
|
2248 | export declare type Renderer = 'svg' | 'canvas';
|
2249 |
|
2250 | export declare type Datum = Record<string, any>;
|
2251 | export declare type Data = Datum[];
|
2252 | export declare type ActionCallback = (context: IInteractionContext) => void;
|
2253 | export declare type Padding = [number, number, number, number];
|
2254 | export declare type ViewPadding = number | number[] | 'auto';
|
2255 | export declare type ViewAppendPadding = number | number[];
|
2256 | export declare type Position = [number, number];
|
2257 | export declare type AttributeType = 'position' | 'size' | 'color' | 'shape';
|
2258 | export declare type ShapeVertices = RangePoint[] | Point[] | Point[][];
|
2259 |
|
2260 | export declare type AnimateEasingCallback = (data: Datum) => string;
|
2261 |
|
2262 | export declare type AnimateDelayCallback = (data: Datum) => number;
|
2263 |
|
2264 | export declare type AnimateDurationCallback = (data: Datum) => number;
|
2265 |
|
\ | No newline at end of file |