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