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