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 | marker?: MarkerCfg;
|
927 | |
928 |
|
929 |
|
930 | flipPage?: boolean;
|
931 | |
932 |
|
933 |
|
934 | pageNavigator?: LegendPageNavigatorCfg;
|
935 | |
936 |
|
937 |
|
938 | items?: LegendItem[];
|
939 | |
940 |
|
941 |
|
942 | reversed?: boolean;
|
943 | |
944 |
|
945 |
|
946 | min?: number;
|
947 | |
948 |
|
949 |
|
950 | max?: number;
|
951 | |
952 |
|
953 |
|
954 | value?: number[];
|
955 | |
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 | track?: ContinueLegendTrackCfg;
|
968 | |
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 | rail?: ContinueLegendRailCfg;
|
984 | |
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 | label?: ContinueLegendLabelCfg;
|
1003 | |
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 | handler?: ContinueLegendHandlerCfg;
|
1017 | |
1018 |
|
1019 |
|
1020 | slidable?: boolean;
|
1021 |
|
1022 | offsetX?: number;
|
1023 |
|
1024 | offsetY?: number;
|
1025 |
|
1026 | padding?: number[];
|
1027 | |
1028 |
|
1029 |
|
1030 | selected?: {
|
1031 | [key: string]: boolean;
|
1032 | };
|
1033 | }
|
1034 |
|
1035 |
|
1036 |
|
1037 | export interface TooltipCrosshairsText extends CrosshairTextCfg {
|
1038 |
|
1039 | content?: string;
|
1040 | }
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 | export declare type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
|
1050 |
|
1051 | export interface TooltipCrosshairs {
|
1052 | |
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 | type?: 'x' | 'y' | 'xy';
|
1062 | |
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 | line?: CrosshairLineCfg;
|
1075 | |
1076 |
|
1077 |
|
1078 | text?: TooltipCrosshairsText | TooltipCrosshairsTextCallback;
|
1079 | |
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 | textBackground?: CrosshairTextBackgroundCfg;
|
1093 |
|
1094 | follow?: boolean;
|
1095 | }
|
1096 | export declare type TooltipTitle = string | ((title: string, datum: Datum) => string);
|
1097 | export declare type TooltipItem = {
|
1098 |
|
1099 | readonly data: Datum;
|
1100 |
|
1101 | readonly mappingData: Datum;
|
1102 |
|
1103 | readonly name: string;
|
1104 |
|
1105 | readonly value: string | number;
|
1106 |
|
1107 | readonly color: string;
|
1108 |
|
1109 | readonly marker: string;
|
1110 | };
|
1111 |
|
1112 | export interface TooltipCfg {
|
1113 | |
1114 |
|
1115 |
|
1116 |
|
1117 | follow?: boolean;
|
1118 |
|
1119 | enterable?: boolean;
|
1120 |
|
1121 | showDelay?: number;
|
1122 |
|
1123 | showTitle?: boolean;
|
1124 | |
1125 |
|
1126 |
|
1127 |
|
1128 | title?: TooltipTitle;
|
1129 |
|
1130 | position?: 'top' | 'bottom' | 'left' | 'right';
|
1131 |
|
1132 | shared?: boolean;
|
1133 |
|
1134 | showCrosshairs?: boolean;
|
1135 |
|
1136 | crosshairs?: TooltipCrosshairs;
|
1137 |
|
1138 | showMarkers?: boolean;
|
1139 |
|
1140 | marker?: object;
|
1141 |
|
1142 | showContent?: boolean | ((datum: Datum) => boolean);
|
1143 |
|
1144 | container?: string | HTMLElement;
|
1145 |
|
1146 | containerTpl?: string;
|
1147 |
|
1148 | itemTpl?: string;
|
1149 |
|
1150 | domStyles?: TooltipDomStyles;
|
1151 |
|
1152 | offset?: number;
|
1153 |
|
1154 | reversed?: boolean;
|
1155 |
|
1156 | showNil?: boolean;
|
1157 |
|
1158 | customItems?: (originalItems: TooltipItem[]) => TooltipItem[];
|
1159 |
|
1160 | customContent?: (title: string, data: any[]) => string | HTMLElement;
|
1161 | }
|
1162 |
|
1163 | export interface CoordinateOption {
|
1164 |
|
1165 | type?: 'polar' | 'theta' | 'rect' | 'cartesian' | 'helix';
|
1166 |
|
1167 | cfg?: CoordinateCfg;
|
1168 | |
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 | actions?: CoordinateActions[];
|
1176 | }
|
1177 |
|
1178 | export interface CoordinateCfg {
|
1179 | |
1180 |
|
1181 |
|
1182 | startAngle?: number;
|
1183 | |
1184 |
|
1185 |
|
1186 | endAngle?: number;
|
1187 | |
1188 |
|
1189 |
|
1190 | radius?: number;
|
1191 | |
1192 |
|
1193 |
|
1194 | innerRadius?: number;
|
1195 | }
|
1196 |
|
1197 | export interface AxisGridCfg {
|
1198 | |
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 | line?: GridLineCfg;
|
1212 | |
1213 |
|
1214 |
|
1215 | alternateColor?: string | string[];
|
1216 | |
1217 |
|
1218 |
|
1219 | closed?: boolean;
|
1220 | |
1221 |
|
1222 |
|
1223 |
|
1224 | alignTick?: boolean;
|
1225 | }
|
1226 |
|
1227 | export interface AxisCfg {
|
1228 | |
1229 |
|
1230 |
|
1231 | top?: boolean;
|
1232 | |
1233 |
|
1234 |
|
1235 | position?: 'top' | 'bottom' | 'right' | 'left';
|
1236 | |
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 | line?: AxisLineCfg | null;
|
1249 | |
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 | tickLine?: AxisTickLineCfg | null;
|
1264 | |
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 | subTickLine?: AxisSubTickLineCfg | null;
|
1279 | |
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 | title?: AxisTitleCfg | null;
|
1294 | |
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 | label?: AxisLabelCfg | null;
|
1320 |
|
1321 | grid?: AxisGridCfg | null;
|
1322 |
|
1323 | animate?: boolean;
|
1324 |
|
1325 | animateOption?: ComponentAnimateOption;
|
1326 |
|
1327 | verticalFactor?: number;
|
1328 | |
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 | verticalLimitLength?: number;
|
1336 | }
|
1337 | export interface SliderCfg {
|
1338 |
|
1339 | readonly height?: number;
|
1340 |
|
1341 | readonly trendCfg?: TrendCfg;
|
1342 |
|
1343 | readonly backgroundStyle?: any;
|
1344 |
|
1345 | readonly foregroundStyle?: any;
|
1346 |
|
1347 | readonly handlerStyle?: any;
|
1348 |
|
1349 | readonly textStyle?: any;
|
1350 |
|
1351 | readonly minLimit?: number;
|
1352 |
|
1353 | readonly maxLimit?: number;
|
1354 |
|
1355 | readonly start?: number;
|
1356 |
|
1357 | readonly end?: number;
|
1358 |
|
1359 | readonly padding?: number[];
|
1360 |
|
1361 | formatter?: (val: any, datum: Datum, idx: number) => any;
|
1362 | }
|
1363 | export declare type EventCallback = (event: LooseObject) => void;
|
1364 |
|
1365 |
|
1366 |
|
1367 |
|
1368 | export interface EventCfg {
|
1369 | [key: string]: EventCallback;
|
1370 | }
|
1371 |
|
1372 |
|
1373 |
|
1374 | export declare type SliderOption = SliderCfg | boolean;
|
1375 |
|
1376 | export interface ScrollbarCfg {
|
1377 |
|
1378 | type?: 'horizontal' | 'vertical';
|
1379 |
|
1380 | width?: number;
|
1381 |
|
1382 | height?: number;
|
1383 |
|
1384 | padding?: Padding;
|
1385 |
|
1386 | categorySize?: number;
|
1387 |
|
1388 | animate?: boolean;
|
1389 |
|
1390 | style?: {
|
1391 |
|
1392 | trackColor?: string;
|
1393 |
|
1394 | thumbColor?: string;
|
1395 |
|
1396 | thumbHighlightColor?: string;
|
1397 | lineCap?: string;
|
1398 | };
|
1399 | }
|
1400 |
|
1401 | export declare type ScrollbarOption = ScrollbarCfg | boolean;
|
1402 |
|
1403 | export interface Options {
|
1404 |
|
1405 | readonly data?: Data;
|
1406 |
|
1407 | readonly filters?: Record<string, FilterCondition>;
|
1408 |
|
1409 | readonly axes?: Record<string, AxisOption> | boolean;
|
1410 |
|
1411 | readonly legends?: AllLegendsOptions;
|
1412 |
|
1413 | readonly scales?: Record<string, ScaleOption>;
|
1414 |
|
1415 | readonly tooltip?: TooltipOption;
|
1416 |
|
1417 | readonly coordinate?: CoordinateOption;
|
1418 |
|
1419 | readonly annotations?: (ArcOption | RegionFilterOption | ImageOption | LineOption | TextOption | RegionOption | DataMarkerOption | DataRegionOption)[];
|
1420 |
|
1421 | readonly geometries?: GeometryOption[];
|
1422 |
|
1423 | readonly animate?: boolean;
|
1424 |
|
1425 | readonly interactions?: InteractionOption[];
|
1426 |
|
1427 | readonly events?: EventCfg;
|
1428 |
|
1429 | readonly slider?: SliderOption;
|
1430 |
|
1431 | readonly scrollbar?: ScrollbarOption;
|
1432 |
|
1433 | readonly views?: ViewOption[];
|
1434 |
|
1435 | readonly facets?: (RectCfg | MirrorCfg | CircleCfg | ListCfg | TreeCfg)[];
|
1436 |
|
1437 | readonly [name: string]: any;
|
1438 | }
|
1439 |
|
1440 | export declare type Marker = 'circle' | 'square' | 'diamond' | 'triangle' | 'triangle-down' | 'hexagon' | 'bowtie' | 'cross' | 'tick' | 'plus' | 'hyphen' | 'line';
|
1441 |
|
1442 | export declare type MarkerCallback = (x: number, y: number, r: number) => PathCommand;
|
1443 |
|
1444 | export declare type TooltipOption = TooltipCfg | boolean;
|
1445 | export declare type FilterCondition = (value: any, datum: Datum, idx?: number) => boolean;
|
1446 |
|
1447 | export declare type AxisOption = AxisCfg | boolean;
|
1448 |
|
1449 | export declare type LegendOption = LegendCfg | boolean;
|
1450 |
|
1451 | export declare type AllLegendsOptions = LegendCfg | Record<string, LegendOption> | boolean;
|
1452 |
|
1453 | export declare type ScaleType = 'linear' | 'cat' | 'category' | 'identity' | 'log' | 'pow' | 'time' | 'timeCat' | 'quantize' | 'quantile';
|
1454 | export declare type CoordinateRotate = ['rotate', number];
|
1455 | export declare type CoordinateReflect = ['reflect', 'x' | 'y'];
|
1456 | export declare type CoordinateScale = ['scale', number, number];
|
1457 | export declare type CoordinateTranspose = ['transpose'];
|
1458 |
|
1459 | export declare type CoordinateActions = CoordinateRotate | CoordinateReflect | CoordinateScale | CoordinateTranspose;
|
1460 | export declare type FacetCtor = new (view: View, cfg: any) => Facet;
|
1461 | export interface Condition {
|
1462 | readonly field: string;
|
1463 | readonly value: any;
|
1464 | readonly values: any[];
|
1465 | }
|
1466 | export declare type FacetDataFilter = (data: Datum[]) => boolean;
|
1467 |
|
1468 |
|
1469 |
|
1470 | export interface FacetCfg<D> {
|
1471 |
|
1472 | readonly type?: string;
|
1473 |
|
1474 | readonly eachView: (innerView: View, facet?: D) => any;
|
1475 |
|
1476 | readonly padding?: ViewPadding;
|
1477 |
|
1478 | readonly showTitle?: boolean;
|
1479 |
|
1480 | readonly fields: string[];
|
1481 | }
|
1482 |
|
1483 |
|
1484 |
|
1485 | export interface FacetTitle {
|
1486 |
|
1487 | readonly offsetX?: number;
|
1488 |
|
1489 | readonly offsetY?: number;
|
1490 |
|
1491 | readonly style?: object;
|
1492 | readonly formatter?: (val: any) => any;
|
1493 | }
|
1494 |
|
1495 |
|
1496 |
|
1497 | export interface FacetData {
|
1498 |
|
1499 | readonly type: string;
|
1500 |
|
1501 | readonly data: object[];
|
1502 |
|
1503 | readonly region: Region;
|
1504 |
|
1505 | readonly padding?: number;
|
1506 |
|
1507 | view?: View;
|
1508 |
|
1509 | readonly rowField: string;
|
1510 |
|
1511 | readonly columnField: string;
|
1512 |
|
1513 | readonly rowValue: string;
|
1514 |
|
1515 | readonly columnValue: string;
|
1516 |
|
1517 | readonly rowIndex: number;
|
1518 |
|
1519 | readonly columnIndex: number;
|
1520 |
|
1521 | readonly rowValuesLength: number;
|
1522 |
|
1523 | readonly columnValuesLength: number;
|
1524 | }
|
1525 |
|
1526 | export interface RectCfg extends FacetCfg<RectData> {
|
1527 |
|
1528 | readonly columnTitle?: FacetTitle;
|
1529 |
|
1530 | readonly rowTitle?: FacetTitle;
|
1531 | }
|
1532 | export interface RectData extends FacetData {
|
1533 | }
|
1534 |
|
1535 | export interface MirrorCfg extends FacetCfg<MirrorData> {
|
1536 |
|
1537 | readonly transpose?: boolean;
|
1538 |
|
1539 | readonly title?: FacetTitle;
|
1540 | }
|
1541 | export interface MirrorData extends FacetData {
|
1542 | }
|
1543 |
|
1544 | export interface ListCfg extends FacetCfg<ListData> {
|
1545 |
|
1546 | readonly cols?: number;
|
1547 |
|
1548 | readonly title?: FacetTitle;
|
1549 | }
|
1550 | export interface ListData extends FacetData {
|
1551 | readonly total: number;
|
1552 | }
|
1553 |
|
1554 | export interface MatrixCfg extends FacetCfg<MirrorData> {
|
1555 |
|
1556 | readonly columnTitle?: FacetTitle;
|
1557 |
|
1558 | readonly rowTitle?: FacetTitle;
|
1559 | }
|
1560 | export interface MatrixData extends FacetData {
|
1561 | }
|
1562 |
|
1563 | export interface CircleCfg extends FacetCfg<CircleData> {
|
1564 |
|
1565 | readonly title?: FacetTitle;
|
1566 | }
|
1567 | export interface CircleData extends FacetData {
|
1568 | }
|
1569 | export interface Line {
|
1570 | readonly style?: ShapeAttrs;
|
1571 | readonly smooth?: boolean;
|
1572 | }
|
1573 |
|
1574 | export interface TreeCfg extends FacetCfg<TreeData> {
|
1575 | readonly line?: Line;
|
1576 | readonly title?: FacetTitle;
|
1577 | }
|
1578 | export interface TreeData extends FacetData {
|
1579 | children?: TreeData[];
|
1580 | originColIndex?: number;
|
1581 | }
|
1582 |
|
1583 |
|
1584 |
|
1585 | export interface FacetCfgMap {
|
1586 |
|
1587 | readonly rect: RectCfg;
|
1588 |
|
1589 | readonly mirror: MirrorCfg;
|
1590 |
|
1591 | readonly list: ListCfg;
|
1592 |
|
1593 | readonly matrix: MatrixCfg;
|
1594 |
|
1595 | readonly circle: CircleCfg;
|
1596 |
|
1597 | readonly tree: TreeCfg;
|
1598 | }
|
1599 | export interface StyleSheet {
|
1600 |
|
1601 | backgroundColor?: string;
|
1602 |
|
1603 | brandColor?: string;
|
1604 |
|
1605 | subColor?: string;
|
1606 |
|
1607 | paletteQualitative10?: string[];
|
1608 |
|
1609 | paletteQualitative20?: string[];
|
1610 |
|
1611 | paletteSemanticRed?: string;
|
1612 |
|
1613 | paletteSemanticGreen?: string;
|
1614 |
|
1615 | paletteSemanticYellow?: string;
|
1616 |
|
1617 | paletteSequence?: string[];
|
1618 |
|
1619 | fontFamily?: string;
|
1620 |
|
1621 | axisLineBorderColor?: string;
|
1622 |
|
1623 | axisLineBorder?: number;
|
1624 |
|
1625 | axisLineDash?: number[];
|
1626 |
|
1627 | axisTitleTextFillColor?: string;
|
1628 |
|
1629 | axisTitleTextFontSize?: number;
|
1630 |
|
1631 | axisTitleTextLineHeight?: number;
|
1632 |
|
1633 | axisTitleTextFontWeight?: number | string;
|
1634 |
|
1635 | axisTitleSpacing?: number;
|
1636 |
|
1637 | axisTickLineBorderColor?: string;
|
1638 |
|
1639 | axisTickLineLength?: number;
|
1640 |
|
1641 | axisTickLineBorder?: number;
|
1642 |
|
1643 | axisSubTickLineBorderColor?: string;
|
1644 |
|
1645 | axisSubTickLineLength?: number;
|
1646 |
|
1647 | axisSubTickLineBorder?: number;
|
1648 |
|
1649 | axisLabelFillColor?: string;
|
1650 |
|
1651 | axisLabelFontSize?: number;
|
1652 |
|
1653 | axisLabelLineHeight?: number;
|
1654 |
|
1655 | axisLabelFontWeight?: number | string;
|
1656 |
|
1657 | axisLabelOffset: number;
|
1658 |
|
1659 | axisGridBorderColor?: string;
|
1660 |
|
1661 | axisGridBorder?: number;
|
1662 |
|
1663 | axisGridLineDash?: number[];
|
1664 |
|
1665 | legendTitleTextFillColor?: string;
|
1666 |
|
1667 | legendTitleTextFontSize?: number;
|
1668 |
|
1669 | legendTitleTextLineHeight?: number;
|
1670 |
|
1671 | legendTitleTextFontWeight?: number | string;
|
1672 |
|
1673 | legendMarkerColor?: string;
|
1674 |
|
1675 | legendMarkerSpacing?: number;
|
1676 |
|
1677 | legendMarkerSize?: number;
|
1678 |
|
1679 | legendCircleMarkerSize?: number;
|
1680 |
|
1681 | legendSquareMarkerSize?: number;
|
1682 |
|
1683 | legendLineMarkerSize?: number;
|
1684 |
|
1685 | legendItemNameFillColor?: string;
|
1686 |
|
1687 | legendItemNameFontSize?: number;
|
1688 |
|
1689 | legendItemNameLineHeight?: number;
|
1690 |
|
1691 | legendItemNameFontWeight?: number | string;
|
1692 |
|
1693 | legendItemSpacing?: number;
|
1694 |
|
1695 | legendItemMarginBottom?: number;
|
1696 |
|
1697 | legendPadding?: number[];
|
1698 |
|
1699 | legendHorizontalPadding?: number[];
|
1700 |
|
1701 | legendVerticalPadding?: number[];
|
1702 |
|
1703 | legendPageNavigatorMarkerSize: number;
|
1704 |
|
1705 | legendPageNavigatorMarkerInactiveFillColor: string;
|
1706 |
|
1707 | legendPageNavigatorMarkerInactiveFillOpacity: number;
|
1708 |
|
1709 | legendPageNavigatorMarkerFillColor: string;
|
1710 |
|
1711 | legendPageNavigatorMarkerFillOpacity: number;
|
1712 |
|
1713 | legendPageNavigatorTextFillColor: string;
|
1714 |
|
1715 | legendPageNavigatorTextFontSize: number;
|
1716 |
|
1717 | sliderRailFillColor?: string;
|
1718 |
|
1719 | sliderRailBorder?: number;
|
1720 |
|
1721 | sliderRailBorderColor?: string;
|
1722 |
|
1723 | sliderRailWidth?: number;
|
1724 |
|
1725 | sliderRailHeight?: number;
|
1726 |
|
1727 | sliderLabelTextFillColor?: string;
|
1728 |
|
1729 | sliderLabelTextFontSize?: number;
|
1730 |
|
1731 | sliderLabelTextLineHeight?: number;
|
1732 |
|
1733 | sliderLabelTextFontWeight?: number | string;
|
1734 |
|
1735 | sliderHandlerFillColor?: string;
|
1736 |
|
1737 | sliderHandlerWidth?: number;
|
1738 |
|
1739 | sliderHandlerHeight?: number;
|
1740 |
|
1741 | sliderHandlerBorder?: number;
|
1742 |
|
1743 | sliderHandlerBorderColor?: string;
|
1744 |
|
1745 | annotationArcBorderColor?: string;
|
1746 |
|
1747 | annotationArcBorder?: number;
|
1748 |
|
1749 | annotationLineBorderColor?: string;
|
1750 |
|
1751 | annotationLineBorder?: number;
|
1752 |
|
1753 | annotationLineDash?: number[];
|
1754 |
|
1755 | annotationTextFillColor?: string;
|
1756 |
|
1757 | annotationTextFontSize?: number;
|
1758 |
|
1759 | annotationTextLineHeight?: number;
|
1760 |
|
1761 | annotationTextFontWeight?: number | string;
|
1762 |
|
1763 | annotationTextBorderColor?: string;
|
1764 |
|
1765 | annotationTextBorder?: number;
|
1766 |
|
1767 | annotationRegionFillColor?: string;
|
1768 |
|
1769 | annotationRegionFillOpacity?: number;
|
1770 |
|
1771 | annotationRegionBorder?: number;
|
1772 |
|
1773 | annotationRegionBorderColor?: string;
|
1774 |
|
1775 | annotationDataMarkerLineLength?: number;
|
1776 |
|
1777 | tooltipCrosshairsBorderColor?: string;
|
1778 |
|
1779 | tooltipCrosshairsBorder?: number;
|
1780 |
|
1781 | tooltipCrosshairsLineDash?: number[];
|
1782 |
|
1783 | tooltipContainerFillColor?: string;
|
1784 |
|
1785 | tooltipContainerFillOpacity?: number;
|
1786 |
|
1787 | tooltipContainerShadow?: string;
|
1788 |
|
1789 | tooltipContainerBorderRadius?: number;
|
1790 |
|
1791 | tooltipTextFillColor?: string;
|
1792 |
|
1793 | tooltipTextFontSize?: number;
|
1794 |
|
1795 | tooltipTextLineHeight?: number;
|
1796 |
|
1797 | tooltipTextFontWeight?: number | string;
|
1798 |
|
1799 | labelFillColor?: string;
|
1800 |
|
1801 | labelFillColorDark?: string;
|
1802 |
|
1803 | labelFillColorLight?: string;
|
1804 |
|
1805 | labelFontSize?: number;
|
1806 |
|
1807 | labelLineHeight?: number;
|
1808 |
|
1809 | labelFontWeight?: number | string;
|
1810 |
|
1811 | labelBorderColor?: string;
|
1812 |
|
1813 | labelBorder?: number;
|
1814 |
|
1815 | innerLabelFillColor?: string;
|
1816 |
|
1817 | innerLabelFontSize?: number;
|
1818 |
|
1819 | innerLabelLineHeight?: number;
|
1820 |
|
1821 | innerLabelFontWeight?: number | string;
|
1822 |
|
1823 | innerLabelBorderColor?: string;
|
1824 |
|
1825 | innerLabelBorder?: number;
|
1826 |
|
1827 | overflowLabelFillColor?: string;
|
1828 |
|
1829 | overflowLabelFillColorDark?: string;
|
1830 |
|
1831 | overflowLabelFillColorLight?: string;
|
1832 |
|
1833 | overflowLabelFontSize?: number;
|
1834 |
|
1835 | overflowLabelLineHeight?: number;
|
1836 |
|
1837 | overflowLabelFontWeight?: number | string;
|
1838 |
|
1839 | overflowLabelBorderColor?: string;
|
1840 |
|
1841 | overflowLabelBorder?: number;
|
1842 |
|
1843 | labelLineBorder?: number;
|
1844 |
|
1845 | labelLineBorderColor?: string;
|
1846 |
|
1847 | cSliderRailHieght?: number;
|
1848 |
|
1849 | cSliderBackgroundFillColor?: string;
|
1850 |
|
1851 | cSliderBackgroundFillOpacity?: number;
|
1852 |
|
1853 | cSliderForegroundFillColor?: string;
|
1854 |
|
1855 | cSliderForegroundFillOpacity?: number;
|
1856 |
|
1857 | cSliderHandlerHeight?: number;
|
1858 |
|
1859 | cSliderHandlerWidth?: number;
|
1860 |
|
1861 | cSliderHandlerFillColor?: string;
|
1862 |
|
1863 | cSliderHandlerFillOpacity?: number;
|
1864 |
|
1865 | cSliderHandlerHighlightFillColor?: string;
|
1866 |
|
1867 | cSliderHandlerBorderColor?: string;
|
1868 |
|
1869 | cSliderHandlerBorder?: number;
|
1870 |
|
1871 | cSliderHandlerBorderRadius?: number;
|
1872 |
|
1873 | cSliderTextFillColor?: string;
|
1874 |
|
1875 | cSliderTextFillOpacity?: number;
|
1876 |
|
1877 | cSliderTextFontSize?: number;
|
1878 |
|
1879 | cSliderTextLineHeight?: number;
|
1880 |
|
1881 | cSliderTextFontWeight?: number | string;
|
1882 |
|
1883 | cSliderTextBorderColor?: string;
|
1884 |
|
1885 | cSliderTextBorder?: number;
|
1886 |
|
1887 | scrollbarTrackFillColor?: string;
|
1888 |
|
1889 | scrollbarThumbFillColor?: string;
|
1890 |
|
1891 | scrollbarThumbHighlightFillColor?: string;
|
1892 |
|
1893 | pointSizeRange?: [number, number];
|
1894 |
|
1895 | pointFillColor?: string;
|
1896 |
|
1897 | pointFillOpacity?: number;
|
1898 |
|
1899 | pointSize?: number;
|
1900 |
|
1901 | pointBorder?: number;
|
1902 |
|
1903 | pointBorderColor?: string;
|
1904 |
|
1905 | pointBorderOpacity?: number;
|
1906 |
|
1907 | pointActiveFillColor?: string;
|
1908 |
|
1909 | pointActiveFillOpacity?: number;
|
1910 |
|
1911 | pointActiveSize?: number;
|
1912 |
|
1913 | pointActiveBorder?: number;
|
1914 |
|
1915 | pointActiveBorderColor?: string;
|
1916 |
|
1917 | pointActiveBorderOpacity?: number;
|
1918 |
|
1919 | pointSelectedFillColor?: string;
|
1920 |
|
1921 | pointSelectedFillOpacity?: number;
|
1922 |
|
1923 | pointSelectedSize?: number;
|
1924 |
|
1925 | pointSelectedBorder?: number;
|
1926 |
|
1927 | pointSelectedBorderColor?: string;
|
1928 |
|
1929 | pointSelectedBorderOpacity?: number;
|
1930 |
|
1931 | pointInactiveFillColor?: string;
|
1932 |
|
1933 | pointInactiveFillOpacity?: number;
|
1934 |
|
1935 | pointInactiveSize?: number;
|
1936 |
|
1937 | pointInactiveBorder?: number;
|
1938 |
|
1939 | pointInactiveBorderColor?: string;
|
1940 |
|
1941 | pointInactiveBorderOpacity?: number;
|
1942 |
|
1943 | hollowPointSize?: number;
|
1944 |
|
1945 | hollowPointBorder?: number;
|
1946 |
|
1947 | hollowPointBorderColor?: string;
|
1948 |
|
1949 | hollowPointBorderOpacity?: number;
|
1950 |
|
1951 | hollowPointFillColor?: string;
|
1952 |
|
1953 | hollowPointFillOpacity?: number;
|
1954 |
|
1955 | hollowPointActiveSize?: number;
|
1956 |
|
1957 | hollowPointActiveBorder?: number;
|
1958 |
|
1959 | hollowPointActiveBorderColor?: string;
|
1960 |
|
1961 | hollowPointActiveBorderOpacity?: number;
|
1962 |
|
1963 | hollowPointSelectedSize?: number;
|
1964 |
|
1965 | hollowPointSelectedBorder?: number;
|
1966 |
|
1967 | hollowPointSelectedBorderColor?: string;
|
1968 |
|
1969 | hollowPointSelectedBorderOpacity?: number;
|
1970 |
|
1971 | hollowPointInactiveSize?: number;
|
1972 |
|
1973 | hollowPointInactiveBorder?: number;
|
1974 |
|
1975 | hollowPointInactiveBorderColor?: string;
|
1976 |
|
1977 | hollowPointInactiveBorderOpacity?: number;
|
1978 |
|
1979 | lineBorder?: number;
|
1980 |
|
1981 | lineBorderColor?: string;
|
1982 |
|
1983 | lineBorderOpacity?: number;
|
1984 |
|
1985 | lineActiveBorder?: number;
|
1986 |
|
1987 | lineActiveBorderColor?: string;
|
1988 |
|
1989 | lineActiveBorderOpacity?: number;
|
1990 |
|
1991 | lineSelectedBorder?: number;
|
1992 |
|
1993 | lineSelectedBorderColor?: string;
|
1994 |
|
1995 | lineSelectedBorderOpacity?: number;
|
1996 |
|
1997 | lineInactiveBorder?: number;
|
1998 |
|
1999 | lineInactiveBorderColor?: string;
|
2000 |
|
2001 | lineInactiveBorderOpacity?: number;
|
2002 | areaBorder?: number;
|
2003 |
|
2004 | areaBorderColor?: string;
|
2005 |
|
2006 | areaBorderOpacity?: number;
|
2007 |
|
2008 | areaFillColor?: string;
|
2009 |
|
2010 | areaFillOpacity?: number;
|
2011 |
|
2012 | areaActiveBorder?: number;
|
2013 |
|
2014 | areaActiveBorderColor?: string;
|
2015 |
|
2016 | areaActiveBorderOpacity?: number;
|
2017 |
|
2018 | areaActiveFillColor?: string;
|
2019 |
|
2020 | areaActiveFillOpacity?: number;
|
2021 |
|
2022 | areaSelectedBorder?: number;
|
2023 |
|
2024 | areaSelectedBorderColor?: string;
|
2025 |
|
2026 | areaSelectedBorderOpacity?: number;
|
2027 |
|
2028 | areaSelectedFillColor?: string;
|
2029 |
|
2030 | areaSelectedFillOpacity?: number;
|
2031 |
|
2032 | areaInactiveBorder?: number;
|
2033 |
|
2034 | areaInactiveBorderColor?: string;
|
2035 |
|
2036 | areaInactiveBorderOpacity?: number;
|
2037 |
|
2038 | areaInactiveFillColor?: string;
|
2039 |
|
2040 | areaInactiveFillOpacity?: number;
|
2041 |
|
2042 | hollowAreaBorder?: number;
|
2043 |
|
2044 | hollowAreaBorderColor?: string;
|
2045 |
|
2046 | hollowAreaBorderOpacity?: number;
|
2047 |
|
2048 | hollowAreaActiveBorder?: number;
|
2049 |
|
2050 | hollowAreaActiveBorderColor?: string;
|
2051 |
|
2052 | hollowAreaActiveBorderOpacity?: number;
|
2053 |
|
2054 | hollowAreaSelectedBorder?: number;
|
2055 |
|
2056 | hollowAreaSelectedBorderColor?: string;
|
2057 |
|
2058 | hollowAreaSelectedBorderOpacity?: number;
|
2059 |
|
2060 | hollowAreaInactiveBorder?: number;
|
2061 |
|
2062 | hollowAreaInactiveBorderColor?: string;
|
2063 |
|
2064 | hollowAreaInactiveBorderOpacity?: number;
|
2065 |
|
2066 | intervalBorder?: number;
|
2067 |
|
2068 | intervalBorderColor?: string;
|
2069 |
|
2070 | intervalBorderOpacity?: number;
|
2071 |
|
2072 | intervalFillColor?: string;
|
2073 |
|
2074 | intervalFillOpacity?: number;
|
2075 |
|
2076 | intervalActiveBorder?: number;
|
2077 |
|
2078 | intervalActiveBorderColor?: string;
|
2079 |
|
2080 | intervalActiveBorderOpacity?: number;
|
2081 |
|
2082 | intervalActiveFillColor?: string;
|
2083 |
|
2084 | intervalActiveFillOpacity?: number;
|
2085 |
|
2086 | intervalSelectedBorder?: number;
|
2087 |
|
2088 | intervalSelectedBorderColor?: string;
|
2089 |
|
2090 | intervalSelectedBorderOpacity?: number;
|
2091 |
|
2092 | intervalSelectedFillColor?: string;
|
2093 |
|
2094 | intervalSelectedFillOpacity?: number;
|
2095 |
|
2096 | intervalInactiveBorder?: number;
|
2097 |
|
2098 | intervalInactiveBorderColor?: string;
|
2099 |
|
2100 | intervalInactiveBorderOpacity?: number;
|
2101 |
|
2102 | intervalInactiveFillColor?: string;
|
2103 |
|
2104 | intervalInactiveFillOpacity?: number;
|
2105 |
|
2106 | hollowIntervalBorder?: number;
|
2107 |
|
2108 | hollowIntervalBorderColor?: string;
|
2109 |
|
2110 | hollowIntervalBorderOpacity?: number;
|
2111 |
|
2112 | hollowIntervalFillColor?: string;
|
2113 |
|
2114 | hollowIntervalFillOpacity?: number;
|
2115 |
|
2116 | hollowIntervalActiveBorder?: number;
|
2117 |
|
2118 | hollowIntervalActiveBorderColor?: string;
|
2119 |
|
2120 | hollowIntervalActiveBorderOpacity?: number;
|
2121 |
|
2122 | hollowIntervalSelectedBorder?: number;
|
2123 |
|
2124 | hollowIntervalSelectedBorderColor?: string;
|
2125 |
|
2126 | hollowIntervalSelectedBorderOpacity?: number;
|
2127 |
|
2128 | hollowIntervalInactiveBorder?: number;
|
2129 |
|
2130 | hollowIntervalInactiveBorderColor?: string;
|
2131 |
|
2132 | hollowIntervalInactiveBorderOpacity?: number;
|
2133 | }
|
2134 |
|
2135 | export declare type StyleSheetCfg = Pick<StyleSheet, 'backgroundColor' | 'subColor' | 'brandColor' | 'paletteQualitative10' | 'paletteQualitative20' | 'paletteSemanticRed' | 'paletteSemanticGreen' | 'paletteSemanticYellow' | 'paletteSequence' | 'fontFamily'>;
|
2136 |
|
2137 | export interface IAction {
|
2138 | |
2139 |
|
2140 |
|
2141 | init(): any;
|
2142 | |
2143 |
|
2144 |
|
2145 | name: string;
|
2146 | |
2147 |
|
2148 |
|
2149 | context: IInteractionContext;
|
2150 | |
2151 |
|
2152 |
|
2153 | destroy(): any;
|
2154 | }
|
2155 |
|
2156 | export interface IInteractionContext extends LooseObject {
|
2157 |
|
2158 | event: LooseObject;
|
2159 | |
2160 |
|
2161 |
|
2162 | view: View;
|
2163 |
|
2164 | actions: IAction[];
|
2165 | |
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 | cache(key: string, value?: any): any;
|
2171 | |
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 | getAction(name: any): IAction;
|
2177 | |
2178 |
|
2179 |
|
2180 |
|
2181 | getCurrentPoint(): Point;
|
2182 | |
2183 |
|
2184 |
|
2185 | getCurrentShape(): IShape;
|
2186 | |
2187 |
|
2188 |
|
2189 |
|
2190 | addAction(action: IAction): any;
|
2191 | |
2192 |
|
2193 |
|
2194 |
|
2195 | removeAction(action: IAction): any;
|
2196 | |
2197 |
|
2198 |
|
2199 | isInPlot(): any;
|
2200 | |
2201 |
|
2202 |
|
2203 |
|
2204 | isInComponent(name?: string): any;
|
2205 | |
2206 |
|
2207 |
|
2208 |
|
2209 | isInShape(name: any): any;
|
2210 | |
2211 |
|
2212 |
|
2213 | destroy(): any;
|
2214 | }
|
2215 |
|
2216 | export declare type Renderer = 'svg' | 'canvas';
|
2217 |
|
2218 | export declare type Datum = Record<string, any>;
|
2219 | export declare type Data = Datum[];
|
2220 | export declare type ActionCallback = (context: IInteractionContext) => void;
|
2221 | export declare type Padding = [number, number, number, number];
|
2222 | export declare type ViewPadding = number | number[] | 'auto';
|
2223 | export declare type ViewAppendPadding = number | number[];
|
2224 | export declare type Position = [number, number];
|
2225 | export declare type AttributeType = 'position' | 'size' | 'color' | 'shape';
|
2226 | export declare type ShapeVertices = RangePoint[] | Point[] | Point[][];
|
2227 |
|
2228 | export declare type AnimateEasingCallback = (data: Datum) => string;
|
2229 |
|
2230 | export declare type AnimateDelayCallback = (data: Datum) => number;
|
2231 |
|
2232 | export declare type AnimateDurationCallback = (data: Datum) => number;
|
2233 |
|
\ | No newline at end of file |