1 | import { COMPONENT_TYPE, DIRECTION, LAYER } from './constant';
|
2 | import { AxisLabelCfg, AxisLineCfg, AxisSubTickLineCfg, AxisTickLineCfg, AxisTitleCfg, ContinueLegendHandlerCfg, ContinueLegendLabelCfg, ContinueLegendRailCfg, ContinueLegendTrackCfg, Coordinate, CrosshairLineCfg, CrosshairTextBackgroundCfg, CrosshairTextCfg, EnhancedTextCfg, GridLineCfg, GroupComponent, HtmlComponent, ICanvas, IGroup, IShape, CategoryLegendCfg, LegendBackgroundCfg, LegendItemNameCfg, LegendItemValueCfg, LegendMarkerCfg, LegendTitleCfg, LegendPageNavigatorCfg, PathCommand, Scale, ScaleConfig, ShapeAttrs, LineAnnotationTextCfg, TrendCfg } from './dependents';
|
3 | import { View } from './chart';
|
4 | import { Facet } from './facet';
|
5 | import Element from './geometry/element';
|
6 | import { PaddingCalCtor } from './chart/layout/padding-cal';
|
7 | import { LegendRadio } from '@antv/component';
|
8 | /**
|
9 | * @title 通用对象
|
10 | */
|
11 | export interface LooseObject {
|
12 | [key: string]: any;
|
13 | }
|
14 | /**
|
15 | * @title 一个点位置
|
16 | */
|
17 | export interface Point {
|
18 | readonly x: number;
|
19 | readonly y: number;
|
20 | }
|
21 | /**
|
22 | * @title 画布范围
|
23 | */
|
24 | export interface Region {
|
25 | readonly start: Point;
|
26 | readonly end: Point;
|
27 | }
|
28 | /**
|
29 | * @title 画布大小
|
30 | */
|
31 | export interface Size {
|
32 | readonly width: number;
|
33 | readonly height: number;
|
34 | }
|
35 | /**
|
36 | * @title 带范围的点结构
|
37 | */
|
38 | export interface RangePoint {
|
39 | readonly x?: number | number[];
|
40 | readonly y?: number | number[];
|
41 | }
|
42 | /**
|
43 | * WAI-ARIA 无障碍标签配置
|
44 | */
|
45 | export declare type AriaOption = false | {
|
46 | readonly label: string;
|
47 | };
|
48 | /**
|
49 | * @title 用户数据经过图形映射处理后的数据结构
|
50 | */
|
51 | export interface MappingDatum {
|
52 | /**
|
53 | * @title 原始数据
|
54 | */
|
55 | _origin: Datum;
|
56 | /**
|
57 | * @title shape 的关键点信息
|
58 | */
|
59 | points?: ShapeVertices;
|
60 | /**
|
61 | * @title 相对于当前 shape 的下一个 shape 的关键点信息
|
62 | */
|
63 | nextPoints?: ShapeVertices;
|
64 | /**
|
65 | * @title x 轴的坐标
|
66 | */
|
67 | x?: number[] | number;
|
68 | /**
|
69 | * @title y 轴的坐标
|
70 | */
|
71 | y?: number[] | number;
|
72 | /**
|
73 | * @title 颜色
|
74 | */
|
75 | color?: string;
|
76 | /**
|
77 | * @title 渲染的 shape 类型
|
78 | */
|
79 | shape?: string | string[];
|
80 | /**
|
81 | * @title 大小
|
82 | */
|
83 | size?: number;
|
84 | }
|
85 | /**
|
86 | * @title 绘制 Shape 需要的图形、样式、关键点等信息
|
87 | */
|
88 | export interface ShapeInfo {
|
89 | /**
|
90 | * @title x 坐标
|
91 | */
|
92 | x: number | number[];
|
93 | /**
|
94 | * @title y 坐标
|
95 | */
|
96 | y: number | number[];
|
97 | /**
|
98 | * @title 映射的 shape 类型
|
99 | */
|
100 | shape?: string | string[];
|
101 | /**
|
102 | * @title size 映射值
|
103 | */
|
104 | size?: number;
|
105 | /**
|
106 | * @title 映射的颜色值
|
107 | */
|
108 | color?: string;
|
109 | /**
|
110 | * @title 用户设置的图形样式
|
111 | */
|
112 | style?: LooseObject;
|
113 | /**
|
114 | * @title 是否在极坐标下
|
115 | */
|
116 | isInCircle?: boolean;
|
117 | /**
|
118 | * @title 对应的原始数据记录
|
119 | */
|
120 | data?: Datum | Data;
|
121 | /**
|
122 | * @title 存储进行图形映射后的数据
|
123 | */
|
124 | mappingData?: MappingDatum | MappingDatum[];
|
125 | /**
|
126 | * @title 构成 shape 的关键点
|
127 | */
|
128 | points?: ShapeVertices;
|
129 | /**
|
130 | * @title 下一个数据集对应的关键点
|
131 | */
|
132 | nextPoints?: ShapeVertices;
|
133 | /**
|
134 | * @title Geometry.Text 需要
|
135 | */
|
136 | text?: string;
|
137 | /**
|
138 | * @title 数据是否发生层叠
|
139 | */
|
140 | isStack?: boolean;
|
141 | /**
|
142 | * @title 是否连接空值,只对 Path Line Area 这三种 Geometry 生效。
|
143 | */
|
144 | connectNulls?: boolean;
|
145 | /**
|
146 | * @title shape 背景,只对 Interval Geometry 生效,目前只对 interval-rect shape 生效。
|
147 | */
|
148 | background?: {
|
149 | style?: ShapeAttrs;
|
150 | };
|
151 | /**
|
152 | * @title 是否展示单个孤立的数据点,只对 Path Line Area 这三种 Geometry 生效。
|
153 | */
|
154 | showSinglePoint?: boolean;
|
155 | /**
|
156 | * @title 默认的 shape 样式
|
157 | */
|
158 | defaultStyle?: LooseObject;
|
159 | /**
|
160 | * @title 自定义的数据,传入到 shapeInfo 中
|
161 | */
|
162 | customInfo?: CustomOption;
|
163 | }
|
164 | /**
|
165 | * @title 用户配置的动画,属性均可选
|
166 | */
|
167 | export interface AnimateCfg {
|
168 | /**
|
169 | * @title 动画缓动函数
|
170 | */
|
171 | readonly easing?: string | AnimateEasingCallback;
|
172 | /**
|
173 | * @title 动画执行函数
|
174 | */
|
175 | readonly animation?: string;
|
176 | /**
|
177 | * @title 动画执行时间
|
178 | */
|
179 | readonly duration?: number | AnimateDurationCallback;
|
180 | /**
|
181 | * @title 动画延迟时间
|
182 | */
|
183 | readonly delay?: number | AnimateDelayCallback;
|
184 | /**
|
185 | * @title 动画执行结束后的回调函数
|
186 | */
|
187 | readonly callback?: () => any;
|
188 | /**
|
189 | * @title 动画是否重复
|
190 | */
|
191 | readonly repeat?: boolean;
|
192 | }
|
193 | /**
|
194 | * @title 传递给 G 的动画配置,duration 必须提供
|
195 | */
|
196 | export interface GAnimateCfg {
|
197 | /**
|
198 | * @title 动画执行时间
|
199 | */
|
200 | readonly duration: number;
|
201 | /**
|
202 | * @title 动画缓动函数
|
203 | */
|
204 | readonly easing?: string;
|
205 | /**
|
206 | * @title 动画执行函数
|
207 | */
|
208 | readonly animation?: string;
|
209 | /**
|
210 | * @title 动画延迟时间
|
211 | */
|
212 | readonly delay?: number;
|
213 | /**
|
214 | * @title 动画执行结束后的回调函数
|
215 | */
|
216 | readonly callback?: () => any;
|
217 | /**
|
218 | * @title 动画是否重复
|
219 | */
|
220 | readonly repeat?: boolean;
|
221 | }
|
222 | /**
|
223 | * @title 图形属性配置项定义,如 geometry.position({})
|
224 | */
|
225 | export interface AttributeOption {
|
226 | /**
|
227 | * @title 映射的属性字段。
|
228 | */
|
229 | fields?: string[];
|
230 | /**
|
231 | * @title 回调函数。
|
232 | */
|
233 | callback?: (...args: any[]) => any;
|
234 | /**
|
235 | * @title 指定常量映射规则。
|
236 | */
|
237 | values?: any[];
|
238 | }
|
239 | /**
|
240 | * @title 数据调整配置项定义,`geometry.adjust({})`
|
241 | */
|
242 | export interface AdjustOption {
|
243 | /**
|
244 | * @title 数据调整类型。
|
245 | */
|
246 | readonly type: AdjustType;
|
247 | /**
|
248 | * @title 间距
|
249 | * @description 该属性只对 'dodge' 类型生效,取 0 到 1 范围的值(相对于每个柱子宽度),用于控制一个分组中柱子之间的间距。
|
250 | * @see ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*ps3pToOg2nwAAAAAAAAAAABkARQnAQ)
|
251 | */
|
252 | readonly marginRatio?: number;
|
253 | /**
|
254 | * @title 分组字段
|
255 | * @description 该属性只对 'dodge' 类型生效,声明以哪个数据字段为分组依据。
|
256 | */
|
257 | readonly dodgeBy?: string;
|
258 | /**
|
259 | * @title 是否反序
|
260 | * @description 该属性只对 'stack' 类型生效,用于控制是否对数据进行反序操作。
|
261 | */
|
262 | readonly reverseOrder?: boolean;
|
263 | }
|
264 | /**
|
265 | * @title `geometry.style({})` 样式配置定义
|
266 | */
|
267 | export interface StyleOption {
|
268 | /**
|
269 | * @title 映射的字段。
|
270 | */
|
271 | readonly fields?: string[];
|
272 | /**
|
273 | * @title 回调函数。
|
274 | */
|
275 | readonly callback?: (...args: any[]) => LooseObject;
|
276 | /**
|
277 | * @title 图形样式配置。
|
278 | */
|
279 | readonly cfg?: LooseObject;
|
280 | }
|
281 | /**
|
282 | * @title geometry.custom() custom 自定义的配置,可以传入任何数据
|
283 | */
|
284 | export declare type CustomOption = any;
|
285 | /**
|
286 | * @title `geometry.tooltip({})` Tooltip 配置定义
|
287 | */
|
288 | export interface GeometryTooltipOption {
|
289 | /**
|
290 | * @title 参与映射的字段。
|
291 | */
|
292 | readonly fields: string[];
|
293 | /**
|
294 | * @title 回调函数。
|
295 | */
|
296 | readonly callback?: (...args: any[]) => LooseObject;
|
297 | }
|
298 | export interface GeometryLabelLayoutCfg {
|
299 | /**
|
300 | * @title label 布局类型。
|
301 | */
|
302 | type: string;
|
303 | /**
|
304 | * @title 各个布局函数开放给用户的配置。
|
305 | */
|
306 | cfg?: LooseObject;
|
307 | }
|
308 | /**
|
309 | * @title geometry.label({}) 配置属性
|
310 | */
|
311 | export interface GeometryLabelCfg {
|
312 | /**
|
313 | * @title 类型
|
314 | * @description 用于声明渲染的 label 类型。当用户使用了自定义的 label 类型,需要声明具体的 type 类型,否则会使用默认的 label 类型渲染。
|
315 | */
|
316 | type?: string;
|
317 | /**
|
318 | * @title 相对数据点的偏移距离, polar 和 theta 坐标系下可使用百分比字符串。
|
319 | */
|
320 | offset?: number | string;
|
321 | /**
|
322 | * @title label 相对于数据点在 X 方向的偏移距离。
|
323 | */
|
324 | offsetX?: number;
|
325 | /**
|
326 | * @title label 相对于数据点在 Y 方向的偏移距离。
|
327 | */
|
328 | offsetY?: number;
|
329 | /**
|
330 | * @title 文本内容
|
331 | * @description 展示的文本内容,如果不声明则按照参与映射的第一字段的值进行显示。当 content 为 IGroup 或者 IShape 类型时,请使用相对定位,即 x 和 y 坐标都设为 0,G2 内部会整体做最后的 label 进行定位的。
|
332 | * @link 示例: https://g2.antv.vision/zh/examples/pie/basic#pie-custome-label
|
333 | */
|
334 | content?: string | IGroup | IShape | GeometryLabelContentCallback;
|
335 | /**
|
336 | * @title 文本样式
|
337 | * @description label 文本图形属性样式。
|
338 | */
|
339 | style?: LooseObject;
|
340 | /**
|
341 | * @title 是否自动旋转
|
342 | * @description label 是否自动旋转
|
343 | * @default true
|
344 | */
|
345 | autoRotate?: boolean;
|
346 | /**
|
347 | * @title 旋转
|
348 | * @description 当且仅当 `autoRotate` 为 false 时生效,用于设置文本的旋转角度,**弧度制**。
|
349 | */
|
350 | rotate?: number;
|
351 | /**
|
352 | * @title 标签高度
|
353 | * @description 标签高度设置,仅当标签类型 type 为 pie 时生效;也可在主题中设置 pieLabels.labelHeight
|
354 | */
|
355 | labelHeight?: number;
|
356 | /**
|
357 | * @title 文本连接线
|
358 | * @description 用于设置文本连接线的样式属性,null 表示不展示。
|
359 | */
|
360 | labelLine?: null | boolean | {
|
361 | style?: object;
|
362 | };
|
363 | /**
|
364 | * @title 文本放射状
|
365 | * @description 只对极坐标下的文本生效,表示文本是否按照角度进行放射状显示,true 表示开启,false 表示关闭。
|
366 | */
|
367 | labelEmit?: boolean;
|
368 | /**
|
369 | * @title 文本布局
|
370 | * 文本布局类型,支持多种布局函数组合使用。
|
371 | *
|
372 | * 目前提供了三种:'overlap','fixedOverlap','limitInShape':
|
373 | * 1. overlap: label 防遮挡,为了防止 label 之间相互覆盖,通过尝试向**四周偏移**来剔除放不下的 label。
|
374 | * 2. fixed-overlap: 不改变 label 位置的情况下对相互重叠的 label 进行调整。
|
375 | * 3. limit-in-shape: 剔除 shape 容纳不了的 label。
|
376 | *
|
377 | * @example
|
378 | * ```ts
|
379 | * layout: {
|
380 | * type: 'overlap',
|
381 | * },
|
382 | * ```
|
383 | */
|
384 | layout?: GeometryLabelLayoutCfg | GeometryLabelLayoutCfg[];
|
385 | /**
|
386 | * @title 背景
|
387 | * @description 用于绘制 label 背景
|
388 | */
|
389 | background?: {
|
390 | /**
|
391 | * @title 背景框图形属性配置
|
392 | * - fill?: string; 背景框 填充色
|
393 | * - stroke?: string; 背景框 描边色
|
394 | * - lineWidth?: string; 背景框 描边宽度
|
395 | * - radius?: number | number[]; 背景框圆角,支持整数或数组形式
|
396 | */
|
397 | style?: ShapeAttrs;
|
398 | /**
|
399 | * @title 背景框 内边距
|
400 | */
|
401 | padding?: number | number[];
|
402 | };
|
403 | /**
|
404 | * @title 位置
|
405 | * @description 仅当 geometry 为 interval 时生效,指定当前 label 与当前图形的相对位置。
|
406 | */
|
407 | position?: ((data: Datum, mappingData: MappingDatum, index: number) => IntervalGeometryLabelPosition) | IntervalGeometryLabelPosition;
|
408 | /**
|
409 | * @title 动画配置。
|
410 | */
|
411 | animate?: AnimateOption | false | null;
|
412 | }
|
413 | /**
|
414 | * @title `geometry().label({})` 配置定义
|
415 | */
|
416 | export interface LabelOption {
|
417 | /**
|
418 | * @title 映射的字段。
|
419 | */
|
420 | fields?: string[];
|
421 | /**
|
422 | * @title 回调函数。
|
423 | */
|
424 | callback?: LabelCallback;
|
425 | cfg?: GeometryLabelCfg;
|
426 | }
|
427 | /**
|
428 | * @title Geometry 下每个 state 的配置结构
|
429 | */
|
430 | export interface StateCfg {
|
431 | /**
|
432 | * @title 状态样式配置。
|
433 | */
|
434 | style?: object | StateStyleCallback;
|
435 | }
|
436 | /**
|
437 | * @title geometry.state({}) 配置定义
|
438 | */
|
439 | export interface StateOption {
|
440 | /**
|
441 | * @title 默认状态样式。
|
442 | */
|
443 | default?: StateCfg;
|
444 | /**
|
445 | * @title active 状态配置。
|
446 | */
|
447 | active?: StateCfg;
|
448 | /**
|
449 | * @title inactive 状态配置。
|
450 | */
|
451 | inactive?: StateCfg;
|
452 | /**
|
453 | * @title selected 状态配置。
|
454 | */
|
455 | selected?: StateCfg;
|
456 | }
|
457 | /**
|
458 | * @title interval label 的位置
|
459 | */
|
460 | export declare type IntervalGeometryLabelPosition = 'top' | 'bottom' | 'middle' | 'left' | 'right';
|
461 | /**
|
462 | * @title G2 提供的 adjust 类型
|
463 | */
|
464 | export declare type AdjustType = 'stack' | 'jitter' | 'dodge' | 'symmetric';
|
465 | /**
|
466 | * @title geometry.color() 图形属性回调函数定义
|
467 | */
|
468 | export declare type ColorAttrCallback = (...args: any[]) => string;
|
469 | /**
|
470 | * @title geometry.shape() 图形属性回调函数定义
|
471 | */
|
472 | export declare type ShapeAttrCallback = (...args: any[]) => string | any[];
|
473 | /**
|
474 | * @title geometry.size() 图形属性回调函数定义
|
475 | */
|
476 | export declare type SizeAttrCallback = (...args: any[]) => number;
|
477 | /**
|
478 | * @title geometry.tooltip() 接口回调函数定义
|
479 | */
|
480 | export declare type TooltipCallback = (...args: any[]) => LooseObject;
|
481 | /**
|
482 | * @title geometry.style() 接口回调函数定义
|
483 | */
|
484 | export declare type StyleCallback = (...args: any[]) => LooseObject;
|
485 | /**
|
486 | * @title geometry.label() 接口回调函数定义
|
487 | */
|
488 | export declare type LabelCallback = (...args: any[]) => GeometryLabelCfg | null | undefined;
|
489 | /**
|
490 | * @title geometry label 中 content 属性的回调函数类型定义
|
491 | */
|
492 | export declare type GeometryLabelContentCallback = (data: Datum, mappingData: MappingDatum, index: number) => string | IShape | IGroup;
|
493 | /**
|
494 | * @title state 下 style 回调函数定义
|
495 | */
|
496 | export declare type StateStyleCallback = (element: Element) => LooseObject;
|
497 | /**
|
498 | * @title 获取 shape marker 时需要的信息
|
499 | */
|
500 | export interface ShapeMarkerCfg {
|
501 | /**
|
502 | * @title 颜色。
|
503 | */
|
504 | color: string;
|
505 | /**
|
506 | * @title 是否是极坐标。
|
507 | */
|
508 | isInPolar: boolean;
|
509 | }
|
510 | /**
|
511 | * @title 图形 marker 的配置信息。
|
512 | */
|
513 | export interface ShapeMarkerAttrs {
|
514 | /**
|
515 | * @title marker 的形状。
|
516 | */
|
517 | symbol: string | ShapeMarkerSymbol;
|
518 | /**
|
519 | * @title marker 样式
|
520 | * @description
|
521 | * marker 的样式,`ShapeAttrs` 属性结构如下:
|
522 | *
|
523 | * ```ts
|
524 | * {
|
525 | * // x 坐标
|
526 | * x?: number;
|
527 | * // y 坐标
|
528 | * y?: number;
|
529 | * // 圆半径
|
530 | * r?: number;
|
531 | * // 描边颜色
|
532 | * stroke?: string | null;
|
533 | * // 描边透明度
|
534 | * strokeOpacity?: number;
|
535 | * // 填充颜色
|
536 | * fill?: string | null;
|
537 | * // 填充透明度
|
538 | * fillOpacity?: number;
|
539 | * // 整体透明度
|
540 | * opacity?: number;
|
541 | * // 线宽
|
542 | * lineWidth?: number;
|
543 | * // 指定如何绘制每一条线段末端
|
544 | * lineCap?: 'butt' | 'round' | 'square';
|
545 | * // 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略)
|
546 | * lineJoin?: 'bevel' | 'round' | 'miter';
|
547 | * // 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数,数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。这个属性取决于浏览器是否支持 setLineDash() 函数。
|
548 | * lineDash?: number[] | null;
|
549 | * // Path 路径
|
550 | * path?: string | object[];
|
551 | * // 图形坐标点
|
552 | * points?: object[];
|
553 | * // 宽度
|
554 | * width?: number;
|
555 | * // 高度
|
556 | * height?: number;
|
557 | * // 阴影模糊效果程度
|
558 | * shadowBlur?: number;
|
559 | * // 阴影颜色
|
560 | * shadowColor?: string | null;
|
561 | * // 阴影 x 方向偏移量
|
562 | * shadowOffsetX?: number;
|
563 | * // 阴影 y 方向偏移量
|
564 | * shadowOffsetY?: number;
|
565 | * // 设置文本内容的当前对齐方式
|
566 | * textAlign?: 'start' | 'center' | 'end' | 'left' | 'right';
|
567 | * // 设置在绘制文本时使用的当前文本基线
|
568 | * textBaseline?: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
|
569 | * // 字体样式
|
570 | * fontStyle?: 'normal' | 'italic' | 'oblique';
|
571 | * // 文本字体大小
|
572 | * fontSize?: number;
|
573 | * // 文本字体
|
574 | * fontFamily?: string;
|
575 | * // 文本粗细
|
576 | * fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
577 | * // 字体变体
|
578 | * fontVariant?: 'normal' | 'small-caps' | string;
|
579 | * // 文本行高
|
580 | * lineHeight?: number;
|
581 | * [key: string]: any;
|
582 | * }
|
583 | * ```
|
584 | *
|
585 | * @link https://github.com/antvis/g/blob/28e3178b616573e0fa6d59694f1aaca2baaa9766/packages/g-base/src/types.ts#L37|ShapeAttrs
|
586 | */
|
587 | style: ShapeAttrs;
|
588 | }
|
589 | /**
|
590 | * @title shape 关键点信息
|
591 | */
|
592 | export interface ShapePoint {
|
593 | /**
|
594 | * @title 数据点映射后对应 x 的值。
|
595 | */
|
596 | readonly x: number | number[];
|
597 | /**
|
598 | * @title 数据点映射后对应 y 的值。
|
599 | */
|
600 | readonly y?: number | number[];
|
601 | /**
|
602 | * @title 数据在 y 方向的最小值。
|
603 | */
|
604 | readonly y0?: number;
|
605 | /**
|
606 | * @title 大小
|
607 | */
|
608 | size?: number;
|
609 | }
|
610 | /**
|
611 | * @title 小提琴图 shape 关键点信息
|
612 | */
|
613 | export declare type ViolinShapePoint = ShapePoint & {
|
614 | _size?: number[];
|
615 | };
|
616 | /**
|
617 | * @title 注册 ShapeFactory 需要实现的接口。
|
618 | */
|
619 | export interface RegisterShapeFactory {
|
620 | /**
|
621 | * @title 默认的 shape 类型。
|
622 | */
|
623 | readonly defaultShapeType: string;
|
624 | /**
|
625 | * @title 返回绘制 shape 所有的关键点集合。
|
626 | */
|
627 | readonly getDefaultPoints?: (pointInfo: ShapePoint) => Point[];
|
628 | /**
|
629 | * @title 获取 shape 的默认绘制样式
|
630 | */
|
631 | readonly getDefaultStyle?: (geometryTheme: LooseObject) => LooseObject;
|
632 | /**
|
633 | * @title 获取 shape 对应的缩略图配置。
|
634 | */
|
635 | readonly getMarker?: (shapeType: string, markerCfg: ShapeMarkerCfg) => ShapeMarkerAttrs;
|
636 | /**
|
637 | * @title 创建具体的 G.Shape 实例。
|
638 | */
|
639 | readonly drawShape?: (shapeType: string, cfg: ShapeInfo, container: IGroup) => IShape | IGroup;
|
640 | }
|
641 | /**
|
642 | * @title 注册具体 shape 需要实现的接口。
|
643 | */
|
644 | export interface RegisterShape {
|
645 | /**
|
646 | * @title 计算绘制需要的关键点,在注册具体的 shape 时由开发者自己定义。
|
647 | */
|
648 | readonly getPoints?: (pointInfo: ShapePoint) => Point[];
|
649 | /**
|
650 | * @title 获取 shape 对应的缩略图样式配置,在注册具体的 shape 时由开发者自己定义。
|
651 | */
|
652 | readonly getMarker?: (markerCfg: ShapeMarkerCfg) => ShapeMarkerAttrs;
|
653 | /**
|
654 | * @title 绘制函数。
|
655 | */
|
656 | readonly draw: (cfg: ShapeInfo, container: IGroup) => IShape | IGroup | void;
|
657 | }
|
658 | /**
|
659 | * @title Shape 接口定义。
|
660 | */
|
661 | export interface Shape extends RegisterShape {
|
662 | /**
|
663 | * @title 坐标系对象。
|
664 | */
|
665 | coordinate: Coordinate;
|
666 | /**
|
667 | * @title 工具函数,将 0~1 path 转化成实际画布 path。
|
668 | */
|
669 | parsePath: (path: any) => PathCommand[];
|
670 | /**
|
671 | * @title 工具函数,0~1 的坐标点转换成实际画布坐标点。
|
672 | */
|
673 | parsePoint: (point: Point) => Point;
|
674 | /**
|
675 | * @title 工具函数,0~1 的坐标点集合转换成实际画布坐标点集合。
|
676 | */
|
677 | parsePoints: (points: Point[]) => Point[];
|
678 | }
|
679 | /**
|
680 | * @title ShapeFactory 接口定义。
|
681 | */
|
682 | export interface ShapeFactory extends RegisterShapeFactory {
|
683 | /**
|
684 | * @title 工厂名。
|
685 | */
|
686 | geometryType: string;
|
687 | /**
|
688 | * @title 坐标系对象。
|
689 | */
|
690 | coordinate: Coordinate;
|
691 | /**
|
692 | * @title ShapeFactory 下所有的主题样式。
|
693 | */
|
694 | theme: LooseObject;
|
695 | /**
|
696 | * @title 根据名称获取具体的 shape 对象。
|
697 | */
|
698 | getShape: (shapeType: string | string[]) => Shape;
|
699 | /**
|
700 | * @title 获取构成 shape 的关键点。
|
701 | */
|
702 | getShapePoints: (shapeType: string | string[], pointInfo: ShapePoint) => Point[];
|
703 | }
|
704 | /**
|
705 | * @title 自定义 Shape marker 的函数
|
706 | */
|
707 | export declare type ShapeMarkerSymbol = (x: number, y: number, r: number) => PathCommand[];
|
708 | /**
|
709 | * @title Annotation position 回调函数
|
710 | */
|
711 | export declare type AnnotationPositionCallback = (xScales: Scale[] | Record<string, Scale>, yScales: Scale[] | Record<string, Scale>) => [number | string, number | string];
|
712 | /**
|
713 | * @title Annotation 位置相关属性的类型定义
|
714 | */
|
715 | export declare type AnnotationPosition = [number | string, number | string] | Record<string, number | string> | AnnotationPositionCallback;
|
716 | /**
|
717 | * @title Annotation 定义的通用属性,chart.annotation().line({})
|
718 | */
|
719 | export interface AnnotationBaseOption {
|
720 | /**
|
721 | * @title 类型
|
722 | */
|
723 | readonly type?: string;
|
724 | /**
|
725 | * @title 是否顶层
|
726 | * @description 指定 annotation 是否绘制在 canvas 最上层,默认为 false, 即绘制在最下层
|
727 | */
|
728 | readonly top?: boolean;
|
729 | /**
|
730 | * @title 是否进行动画
|
731 | */
|
732 | readonly animate?: boolean;
|
733 | /**
|
734 | * @title 动画参数配置
|
735 | * @description 当且仅当 `animate` 属性为 true,即动画开启时生效。
|
736 | */
|
737 | readonly animateOption?: ComponentAnimateOption;
|
738 | /**
|
739 | * @title x 方向的偏移量
|
740 | */
|
741 | readonly offsetX?: number;
|
742 | /**
|
743 | * @title y 方向的偏移量
|
744 | */
|
745 | readonly offsetY?: number;
|
746 | }
|
747 | /**
|
748 | * @title 使用 RegionPosition 定位的组件配置
|
749 | */
|
750 | export interface RegionPositionBaseOption extends AnnotationBaseOption {
|
751 | /**
|
752 | * @title 起始位置
|
753 | */
|
754 | readonly start: AnnotationPosition;
|
755 | /**
|
756 | * @title 结束位置
|
757 | */
|
758 | readonly end: AnnotationPosition;
|
759 | /**
|
760 | * @title 图形样式属性
|
761 | */
|
762 | readonly style?: ShapeAttrs;
|
763 | }
|
764 | /**
|
765 | * @title 使用 PointPosition 定位的组件配置
|
766 | */
|
767 | export interface PointPositionBaseOption extends AnnotationBaseOption {
|
768 | /**
|
769 | * @title Point 定位位置
|
770 | */
|
771 | readonly position: AnnotationPosition;
|
772 | }
|
773 | /**
|
774 | * @title 使用 Image Annotation 组件的配置定义
|
775 | */
|
776 | export interface ImageOption extends RegionPositionBaseOption {
|
777 | /**
|
778 | * @title 图片路径
|
779 | */
|
780 | readonly src: string;
|
781 | }
|
782 | /**
|
783 | * @title 使用 Line Annotation 组件的配置定义
|
784 | */
|
785 | export interface LineOption extends RegionPositionBaseOption {
|
786 | /**
|
787 | * @title 文本配置定义
|
788 | */
|
789 | readonly text?: LineAnnotationTextCfg;
|
790 | }
|
791 | /**
|
792 | * @title 使用 Arc Annotation 组件的配置定义
|
793 | */
|
794 | export declare type ArcOption = RegionPositionBaseOption;
|
795 | /**
|
796 | * @title 使用 Region Annotation 组件的配置定义
|
797 | */
|
798 | export declare type RegionOption = RegionPositionBaseOption;
|
799 | /**
|
800 | * @title 使用 Text Annotation 组件的配置定义
|
801 | */
|
802 | export interface TextOption extends PointPositionBaseOption, Omit<EnhancedTextCfg, 'content'> {
|
803 | content?: string | number | ((filteredData: object[]) => string | number);
|
804 | }
|
805 | /**
|
806 | * @title 使用 DataMarker Annotation 组件的配置定义
|
807 | */
|
808 | export interface DataMarkerOption extends PointPositionBaseOption {
|
809 | /**
|
810 | * @title point 设置
|
811 | */
|
812 | readonly point?: null | {
|
813 | style?: ShapeAttrs;
|
814 | };
|
815 | /**
|
816 | * @title line 设置
|
817 | */
|
818 | readonly line?: null | {
|
819 | style?: ShapeAttrs;
|
820 | length?: number;
|
821 | };
|
822 | /**
|
823 | * @title text 设置
|
824 | */
|
825 | readonly text: null | EnhancedTextCfg;
|
826 | /**
|
827 | * @title 文本超出绘制区域时,是否自动调节文本方向,默认为 true
|
828 | */
|
829 | readonly autoAdjust?: boolean;
|
830 | /**
|
831 | * @title 朝向,默认为 upward,可选值为 'upward' 或者 'downward'
|
832 | */
|
833 | readonly direction?: 'upward' | 'downward';
|
834 | }
|
835 | /**
|
836 | * @title 使用 DataRegion Annotation 组件的配置定义
|
837 | */
|
838 | export interface DataRegionOption extends RegionPositionBaseOption {
|
839 | /**
|
840 | * @title line长度,default为 0
|
841 | */
|
842 | readonly lineLength?: number;
|
843 | /**
|
844 | * @title 标注区间的配置
|
845 | */
|
846 | readonly region?: null | {
|
847 | style?: ShapeAttrs;
|
848 | };
|
849 | /**
|
850 | * @title 文本的配置
|
851 | */
|
852 | readonly text?: null | EnhancedTextCfg;
|
853 | }
|
854 | /**
|
855 | * @title 使用 RegionFilter Annotation 组件的配置定义
|
856 | */
|
857 | export interface RegionFilterOption extends RegionPositionBaseOption {
|
858 | /**
|
859 | * @title 染色色值
|
860 | */
|
861 | readonly color: string;
|
862 | /**
|
863 | * @title 适用场景
|
864 | * @description 可选,设定regionFilter只对特定geom类型起作用,如apply:['area']
|
865 | */
|
866 | readonly apply?: string[];
|
867 | }
|
868 | /**
|
869 | * @title Shape Annotation 的配置
|
870 | */
|
871 | export interface ShapeAnnotationOption extends AnnotationBaseOption {
|
872 | /**
|
873 | * @title 自定义 Annotation 绘制函数
|
874 | */
|
875 | render: (container: IGroup, view: View, helpers: {
|
876 | parsePosition: (position: [string | number, string | number] | Datum) => Point;
|
877 | }) => void;
|
878 | }
|
879 | /**
|
880 | * Html Annotation 配置
|
881 | */
|
882 | export interface HtmlAnnotationOption extends PointPositionBaseOption {
|
883 | /**
|
884 | * @title 容器元素
|
885 | */
|
886 | container?: string | HTMLElement;
|
887 | /**
|
888 | * @title 自定义 HTML DOM 元素
|
889 | */
|
890 | html: string | HTMLElement | ((container: HTMLElement, view: View) => void | string | HTMLElement);
|
891 | /**
|
892 | * @title X 方向对齐
|
893 | */
|
894 | alignX?: 'left' | 'middle' | 'right';
|
895 | /**
|
896 | * @title Y 方向对齐
|
897 | */
|
898 | alignY?: 'top' | 'middle' | 'bottom';
|
899 | /**
|
900 | * @title X 方向偏移
|
901 | */
|
902 | offsetX?: number;
|
903 | /**
|
904 | * @title Y 方向偏移
|
905 | */
|
906 | offsetY?: number;
|
907 | }
|
908 | /**
|
909 | * @title Tooltip 内容框的 css 样式定义
|
910 | */
|
911 | export interface TooltipDomStyles {
|
912 | 'g2-tooltip'?: LooseObject;
|
913 | 'g2-tooltip-title'?: LooseObject;
|
914 | 'g2-tooltip-list'?: LooseObject;
|
915 | 'g2-tooltip-list-item'?: LooseObject;
|
916 | 'g2-tooltip-marker'?: LooseObject;
|
917 | 'g2-tooltip-value'?: LooseObject;
|
918 | 'g2-tooltip-name'?: LooseObject;
|
919 | }
|
920 | /**
|
921 | * @title 目前组件动画允许的参数配置
|
922 | */
|
923 | export interface ComponentAnimateCfg {
|
924 | /**
|
925 | * @title 动画执行时间
|
926 | */
|
927 | readonly duration?: number;
|
928 | /**
|
929 | * @title 动画缓动函数
|
930 | */
|
931 | readonly easing?: string;
|
932 | /**
|
933 | * @title 动画延迟时间
|
934 | */
|
935 | readonly delay?: number;
|
936 | }
|
937 | /**
|
938 | * @title 组件各个动画类型配置
|
939 | */
|
940 | export interface ComponentAnimateOption {
|
941 | /**
|
942 | * @title 初入场动画配置
|
943 | */
|
944 | appear?: ComponentAnimateCfg;
|
945 | /**
|
946 | * @title 更新动画配置
|
947 | */
|
948 | update?: ComponentAnimateCfg;
|
949 | /**
|
950 | * @title 更新后新入场的动画配置
|
951 | */
|
952 | enter?: ComponentAnimateCfg;
|
953 | /**
|
954 | * @title 离场动画配置
|
955 | */
|
956 | leave?: ComponentAnimateCfg;
|
957 | }
|
958 | /**
|
959 | * @title 列定义配置项
|
960 | */
|
961 | export interface ScaleOption extends ScaleConfig {
|
962 | /**
|
963 | * @title 声明度量类型。
|
964 | */
|
965 | type?: ScaleType;
|
966 | /**
|
967 | * @title 同步 scale
|
968 | *
|
969 | * @example
|
970 | * ```ts
|
971 | * chart.scale({
|
972 | * x: { sync: true },
|
973 | * y: { sync: true },
|
974 | * x1: { sync: 'x1' },
|
975 | * x2: { sync: 'x1' },
|
976 | * });
|
977 | * ```
|
978 | *
|
979 | * 通过以上配置,我们会分别对 x 和 y 两个字段,x1 和 x2 两个字段进行同步度量操作。
|
980 | */
|
981 | sync?: boolean | string;
|
982 | /**
|
983 | * @title 是否显示最后的 tick
|
984 | * @description 只对 `type: 'cat'` 以及 `type: 'time-cat'` 的 scale 生效,强制显示最后的日期 tick。
|
985 | */
|
986 | showLast?: boolean;
|
987 | /**
|
988 | * @title 唯一 ID
|
989 | * @description
|
990 | * 用于声明使用数据记录中的哪些字段来组成一条数据的唯一 id(如有多个字段,则使用 '-' 连接)。
|
991 | * 数据 id 用于标识 Element 图形元素,应用于 Geometry 中的图形元素 Element 更新。
|
992 | * 默认 G2 内部会有一套 ID 生成规则,如果不能满足用户需求,用户既可以使用该属性配置 id。
|
993 | * @example
|
994 | * 下面的例子中,声明了将 'x' 和 'y' 字段的数值来作为每条数据记录的 id,即下面数据两条数据的 id 分别为:'1-23' 和 '2-2'。
|
995 | * ```ts
|
996 | * const data = [
|
997 | * { x: 1, y: 23, z: 'a' },
|
998 | * { x: 2, y: 2, z: 'b' },
|
999 | * ];
|
1000 | *
|
1001 | * chart.scale({
|
1002 | * x: { key: true },
|
1003 | * y: { key: true },
|
1004 | * });
|
1005 | * ```
|
1006 | */
|
1007 | key?: boolean;
|
1008 | }
|
1009 | /**
|
1010 | * @title Geometry 动画参数配置。geometry.animate()
|
1011 | */
|
1012 | export interface AnimateOption {
|
1013 | /**
|
1014 | * @title chart 初始化渲染时的入场动画,false/null 表示关闭入场动画。
|
1015 | */
|
1016 | appear?: AnimateCfg | false | null;
|
1017 | /**
|
1018 | * @title chart 发生更新时,新增元素的入场动画,false/null 表示关闭入场动画。
|
1019 | */
|
1020 | enter?: AnimateCfg | false | null;
|
1021 | /**
|
1022 | * @title 更新动画配置,false/null 表示关闭更新动画。
|
1023 | */
|
1024 | update?: AnimateCfg | false | null;
|
1025 | /**
|
1026 | * @title 销毁动画配置,false/null 表示关闭销毁动画。
|
1027 | */
|
1028 | leave?: AnimateCfg | false | null;
|
1029 | }
|
1030 | /**
|
1031 | * @title 用于配置项式声明交互行为
|
1032 | */
|
1033 | export interface InteractionOption {
|
1034 | /**
|
1035 | * @title 交互名称
|
1036 | */
|
1037 | type: string;
|
1038 | /**
|
1039 | * @title 交互配置
|
1040 | */
|
1041 | cfg?: LooseObject;
|
1042 | }
|
1043 | /**
|
1044 | * @title 用于配置项式的 Geometry 创建方式
|
1045 | */
|
1046 | export interface GeometryOption {
|
1047 | /**
|
1048 | * @title Geometry 的类型。
|
1049 | */
|
1050 | type?: 'interval' | 'line' | 'path' | 'point' | 'area' | 'polygon' | 'schema' | 'edge' | 'heatmap' | string;
|
1051 | /**
|
1052 | * @title position 通道映射规则,对应 `geometry.position()`。
|
1053 | */
|
1054 | position?: string | AttributeOption;
|
1055 | /**
|
1056 | * @title color 通道映射规则,对应 `geometry.color()`。
|
1057 | */
|
1058 | color?: string | AttributeOption;
|
1059 | /**
|
1060 | * @title shape 通道映射规则,对应 `geometry.shape()`。
|
1061 | */
|
1062 | shape?: string | AttributeOption;
|
1063 | /**
|
1064 | * @title size 通道映射规则,对应 `geometry.size()`。
|
1065 | */
|
1066 | size?: number | string | AttributeOption;
|
1067 | /**
|
1068 | * @title adjust 数据调整方式,对应 `geometry.adjust()`。
|
1069 | */
|
1070 | adjust?: string | string[] | AdjustOption | AdjustOption[];
|
1071 | /**
|
1072 | * @title style 样式配置,对应 `geometry.size()`。
|
1073 | */
|
1074 | style?: StyleOption | LooseObject;
|
1075 | /**
|
1076 | * @title tooltip 配置,对应 `geometry.tooltip()`。
|
1077 | */
|
1078 | tooltip?: GeometryTooltipOption | boolean | string;
|
1079 | /**
|
1080 | * @title Geometry 动画配置,对应 `geometry.animate()`。
|
1081 | */
|
1082 | animate?: AnimateOption | boolean;
|
1083 | /**
|
1084 | * @title Label 配置,对应 `geometry.label()`。
|
1085 | */
|
1086 | label?: LabelOption | false | string;
|
1087 | /**
|
1088 | * @title state 样式配置,对应 `geometry.state()`。
|
1089 | */
|
1090 | state?: StateOption;
|
1091 | /**
|
1092 | * @title 其他配置
|
1093 | */
|
1094 | cfg?: {
|
1095 | /**
|
1096 | * @title 是否对数据进行排序
|
1097 | */
|
1098 | sortable?: boolean;
|
1099 | /**
|
1100 | * @title 是否可见
|
1101 | */
|
1102 | visible?: boolean;
|
1103 | /**
|
1104 | * @title 是否连接空值,仅对 'line', 'area' 和 'path' 生效
|
1105 | */
|
1106 | connectNulls?: boolean;
|
1107 | };
|
1108 | }
|
1109 | /**
|
1110 | * @title 用于配置型式的 View 声明方式
|
1111 | */
|
1112 | export interface ViewOption {
|
1113 | /**
|
1114 | * @title view 的唯一表示 ID
|
1115 | */
|
1116 | readonly id?: string;
|
1117 | /**
|
1118 | * @title view 的绘制范围,起始点为左上角。
|
1119 | */
|
1120 | readonly region?: Region;
|
1121 | /**
|
1122 | * 设置图表的内边距,使用方式参考 CSS 盒模型。
|
1123 | * 下图黄色区域即为 padding 的范围。
|
1124 | * ![](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*pYwiQrdXGJ8AAAAAAAAAAABkARQnAQ)
|
1125 | *
|
1126 | * @example
|
1127 | * 1. padding: 20
|
1128 | * 2. padding: [ 10, 30, 30 ]
|
1129 | */
|
1130 | readonly padding?: ViewPadding;
|
1131 | /**
|
1132 | * @title 设置主题。
|
1133 | */
|
1134 | readonly theme?: LooseObject | string;
|
1135 | /**
|
1136 | * @title 是否可见。
|
1137 | */
|
1138 | readonly visible?: boolean;
|
1139 | /**
|
1140 | * 图表组件、图形映射等相关的配置。
|
1141 | */
|
1142 | readonly options?: Options;
|
1143 | }
|
1144 | /**
|
1145 | * @title Chart 构造方法的入参
|
1146 | */
|
1147 | export interface ChartCfg extends Omit<ViewCfg, 'parent' | 'canvas' | 'foregroundGroup' | 'middleGroup' | 'backgroundGroup' | 'region'> {
|
1148 | /**
|
1149 | * @title 指定 chart 绘制的 DOM,可以传入 DOM id,也可以直接传入 dom 实例。
|
1150 | */
|
1151 | readonly container: string | HTMLElement;
|
1152 | /**
|
1153 | * @title 图表宽度。
|
1154 | */
|
1155 | readonly width?: number;
|
1156 | /**
|
1157 | * @title 图表高度。
|
1158 | */
|
1159 | readonly height?: number;
|
1160 | /**
|
1161 | * @title 否自适应容器宽高
|
1162 | * @description
|
1163 | * 图表是否自适应容器宽高,默认为 false,用户需要手动设置 width 和 height。当 `autoFit: true` 时,
|
1164 | * 会自动取图表容器的宽高,如果用户设置了 height,那么会以用户设置的 height 为准。
|
1165 | * @default false
|
1166 | */
|
1167 | readonly autoFit?: boolean;
|
1168 | /**
|
1169 | * @title 渲染引擎
|
1170 | * @default "canvas"
|
1171 | */
|
1172 | readonly renderer?: Renderer;
|
1173 | /**
|
1174 | * @title 像素比
|
1175 | * @description 设置设备像素比,默认取浏览器的值 `window.devicePixelRatio`。
|
1176 | */
|
1177 | readonly pixelRatio?: number;
|
1178 | /**
|
1179 | * @title 是否开启局部刷新
|
1180 | * @default true
|
1181 | */
|
1182 | readonly localRefresh?: boolean;
|
1183 | /**
|
1184 | * @title 是否支持 CSS transform
|
1185 | * @description 开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。
|
1186 | * @default false
|
1187 | */
|
1188 | readonly supportCSSTransform?: boolean;
|
1189 | /**
|
1190 | * @title 配置图表默认交互,仅支持字符串形式。
|
1191 | */
|
1192 | readonly defaultInteractions?: string[];
|
1193 | }
|
1194 | export declare type SyncViewPaddingFn = (chart: View, views: View[], PC: PaddingCalCtor) => void;
|
1195 | /**
|
1196 | * @title View 构造参数
|
1197 | */
|
1198 | export interface ViewCfg {
|
1199 | /**
|
1200 | * @title View id,可以由外部传入
|
1201 | */
|
1202 | readonly id?: string;
|
1203 | /**
|
1204 | * @title 当前 view 的父级 view。
|
1205 | */
|
1206 | readonly parent: View;
|
1207 | /**
|
1208 | * @title canvas 实例。
|
1209 | */
|
1210 | readonly canvas: ICanvas;
|
1211 | /**
|
1212 | * @title 前景层
|
1213 | */
|
1214 | readonly foregroundGroup: IGroup;
|
1215 | /**
|
1216 | * @title 中间层
|
1217 | */
|
1218 | readonly middleGroup: IGroup;
|
1219 | /**
|
1220 | * @title 背景层
|
1221 | */
|
1222 | readonly backgroundGroup: IGroup;
|
1223 | /**
|
1224 | * @title view 的绘制范围
|
1225 | */
|
1226 | readonly region?: Region;
|
1227 | /**
|
1228 | * @title 是否对超出坐标系范围的 Geometry 进行剪切
|
1229 | */
|
1230 | readonly limitInPlot?: boolean;
|
1231 | /**
|
1232 | * @title 内边距
|
1233 | * @description 设置图表的内边距,使用方式参考 CSS 盒模型,下图黄色区域即为 padding 的范围。
|
1234 | * @see ![](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*pYwiQrdXGJ8AAAAAAAAAAABkARQnAQ)
|
1235 | * @example
|
1236 | * 1. padding: 20
|
1237 | * 2. padding: [ 10, 30, 30 ]
|
1238 | */
|
1239 | readonly padding?: ViewPadding;
|
1240 | /**
|
1241 | * @title 额外边距
|
1242 | * @description 设置图表的内边距在padding的基础上增加appendPadding的调整。
|
1243 | * @example
|
1244 | * 1. padding: 20
|
1245 | * 2. padding: [ 10, 30, 30 ]
|
1246 | */
|
1247 | readonly appendPadding?: ViewAppendPadding;
|
1248 | /**
|
1249 | * @title 是否同步子 view 的 padding
|
1250 | * @description 是否同步子 view 的 padding,可以是 boolean / SyncViewPaddingFn
|
1251 | * @example
|
1252 | * view1 的 padding 10
|
1253 | * view2 的 padding 20
|
1254 | * 那么两个子 view 的 padding 统一变成最大的 20.
|
1255 | *
|
1256 | * 如果是 Funcion,则使用自定义的方式去计算子 view 的 padding,这个函数中去修改所有的 views autoPadding 值
|
1257 | */
|
1258 | readonly syncViewPadding?: boolean | SyncViewPaddingFn;
|
1259 | /**
|
1260 | * @title 主题
|
1261 | * @description 设置 view 实例主题
|
1262 | */
|
1263 | readonly theme?: LooseObject | string;
|
1264 | /**
|
1265 | * @title 图表组件、图形映射等相关的配置。
|
1266 | */
|
1267 | readonly options?: Options;
|
1268 | /**
|
1269 | * @title 是否可见
|
1270 | */
|
1271 | readonly visible?: boolean;
|
1272 | }
|
1273 | /**
|
1274 | * @ignore
|
1275 | * 组件及布局的信息
|
1276 | */
|
1277 | export interface ComponentOption {
|
1278 | readonly id?: string;
|
1279 | readonly component: GroupComponent | HtmlComponent;
|
1280 | readonly layer: LAYER;
|
1281 | direction: DIRECTION;
|
1282 | readonly type: COMPONENT_TYPE;
|
1283 | readonly extra?: any;
|
1284 | }
|
1285 | /**
|
1286 | * @title Legend marker 的配置结构
|
1287 | */
|
1288 | export interface MarkerCfg extends LegendMarkerCfg {
|
1289 | /**
|
1290 | * @title 配置图例 marker 的 symbol 形状。
|
1291 | */
|
1292 | symbol?: Marker | MarkerCallback;
|
1293 | style?: ShapeAttrs | ((style: ShapeAttrs) => ShapeAttrs);
|
1294 | }
|
1295 | /**
|
1296 | * @title Legend item 各个图例项的数据结构
|
1297 | */
|
1298 | export interface LegendItem {
|
1299 | /**
|
1300 | * 唯一值,用于动画或者查找
|
1301 | */
|
1302 | id?: string;
|
1303 | /**
|
1304 | * @title 名称
|
1305 | */
|
1306 | name: string;
|
1307 | /**
|
1308 | * @title 值
|
1309 | */
|
1310 | value: any;
|
1311 | /**
|
1312 | * @title 图形标记
|
1313 | */
|
1314 | marker?: MarkerCfg | ((name: string, index: number, item: {
|
1315 | name: string;
|
1316 | value: string;
|
1317 | } & MarkerCfg) => MarkerCfg);
|
1318 | /**
|
1319 | * @title 初始是否处于未激活状态
|
1320 | */
|
1321 | unchecked?: boolean;
|
1322 | }
|
1323 | export interface G2LegendTitleCfg extends LegendTitleCfg {
|
1324 | /**
|
1325 | * @title title 文本显示内容
|
1326 | */
|
1327 | text?: string;
|
1328 | }
|
1329 | /**
|
1330 | * 图例项配置
|
1331 | */
|
1332 | export interface LegendCfg extends Omit<CategoryLegendCfg, 'marker'> {
|
1333 | /**
|
1334 | * @title 是否为自定义图例
|
1335 | * @description 当该属性为 true 时,需要声明 items 属性。
|
1336 | */
|
1337 | readonly custom?: boolean;
|
1338 | /**
|
1339 | * @title 布局
|
1340 | * @description 布局方式: horizontal,vertical
|
1341 | */
|
1342 | layout?: 'horizontal' | 'vertical';
|
1343 | /**
|
1344 | * @title 图例标题配置
|
1345 | * @description 默认不展示。
|
1346 | * @example
|
1347 | * 属性结构如下:
|
1348 | *
|
1349 | * ```ts
|
1350 | * {
|
1351 | * spacing?: number; // 标题同图例项的间距
|
1352 | * style?: ShapeAttrs; // 文本样式配置项
|
1353 | * }
|
1354 | * ```
|
1355 | *
|
1356 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L639|LegendTitleCfg
|
1357 | */
|
1358 | title?: G2LegendTitleCfg;
|
1359 | /**
|
1360 | * @title 背景框配置项。
|
1361 | * @example
|
1362 | * 属性结构如下:
|
1363 | *
|
1364 | * ```ts
|
1365 | * {
|
1366 | * padding?: number | number[]; // 背景的留白
|
1367 | * style?: ShapeAttrs; // 背景样式配置项
|
1368 | * }
|
1369 | * ```
|
1370 | *
|
1371 | * 详见 {@link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L652|LegendBackgroundCfg}
|
1372 | */
|
1373 | background?: LegendBackgroundCfg;
|
1374 | /**
|
1375 | * @title 图例的位置。
|
1376 | */
|
1377 | position?: 'top' | 'top-left' | 'top-right' | 'right' | 'right-top' | 'right-bottom' | 'left' | 'left-top' | 'left-bottom' | 'bottom' | 'bottom-left' | 'bottom-right';
|
1378 | /**
|
1379 | * @title 动画开关,默认关闭。
|
1380 | */
|
1381 | animate?: boolean;
|
1382 | /**
|
1383 | * @title 动画
|
1384 | * @description 动画参数配置,当且仅当 `animate` 属性为 true,即动画开启时生效。
|
1385 | */
|
1386 | animateOption?: ComponentAnimateOption;
|
1387 | /**
|
1388 | * @title 水平间距
|
1389 | * @description **分类图例适用**,控制图例项水平方向的间距。
|
1390 | */
|
1391 | itemSpacing?: number;
|
1392 | /**
|
1393 | * @title 垂直间距
|
1394 | * @description **分类图例适用**,控制图例项垂直方向的间距。
|
1395 | */
|
1396 | itemMarginBottom?: number;
|
1397 | /**
|
1398 | * @title 图例项的最大宽度
|
1399 | * @description
|
1400 | * **分类图例适用**,图例项的最大宽度,超出则自动缩略。
|
1401 | * `maxItemWidth` 可以是像素值;
|
1402 | * 也可以是相对值(取 0 到 1 范围的数值),代表占图表宽度的多少
|
1403 | */
|
1404 | maxItemWidth?: number;
|
1405 | /**
|
1406 | * @title 图例项的宽度
|
1407 | * @description **分类图例适用**,图例项的宽度, 默认为 null,自动计算。
|
1408 | */
|
1409 | itemWidth?: number;
|
1410 | /**
|
1411 | * @title 图例项的高度
|
1412 | * @description **分类图例适用**,图例的高度,默认为 null。
|
1413 | */
|
1414 | itemHeight?: number;
|
1415 | /**
|
1416 | * @title 图例项 name
|
1417 | * @description
|
1418 | * **分类图例适用**,图例项 name 文本的配置。
|
1419 | * 属性结构如下:
|
1420 | *
|
1421 | * ```ts
|
1422 | * {
|
1423 | * spacing?: number; // 图例项 name 同后面 value 的间距
|
1424 | * formatter?: (text: string, item: ListItem, index: number) => any; // 格式化文本函数
|
1425 | * style?: ShapeAttrs; // 文本配置项
|
1426 | * }
|
1427 | * ```
|
1428 | *
|
1429 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L665|LegendItemNameCfg
|
1430 | */
|
1431 | itemName?: LegendItemNameCfg;
|
1432 | /**
|
1433 | * @title 图例项 value
|
1434 | * @description
|
1435 | * **分类图例适用**,图例项 value 附加值的配置项。
|
1436 | * 属性结构如下:
|
1437 | *
|
1438 | * ```ts
|
1439 | * {
|
1440 | * alignRight?: boolean; // 是否右对齐,默认为 false,仅当设置图例项宽度时生效
|
1441 | * formatter?: (text: string, item: ListItem, index: number) => any; // 格式化文本函数
|
1442 | * style?: ShapeAttrs; // 图例项附加值的配置
|
1443 | * }
|
1444 | * ```
|
1445 | *
|
1446 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L685|LegendItemValueCfg
|
1447 | */
|
1448 | itemValue?: LegendItemValueCfg;
|
1449 | /**
|
1450 | * @title 最大宽度
|
1451 | * @description **分类图例适用**,图例项最大宽度设置。
|
1452 | */
|
1453 | maxWidth?: number;
|
1454 | /**
|
1455 | * @title 最大高度
|
1456 | * @description **分类图例适用**,图例项最大高度设置。
|
1457 | */
|
1458 | maxHeight?: number;
|
1459 | /**
|
1460 | * @title 最大宽度比例
|
1461 | * @description **分类图例适用**,图例项最大宽度比例(以 view 的 bbox 宽度为参照,默认 0.25)。
|
1462 | */
|
1463 | maxWidthRatio?: number;
|
1464 | /**
|
1465 | * @title 最大高度比例
|
1466 | * @description **分类图例适用**,图例项最大高度比例(以 view 的 bbox 高度为参照,默认 0.25)。
|
1467 | */
|
1468 | maxHeightRatio?: number;
|
1469 | /**
|
1470 | * @title 图例项的 marker
|
1471 | * @description **分类图例适用**,图例项的 marker 图标的配置。
|
1472 | */
|
1473 | marker?: MarkerCfg | ((name: string, index: number, item: {
|
1474 | name: string;
|
1475 | value: string;
|
1476 | } & MarkerCfg) => MarkerCfg);
|
1477 | /**
|
1478 | * @title 是否进行分页
|
1479 | * @description **适用于分类图例**,当图例项过多时是否进行分页。
|
1480 | */
|
1481 | flipPage?: boolean;
|
1482 | /**
|
1483 | * @title 分页器的样式
|
1484 | * @description **适用于分类图例**,图例分页器的样式设置。
|
1485 | */
|
1486 | pageNavigator?: LegendPageNavigatorCfg;
|
1487 | /**
|
1488 | * @title 图例项
|
1489 | * @description **分类图例适用**,用户自己配置图例项的内容。
|
1490 | */
|
1491 | items?: LegendItem[];
|
1492 | /**
|
1493 | * @title 反选
|
1494 | * @description **分类图里适用**,用来配置正反选功能
|
1495 | */
|
1496 | radio?: LegendRadio;
|
1497 | /**
|
1498 | * @title 是否逆序
|
1499 | * @description **分类图例适用**,是否将图例项逆序展示。
|
1500 | */
|
1501 | reversed?: boolean;
|
1502 | /**
|
1503 | * @title 最小值
|
1504 | * @description **连续图例适用**,选择范围的最小值。
|
1505 | */
|
1506 | min?: number;
|
1507 | /**
|
1508 | * @title 最大
|
1509 | * @description **连续图例适用**,选择范围的最大值。
|
1510 | */
|
1511 | max?: number;
|
1512 | /**
|
1513 | * @title value
|
1514 | * @description **连续图例适用**,选择的值。
|
1515 | */
|
1516 | value?: number[];
|
1517 | /**
|
1518 | * @title 色块样式
|
1519 | * @description
|
1520 | * **连续图例适用**,选择范围的色块样式配置项。
|
1521 | * 属性结构如下:
|
1522 | *
|
1523 | * ```ts
|
1524 | * {
|
1525 | * style?: ShapeAttrs; // 选定范围的样式
|
1526 | * }
|
1527 | * ```
|
1528 | *
|
1529 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L574|ContinueLegendTrackCfg
|
1530 | */
|
1531 | track?: ContinueLegendTrackCfg;
|
1532 | /**
|
1533 | * @title 滑轨(背景
|
1534 | * @description
|
1535 | * **连续图例适用**,图例滑轨(背景)的样式配置项。
|
1536 | * 属性结构如下:
|
1537 | *
|
1538 | * ```ts
|
1539 | * {
|
1540 | * type?: string; // rail 的类型,color, size
|
1541 | * size?: number; // 滑轨的宽度
|
1542 | * defaultLength?: number; // 滑轨的默认长度,,当限制了 maxWidth,maxHeight 时,不会使用这个属性会自动计算长度
|
1543 | * style?: ShapeAttrs; // 滑轨的样式
|
1544 | * }
|
1545 | * ```
|
1546 | *
|
1547 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L595|ContinueLegendRailCfg
|
1548 | */
|
1549 | rail?: ContinueLegendRailCfg;
|
1550 | /**
|
1551 | * @title 文本
|
1552 | * @description
|
1553 | * **连续图例适用**,文本的配置项。
|
1554 | * 属性结构如下:
|
1555 | *
|
1556 | * ```ts
|
1557 | * {
|
1558 | * // 文本同滑轨的对齐方式,有五种类型
|
1559 | * // rail : 同滑轨对齐,在滑轨的两端
|
1560 | * // top, bottom: 图例水平布局时有效
|
1561 | * // left, right: 图例垂直布局时有效
|
1562 | * align?: string;
|
1563 | * spacing?: number; // 文本同滑轨的距离
|
1564 | * style?: ShapeAttrs; // 文本样式
|
1565 | * }
|
1566 | * ```
|
1567 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L618|ContinueLegendLabelCfg
|
1568 | */
|
1569 | label?: ContinueLegendLabelCfg;
|
1570 | /**
|
1571 | * @title 滑块
|
1572 | * @description
|
1573 | * **连续图例适用**,滑块的配置项。
|
1574 | * 属性结构如下:
|
1575 | *
|
1576 | * ```ts
|
1577 | * {
|
1578 | * size?: number; // 滑块的大小
|
1579 | * style?: ShapeAttrs; // 滑块的样式设置
|
1580 | * }
|
1581 | * ```
|
1582 | *
|
1583 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L582|ContinueLegendTrackCfg
|
1584 | */
|
1585 | handler?: ContinueLegendHandlerCfg;
|
1586 | /**
|
1587 | * @title 是否可滑动
|
1588 | * @description **连续图例适用**,滑块是否可以滑动。
|
1589 | */
|
1590 | slidable?: boolean;
|
1591 | /**
|
1592 | * @title 图例 x 方向的偏移。
|
1593 | */
|
1594 | offsetX?: number;
|
1595 | /**
|
1596 | * @title 图例 y 方向的偏移。
|
1597 | */
|
1598 | offsetY?: number;
|
1599 | /**
|
1600 | * @title 图例在四个方向的偏移量
|
1601 | */
|
1602 | padding?: number[];
|
1603 | /**
|
1604 | * 图例高亮状态,false 表示默认置灰,无或 true 表示高亮
|
1605 | */
|
1606 | selected?: {
|
1607 | [key: string]: boolean;
|
1608 | };
|
1609 | }
|
1610 | /**
|
1611 | * Tooltip Crosshairs 的文本数据结构。
|
1612 | */
|
1613 | export interface TooltipCrosshairsText extends CrosshairTextCfg {
|
1614 | /**
|
1615 | * @title crosshairs 文本内容
|
1616 | */
|
1617 | content?: string;
|
1618 | }
|
1619 | /**
|
1620 | * 辅助线文本回调函数
|
1621 | * @param type 对应当前 crosshairs 的类型,值为 'x' 或者 'y'
|
1622 | * @param defaultContent 对应当前 crosshairs 默认的文本内容
|
1623 | * @param items 对应当前 tooltip 内容框中的数据
|
1624 | * @param currentPoint 对应当前坐标点
|
1625 | * @returns 返回当前 crosshairs 对应的辅助线文本配置
|
1626 | */
|
1627 | export declare type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
|
1628 | /**
|
1629 | * @title Tooltip crosshairs 配置结构
|
1630 | */
|
1631 | export interface TooltipCrosshairs {
|
1632 | /**
|
1633 | * @title 类型
|
1634 | * @description
|
1635 | * crosshairs 的类型: `x` 表示 x 轴上的辅助线,`y` 表示 y 轴上的辅助项。
|
1636 | * 以下是在不同坐标系下,crosshairs 各个类型的表现:
|
1637 | *
|
1638 | * | 坐标系 | type = 'x' | type = 'xy' | type = 'y' |
|
1639 | * | ------------ | ------------- | ------------- |
|
1640 | * | 直角坐标系 | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*jmUBQ4nbtXsAAAAAAAAAAABkARQnAQ) | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*RpWXT76ZSQgAAAAAAAAAAABkARQnAQ) | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*Xjl8TLIJLuUAAAAAAAAAAABkARQnAQ) |
|
1641 | * | 极坐标 | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*zbMVSoKTyFsAAAAAAAAAAABkARQnAQ) | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*k5EYRJspET0AAAAAAAAAAABkARQnAQ) | ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*n_TKQpUaXWEAAAAAAAAAAABkARQnAQ) |
|
1642 | */
|
1643 | type?: 'x' | 'y' | 'xy';
|
1644 | /**
|
1645 | * @title 辅助线的样式配置。
|
1646 | * @description
|
1647 | * 属性结构如下:
|
1648 | *
|
1649 | * ```ts
|
1650 | * {
|
1651 | * style?: ShapeAttrs; // 线的样式配置
|
1652 | * }
|
1653 | * ```
|
1654 | *
|
1655 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L1177|CrosshairLineCfg
|
1656 | */
|
1657 | line?: CrosshairLineCfg;
|
1658 | /**
|
1659 | * @title 文本
|
1660 | * @description 辅助线文本配置,支持回调。
|
1661 | */
|
1662 | text?: TooltipCrosshairsText | TooltipCrosshairsTextCallback;
|
1663 | /**
|
1664 | * @title 辅助线文本背景配置。
|
1665 | * @description
|
1666 | * 属性结构如下:
|
1667 | *
|
1668 | * ```ts
|
1669 | * {
|
1670 | * padding?: number | number[]; // 文本背景周围的留白
|
1671 | * style?: ShapeAttrs; // 文本背景的样式
|
1672 | * }
|
1673 | * ```
|
1674 | *
|
1675 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L1185|CrosshairTextBackgroundCfg
|
1676 | */
|
1677 | textBackground?: CrosshairTextBackgroundCfg;
|
1678 | /**
|
1679 | * @title 辅助线是否跟随鼠标移动
|
1680 | * @description 即定位到数据点
|
1681 | * @default false
|
1682 | */
|
1683 | follow?: boolean;
|
1684 | }
|
1685 | export declare type TooltipTitle = string | ((title: string, datum: Datum) => string);
|
1686 | export declare type TooltipItem = {
|
1687 | /**
|
1688 | * @title 原始数据
|
1689 | */
|
1690 | readonly data: Datum;
|
1691 | /**
|
1692 | * @title 映射之后的数据
|
1693 | */
|
1694 | readonly mappingData: Datum;
|
1695 | /**
|
1696 | * @title tooltip item 中名称
|
1697 | */
|
1698 | readonly name: string;
|
1699 | /**
|
1700 | * @title tooltip item 中值
|
1701 | */
|
1702 | readonly value: string | number;
|
1703 | /**
|
1704 | * @title tooltip item 中颜色
|
1705 | */
|
1706 | readonly color: string;
|
1707 | /**
|
1708 | * @title tooltip item 中图标类型
|
1709 | */
|
1710 | readonly marker: string;
|
1711 | };
|
1712 | /**
|
1713 | * @title chart.tooltip() 接口配置属性
|
1714 | */
|
1715 | export interface TooltipCfg {
|
1716 | /**
|
1717 | * @title 设置 tooltip 内容框是否跟随鼠标移动。
|
1718 | * @description 默认为 true,跟随鼠标移动,false 则固定位置不随鼠标移动。
|
1719 | * @default true
|
1720 | */
|
1721 | follow?: boolean;
|
1722 | /**
|
1723 | * @title tooltip 是否允许鼠标滑入
|
1724 | * @default false
|
1725 | */
|
1726 | enterable?: boolean;
|
1727 | /**
|
1728 | * @title tooltip 显示延迟(ms)
|
1729 | * @description 默认为 16ms,建议在 enterable = true 的时候才设置
|
1730 | * @default "16ms"
|
1731 | */
|
1732 | showDelay?: number;
|
1733 | /**
|
1734 | * @title 是否展示 tooltip 标题。
|
1735 | */
|
1736 | showTitle?: boolean;
|
1737 | /**
|
1738 | * @title 标题
|
1739 | * @description
|
1740 | * 设置 tooltip 的标题内容:如果值为数据字段名,则会展示数据中对应该字段的数值,如果数据中不存在该字段,则直接展示 title 值。
|
1741 | * 同时支持传入方法,回调的方式返回字符串
|
1742 | */
|
1743 | title?: TooltipTitle;
|
1744 | /**
|
1745 | * @title 设置 tooltip 的固定展示位置,相对于数据点。
|
1746 | */
|
1747 | position?: 'top' | 'bottom' | 'left' | 'right';
|
1748 | /**
|
1749 | * @title 是否合并当前点对应的所有数据
|
1750 | * @description true 表示合并当前点对应的所有数据并展示,false 表示只展示离当前点最逼近的数据内容。
|
1751 | */
|
1752 | shared?: boolean;
|
1753 | /**
|
1754 | * @title 是否展示 crosshairs。
|
1755 | */
|
1756 | showCrosshairs?: boolean;
|
1757 | /**
|
1758 | * @title 交叉线
|
1759 | * @description 配置 tooltip 的 crosshairs,当且仅当 `showCrosshairs` 为 true 时生效。
|
1760 | */
|
1761 | crosshairs?: TooltipCrosshairs;
|
1762 | /**
|
1763 | * @title 是否渲染 tooltipMarkers。
|
1764 | */
|
1765 | showMarkers?: boolean;
|
1766 | /**
|
1767 | * @title tooltipMarker 的样式配置。
|
1768 | */
|
1769 | marker?: object;
|
1770 | /**
|
1771 | * @title 是否展示 tooltip 内容框
|
1772 | */
|
1773 | showContent?: boolean | ((datum: Datum) => boolean);
|
1774 | /**
|
1775 | * @title 自定义 tooltip 的容器。
|
1776 | */
|
1777 | container?: string | HTMLElement;
|
1778 | /**
|
1779 | * @title 图例容器的模板
|
1780 | * @description 用于指定图例容器的模板,自定义模板时必须包含各个 dom 节点的 class。
|
1781 | */
|
1782 | containerTpl?: string;
|
1783 | /**
|
1784 | * @title 默认模板
|
1785 | * @description 每项记录的默认模板,自定义模板时必须包含各个 dom 节点的 class。
|
1786 | */
|
1787 | itemTpl?: string;
|
1788 | /**
|
1789 | * @title dom 样式
|
1790 | * @description 传入各个 dom 的样式。
|
1791 | */
|
1792 | domStyles?: TooltipDomStyles;
|
1793 | /**
|
1794 | * @title tooltip 偏移量。
|
1795 | */
|
1796 | offset?: number;
|
1797 | /**
|
1798 | * @title 是否将 tooltip items 逆序
|
1799 | */
|
1800 | reversed?: boolean;
|
1801 | /**
|
1802 | * @title 是否显示空值的 tooltip 项目
|
1803 | */
|
1804 | showNil?: boolean;
|
1805 | /**
|
1806 | * @description 在 tooltip 渲染之前,对最终的 items 进行自定义处理(比如排序、过滤、格式化等)
|
1807 | */
|
1808 | customItems?: (originalItems: TooltipItem[]) => TooltipItem[];
|
1809 | /**
|
1810 | * @title 自定义模板
|
1811 | */
|
1812 | customContent?: (title: string, data: any[]) => string | HTMLElement;
|
1813 | }
|
1814 | /**
|
1815 | * @title 坐标系配置
|
1816 | */
|
1817 | export interface CoordinateOption {
|
1818 | /**
|
1819 | * @title 坐标系类型
|
1820 | */
|
1821 | type?: 'polar' | 'theta' | 'rect' | 'cartesian' | 'helix';
|
1822 | /**
|
1823 | * @title 坐标系配置项,目前常用于极坐标。
|
1824 | */
|
1825 | cfg?: CoordinateCfg;
|
1826 | /**
|
1827 | * @title 坐标系变换
|
1828 | * @description
|
1829 | * 1. rotate 表示旋转,使用弧度制。
|
1830 | * 2. scale 表示沿着 x 和 y 方向的缩放比率。
|
1831 | * 3. reflect 表示沿 x 方向镜像或者沿 y 轴方向映射。
|
1832 | * 4. transpose 表示 x,y 轴置换。
|
1833 | */
|
1834 | actions?: CoordinateActions[];
|
1835 | }
|
1836 | /**
|
1837 | * @title 极坐标系支持的配置属性
|
1838 | */
|
1839 | export interface CoordinateCfg {
|
1840 | /**
|
1841 | * @title 起始弧度
|
1842 | * @description 用于极坐标,配置起始弧度。
|
1843 | */
|
1844 | startAngle?: number;
|
1845 | /**
|
1846 | * @title 结束弧度
|
1847 | * @description 用于极坐标,配置结束弧度。
|
1848 | */
|
1849 | endAngle?: number;
|
1850 | /**
|
1851 | * @title 半径
|
1852 | * @description 用于极坐标,配置极坐标半径,0 - 1 范围的数值。
|
1853 | */
|
1854 | radius?: number;
|
1855 | /**
|
1856 | * @title 内半径
|
1857 | * @description 用于极坐标,极坐标内半径,0 -1 范围的数值。
|
1858 | */
|
1859 | innerRadius?: number;
|
1860 | }
|
1861 | /**
|
1862 | * @title 坐标轴网格线的配置属性
|
1863 | */
|
1864 | export interface AxisGridCfg {
|
1865 | /**
|
1866 | * @title 线的样式
|
1867 | * @description
|
1868 | * 属性结构如下:
|
1869 | *
|
1870 | * ```ts
|
1871 | * {
|
1872 | * type?: string; // 栅格线的类型,'line' 或者 'circle'
|
1873 | * style?: ShapeAttrs; // 栅格线的样式配置项
|
1874 | * }
|
1875 | * ```
|
1876 | *
|
1877 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L407|GridLineCfg
|
1878 | */
|
1879 | line?: GridLineCfg;
|
1880 | /**
|
1881 | * @title 两个栅格线间的填充色。
|
1882 | */
|
1883 | alternateColor?: string | string[];
|
1884 | /**
|
1885 | * @title 是否关闭
|
1886 | * @description 对于 circle 是否关闭 grid。
|
1887 | */
|
1888 | closed?: boolean;
|
1889 | /**
|
1890 | * @title 是否同刻度线对齐
|
1891 | * @description 如果值为 false,则会显示在两个刻度中间。
|
1892 | * @see ![image](https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*YX6fS4GTTvMAAAAAAAAAAABkARQnAQ)
|
1893 | */
|
1894 | alignTick?: boolean;
|
1895 | }
|
1896 | /**
|
1897 | * @title 坐标轴配置属性,chart.axis()
|
1898 | */
|
1899 | export interface AxisCfg {
|
1900 | /**
|
1901 | * @title 是否渲染在画布顶层
|
1902 | * @description 防止部分图形中,需要将 axis 显示在图形上面,避免被图形遮挡
|
1903 | */
|
1904 | top?: boolean;
|
1905 | /**
|
1906 | * @title 坐标轴的位置
|
1907 | * @description 适用于直角坐标系,设置坐标轴的位置。
|
1908 | */
|
1909 | position?: 'top' | 'bottom' | 'right' | 'left';
|
1910 | /**
|
1911 | * @title 轴线
|
1912 | * @description
|
1913 | * 坐标轴线的配置项,null 表示不展示。
|
1914 | * 属性结构如下:
|
1915 | *
|
1916 | * ```ts
|
1917 | * {
|
1918 | * style?: ShapeAttrs; // 坐标轴线的样式配置项
|
1919 | * }
|
1920 | * ```
|
1921 | *
|
1922 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L91|AxisLineCfg
|
1923 | */
|
1924 | line?: AxisLineCfg | null;
|
1925 | /**
|
1926 | * @title 刻度线线
|
1927 | * @description
|
1928 | * 坐标轴刻度线线的配置项,null 表示不展示。
|
1929 | * 属性结构如下:
|
1930 | *
|
1931 | * ```ts
|
1932 | * {
|
1933 | * style?: ShapeAttrs; // 坐标轴刻度线的样式配置项
|
1934 | * alignTick?: boolean; // 是否同 tick 对齐
|
1935 | * length?: number; // 长度
|
1936 | * }
|
1937 | * ```
|
1938 | *
|
1939 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L103|AxisTickLineCfg
|
1940 | */
|
1941 | tickLine?: AxisTickLineCfg | null;
|
1942 | /**
|
1943 | * @title 子刻度线
|
1944 | * @description
|
1945 | * 坐标轴子刻度线的配置项,null 表示不展示。
|
1946 | * 属性结构如下:
|
1947 | *
|
1948 | * ```ts
|
1949 | * {
|
1950 | * style?: ShapeAttrs; // 坐标轴刻度线的样式配置项
|
1951 | * count?: number; // 子刻度个数
|
1952 | * length?: number; // 子刻度线长度
|
1953 | * }
|
1954 | * ```
|
1955 | *
|
1956 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L169|AxisSubTickLineCfg
|
1957 | */
|
1958 | subTickLine?: AxisSubTickLineCfg | null;
|
1959 | /**
|
1960 | * @title 标题
|
1961 | * @description
|
1962 | * 标题的配置项,null 表示不展示。
|
1963 | * 属性结构如下:
|
1964 | *
|
1965 | * ```ts
|
1966 | * {
|
1967 | * offset?: number; // 标题距离坐标轴的距离
|
1968 | * style?: ShapeAttrs; // 标题文本配置项
|
1969 | * autoRotate?: boolean; // 是否自动旋转
|
1970 | * }
|
1971 | * ```
|
1972 | *
|
1973 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L191|AxisTitleCfg
|
1974 | */
|
1975 | title?: AxisTitleCfg | null;
|
1976 | /**
|
1977 | * @title 文本标签
|
1978 | * @description
|
1979 | * 文本标签的配置项,null 表示不展示。
|
1980 | * 属性结构如下:
|
1981 | *
|
1982 | * ```ts
|
1983 | * {
|
1984 | * // 坐标轴文本的样式
|
1985 | * style?: ShapeAttrs;
|
1986 | * // label 的偏移量
|
1987 | * offset?: number;
|
1988 | * // 文本旋转角度
|
1989 | * rotate?: number;
|
1990 | * // 格式化函数
|
1991 | * formatter?: (text: string, item: ListItem, index: number) => any;
|
1992 | * // 是否自动旋转,默认 false
|
1993 | * autoRotate?: boolean | (isVertical: boolean, labelGroup: IGroup, limitLength?: number) => boolean; | string;
|
1994 | * // 是否自动隐藏,默认 true
|
1995 | * autoHide?: boolean | (isVertical: boolean, labelGroup: IGroup, limitLength?: number) => boolean; | string;
|
1996 | * // 是否自动省略,默认 false
|
1997 | * autoEllipsis?: boolean | (isVertical: boolean, labelGroup: IGroup, limitLength?: number) => boolean; | string;
|
1998 | * }
|
1999 | * ```
|
2000 | *
|
2001 | * @link https://github.com/antvis/component/blob/81890719a431b3f9088e0c31c4d5d382ef0089df/src/types.ts#L127|AxisLabelCfg
|
2002 | */
|
2003 | label?: AxisLabelCfg | null;
|
2004 | /**
|
2005 | * @title 网格线
|
2006 | * @description 坐标轴网格线的配置项,null 表示不展示。
|
2007 | */
|
2008 | grid?: AxisGridCfg | null;
|
2009 | /**
|
2010 | * @title 动画
|
2011 | * @default true
|
2012 | */
|
2013 | animate?: boolean;
|
2014 | /**
|
2015 | * @title 动画参数
|
2016 | */
|
2017 | animateOption?: ComponentAnimateOption;
|
2018 | /**
|
2019 | * @title 坐标轴 label 的方向
|
2020 | * @description 标记坐标轴 label 的方向,左侧为 1,右侧为 -1。
|
2021 | */
|
2022 | verticalFactor?: number;
|
2023 | /**
|
2024 | * @title 坐标轴垂直方向的最大限制长度
|
2025 | * @description
|
2026 | * 配置坐标轴垂直方向的最大限制长度,对文本自适应有很大影响。
|
2027 | * 1. 可以直接设置像素值,如 100;
|
2028 | * 2. 也可设置绝对值,如 0.2,如果是 x 轴,则相对于图表的高度,如果是 y 轴,则相对于图表的宽度
|
2029 | *
|
2030 | * 在 G2 中,x 轴的文本默认最大高度为图表高度的 1/2,y 轴的文本默认最大长度为图表宽度的 1/3
|
2031 | */
|
2032 | verticalLimitLength?: number;
|
2033 | }
|
2034 | export interface SliderCfg {
|
2035 | /**
|
2036 | * @title slider 高度
|
2037 | */
|
2038 | readonly height?: number;
|
2039 | /**
|
2040 | * @title 滑块背景区域配置
|
2041 | */
|
2042 | readonly trendCfg?: Omit<TrendCfg, 'data'> & {
|
2043 | data?: number[];
|
2044 | };
|
2045 | /**
|
2046 | * @title 滑块背景样式
|
2047 | */
|
2048 | readonly backgroundStyle?: any;
|
2049 | /**
|
2050 | * @title 滑块前景样式
|
2051 | */
|
2052 | readonly foregroundStyle?: any;
|
2053 | /**
|
2054 | * @title 滑块两个操作块样式
|
2055 | */
|
2056 | readonly handlerStyle?: any;
|
2057 | /**
|
2058 | * @title 文本样式
|
2059 | */
|
2060 | readonly textStyle?: any;
|
2061 | /**
|
2062 | * @title 允许滑动位置的最小值
|
2063 | */
|
2064 | readonly minLimit?: number;
|
2065 | /**
|
2066 | * @title 允许滑动位置的最大值
|
2067 | */
|
2068 | readonly maxLimit?: number;
|
2069 | /**
|
2070 | * @title 滑块初始化的起始位置
|
2071 | */
|
2072 | readonly start?: number;
|
2073 | /**
|
2074 | * @title 滑块初始化的结束位置
|
2075 | */
|
2076 | readonly end?: number;
|
2077 | /**
|
2078 | * @title 布局的 padding
|
2079 | */
|
2080 | readonly padding?: number[];
|
2081 | /**
|
2082 | * @title 滑块文本格式化函数
|
2083 | */
|
2084 | formatter?: (val: any, datum: Datum, idx: number) => any;
|
2085 | }
|
2086 | /**
|
2087 | * 事件 payload
|
2088 | */
|
2089 | export declare type EventPayload = LooseObject & {
|
2090 | /**
|
2091 | * @title 触发事件的来源
|
2092 | */
|
2093 | source?: string;
|
2094 | };
|
2095 | export declare type EventCallback = (event: LooseObject) => void;
|
2096 | /**
|
2097 | * todo: 事件名可穷举,后续需要补充
|
2098 | * 事件配置项
|
2099 | */
|
2100 | export interface EventCfg {
|
2101 | [key: string]: EventCallback;
|
2102 | }
|
2103 | /**
|
2104 | * 缩略轴的配置项
|
2105 | */
|
2106 | export declare type SliderOption = SliderCfg | boolean;
|
2107 | /**
|
2108 | * @title 滚动条组件配置项
|
2109 | */
|
2110 | export interface ScrollbarCfg {
|
2111 | /**
|
2112 | * @title 滚动条类型,默认 horizontal
|
2113 | */
|
2114 | type?: 'horizontal' | 'vertical';
|
2115 | /**
|
2116 | * @title 宽度,在 vertical 下生效
|
2117 | */
|
2118 | width?: number;
|
2119 | /**
|
2120 | * @title 高度,在 horizontal 下生效
|
2121 | */
|
2122 | height?: number;
|
2123 | /**
|
2124 | * @title 可选 padding
|
2125 | */
|
2126 | padding?: Padding;
|
2127 | /**
|
2128 | * @title 对应水平滚动条,为 X 轴每个分类字段的宽度;对于垂直滚动条,为 X 轴每个分类字段的高度
|
2129 | */
|
2130 | categorySize?: number;
|
2131 | /**
|
2132 | * @title 滚动的时候是否开启动画,默认跟随 view 中 animate 配置
|
2133 | */
|
2134 | animate?: boolean;
|
2135 | /**
|
2136 | * @title 主题样式设置, 暂不提供 hover 高亮滑块样式配置
|
2137 | */
|
2138 | style?: {
|
2139 | /**
|
2140 | * @title 滑道颜色
|
2141 | */
|
2142 | trackColor?: string;
|
2143 | /**
|
2144 | * @title 滑块颜色
|
2145 | */
|
2146 | thumbColor?: string;
|
2147 | /**
|
2148 | * @title 滑块高亮样式,对应主题的 hover.style.thumbColor
|
2149 | */
|
2150 | thumbHighlightColor?: string;
|
2151 | /**
|
2152 | * @title 是否圆角
|
2153 | */
|
2154 | lineCap?: string;
|
2155 | };
|
2156 | }
|
2157 | /**
|
2158 | * @title 滚动条配置
|
2159 | */
|
2160 | export declare type ScrollbarOption = ScrollbarCfg | boolean;
|
2161 | /**
|
2162 | * @title 配置项声明式
|
2163 | */
|
2164 | export interface Options {
|
2165 | /**
|
2166 | * @title 数据源配置。
|
2167 | */
|
2168 | readonly data?: Data;
|
2169 | /**
|
2170 | * @title 设置数据过滤条件,以 data 中的数据属性为 key。
|
2171 | */
|
2172 | readonly filters?: Record<string, FilterCondition>;
|
2173 | /**
|
2174 | * @title 坐标轴配置,以 data 中的数据属性为 key。
|
2175 | */
|
2176 | readonly axes?: Record<string, AxisOption> | boolean;
|
2177 | /**
|
2178 | * @title 图例配置,以 data 中的数据属性为 key。
|
2179 | */
|
2180 | readonly legends?: AllLegendsOptions;
|
2181 | /**
|
2182 | * @title 列定义配置,用于配置数值的类型等,以 data 中的数据属性为 key。
|
2183 | */
|
2184 | readonly scales?: Record<string, ScaleOption>;
|
2185 | /**
|
2186 | * @title Tooltip 配置。
|
2187 | */
|
2188 | readonly tooltip?: TooltipOption;
|
2189 | /**
|
2190 | * @title 坐标系配置。
|
2191 | */
|
2192 | readonly coordinate?: CoordinateOption;
|
2193 | /**
|
2194 | * @title 静态辅助元素声明。
|
2195 | */
|
2196 | readonly annotations?: (ArcOption | RegionFilterOption | ImageOption | LineOption | TextOption | RegionOption | DataMarkerOption | DataRegionOption)[];
|
2197 | /**
|
2198 | * @title Geometry 配置
|
2199 | */
|
2200 | readonly geometries?: GeometryOption[];
|
2201 | /**
|
2202 | * @title 开启/关闭动画,默认开启
|
2203 | */
|
2204 | readonly animate?: boolean;
|
2205 | /**
|
2206 | * @title 配置需要使用的交互行为
|
2207 | */
|
2208 | readonly interactions?: InteractionOption[];
|
2209 | /**
|
2210 | * @title 事件配置
|
2211 | */
|
2212 | readonly events?: EventCfg;
|
2213 | /**
|
2214 | * @title 缩略轴的配置
|
2215 | */
|
2216 | readonly slider?: SliderOption;
|
2217 | /**
|
2218 | * @title 滚动条配置
|
2219 | */
|
2220 | readonly scrollbar?: ScrollbarOption;
|
2221 | /**
|
2222 | * @title 子 View
|
2223 | */
|
2224 | readonly views?: ViewOption[];
|
2225 | /**
|
2226 | * @title 分面
|
2227 | */
|
2228 | readonly facets?: (RectCfg | MirrorCfg | CircleCfg | ListCfg | TreeCfg)[];
|
2229 | /**
|
2230 | * @title 其他自定义的 option
|
2231 | */
|
2232 | readonly [name: string]: any;
|
2233 | }
|
2234 | /**
|
2235 | * @title 支持的 Marker 类型
|
2236 | */
|
2237 | export declare type Marker = 'circle' | 'square' | 'diamond' | 'triangle' | 'triangle-down' | 'hexagon' | 'bowtie' | 'cross' | 'tick' | 'plus' | 'hyphen' | 'line';
|
2238 | /**
|
2239 | * @title 自定义 Marker 的回调函数定义
|
2240 | */
|
2241 | export declare type MarkerCallback = (x: number, y: number, r: number) => PathCommand[];
|
2242 | /**
|
2243 | * @title chart.tooltip() 参数类型
|
2244 | */
|
2245 | export declare type TooltipOption = TooltipCfg | boolean;
|
2246 | export declare type FilterCondition = (value: any, datum: Datum, idx?: number) => boolean;
|
2247 | /**
|
2248 | * @title chart.axis() 参数类型
|
2249 | */
|
2250 | export declare type AxisOption = AxisCfg | boolean;
|
2251 | /**
|
2252 | * @title chart.legend() 参数类型
|
2253 | */
|
2254 | export declare type LegendOption = LegendCfg | boolean;
|
2255 | /**
|
2256 | * @title Options 中 legends 的配置定义
|
2257 | */
|
2258 | export declare type AllLegendsOptions = LegendCfg | Record<string, LegendOption> | boolean;
|
2259 | /**
|
2260 | * @title G2 支持的度量类型
|
2261 | */
|
2262 | export declare type ScaleType = 'linear' | 'cat' | 'category' | 'identity' | 'log' | 'pow' | 'time' | 'timeCat' | 'quantize' | 'quantile';
|
2263 | export declare type CoordinateRotate = ['rotate', number];
|
2264 | export declare type CoordinateReflect = ['reflect', 'x' | 'y'];
|
2265 | export declare type CoordinateScale = ['scale', number, number];
|
2266 | export declare type CoordinateTranspose = ['transpose'];
|
2267 | /**
|
2268 | * @title 坐标系支持的 action 配置
|
2269 | */
|
2270 | export declare type CoordinateActions = CoordinateRotate | CoordinateReflect | CoordinateScale | CoordinateTranspose;
|
2271 | export declare type FacetCtor = new (view: View, cfg: any) => Facet;
|
2272 | export interface Condition {
|
2273 | readonly field: string;
|
2274 | readonly value: any;
|
2275 | readonly values: any[];
|
2276 | }
|
2277 | export declare type FacetDataFilter = (data: Datum[]) => boolean;
|
2278 | /**
|
2279 | * 默认的基础配置
|
2280 | */
|
2281 | export interface FacetCfg<D> {
|
2282 | /**
|
2283 | * @title 布局类型。
|
2284 | */
|
2285 | readonly type?: string;
|
2286 | /**
|
2287 | * @title view 创建回调。
|
2288 | */
|
2289 | readonly eachView: (innerView: View, facet?: D) => any;
|
2290 | /**
|
2291 | * @title 分面 view 之间的间隔, 百分比或像素值
|
2292 | */
|
2293 | readonly spacing?: [number | string, number | string];
|
2294 | /**
|
2295 | * @title facet view padding。
|
2296 | */
|
2297 | readonly padding?: ViewPadding;
|
2298 | /**
|
2299 | * @title 是否显示标题。
|
2300 | */
|
2301 | readonly showTitle?: boolean;
|
2302 | /**
|
2303 | * @title facet 数据划分维度。
|
2304 | */
|
2305 | readonly fields: string[];
|
2306 | }
|
2307 | /**
|
2308 | * Facet title 配置项
|
2309 | */
|
2310 | export interface FacetTitle {
|
2311 | /**
|
2312 | * @title x 方向偏移。
|
2313 | */
|
2314 | readonly offsetX?: number;
|
2315 | /**
|
2316 | * @title y 方向偏移。
|
2317 | */
|
2318 | readonly offsetY?: number;
|
2319 | /**
|
2320 | * @title 文本样式。
|
2321 | */
|
2322 | readonly style?: object;
|
2323 | /**
|
2324 | * @title 格式化
|
2325 | */
|
2326 | readonly formatter?: (val: any) => any;
|
2327 | }
|
2328 | /**
|
2329 | * 分面数据
|
2330 | */
|
2331 | export interface FacetData {
|
2332 | /**
|
2333 | * @title 分面类型。
|
2334 | */
|
2335 | readonly type: string;
|
2336 | /**
|
2337 | * @title 当前分面子 view 的数据。
|
2338 | */
|
2339 | readonly data: object[];
|
2340 | /**
|
2341 | * @title 当前分面子 view 的范围。
|
2342 | */
|
2343 | readonly region: Region;
|
2344 | /**
|
2345 | * @title 当前分面子 view 的 padding。
|
2346 | */
|
2347 | readonly padding?: number;
|
2348 | /**
|
2349 | * @title 当前 facet 对应生成的 view。
|
2350 | */
|
2351 | view?: View;
|
2352 | /**
|
2353 | * @title 分面行字段。
|
2354 | */
|
2355 | readonly rowField: string;
|
2356 | /**
|
2357 | * @title 分面列字段。
|
2358 | */
|
2359 | readonly columnField: string;
|
2360 | /**
|
2361 | * @title 当前行分面的枚举值。
|
2362 | */
|
2363 | readonly rowValue: string;
|
2364 | /**
|
2365 | * @title 当前列分面的枚举值。
|
2366 | */
|
2367 | readonly columnValue: string;
|
2368 | /**
|
2369 | * @title 当前行索引。
|
2370 | */
|
2371 | readonly rowIndex: number;
|
2372 | /**
|
2373 | * @title 当前列索引。
|
2374 | */
|
2375 | readonly columnIndex: number;
|
2376 | /**
|
2377 | * @title 当前行字段的枚举值长度。
|
2378 | */
|
2379 | readonly rowValuesLength: number;
|
2380 | /**
|
2381 | * @title 当前列字段的枚举值长度。
|
2382 | */
|
2383 | readonly columnValuesLength: number;
|
2384 | }
|
2385 | /**
|
2386 | * @title rect 分面类型配置
|
2387 | */
|
2388 | export interface RectCfg extends FacetCfg<RectData> {
|
2389 | /**
|
2390 | * @title 行标题的样式。
|
2391 | */
|
2392 | readonly columnTitle?: FacetTitle;
|
2393 | /**
|
2394 | * @title 列标题的样式。
|
2395 | */
|
2396 | readonly rowTitle?: FacetTitle;
|
2397 | }
|
2398 | export declare type RectData = FacetData;
|
2399 | /**
|
2400 | * @title mirror 分面类型配置
|
2401 | */
|
2402 | export interface MirrorCfg extends FacetCfg<MirrorData> {
|
2403 | /**
|
2404 | * @title 是否转置。
|
2405 | */
|
2406 | readonly transpose?: boolean;
|
2407 | /**
|
2408 | * @title 标题样式。
|
2409 | */
|
2410 | readonly title?: FacetTitle;
|
2411 | }
|
2412 | export declare type MirrorData = FacetData;
|
2413 | /**
|
2414 | * @title list 分面类型配置
|
2415 | */
|
2416 | export interface ListCfg extends FacetCfg<ListData> {
|
2417 | /**
|
2418 | * @title 指定每行可显示分面的个数,超出时会自动换行。
|
2419 | */
|
2420 | readonly cols?: number;
|
2421 | /**
|
2422 | * @title 每个分面标题配置。
|
2423 | */
|
2424 | readonly title?: FacetTitle;
|
2425 | }
|
2426 | export interface ListData extends FacetData {
|
2427 | readonly total?: number;
|
2428 | }
|
2429 | /**
|
2430 | * @title matrix 分面类型配置
|
2431 | */
|
2432 | export interface MatrixCfg extends FacetCfg<MirrorData> {
|
2433 | /**
|
2434 | * @title 列标题的样式
|
2435 | */
|
2436 | readonly columnTitle?: FacetTitle;
|
2437 | /**
|
2438 | * @title 列标题的样式
|
2439 | */
|
2440 | readonly rowTitle?: FacetTitle;
|
2441 | }
|
2442 | export declare type MatrixData = FacetData;
|
2443 | /**
|
2444 | * @title circle 分面类型配置
|
2445 | */
|
2446 | export interface CircleCfg extends FacetCfg<CircleData> {
|
2447 | /**
|
2448 | * @title 分面标题配置。
|
2449 | */
|
2450 | readonly title?: FacetTitle;
|
2451 | }
|
2452 | export declare type CircleData = FacetData;
|
2453 | export interface Line {
|
2454 | readonly style?: ShapeAttrs;
|
2455 | readonly smooth?: boolean;
|
2456 | }
|
2457 | /**
|
2458 | * @title tree 分面类型配置
|
2459 | */
|
2460 | export interface TreeCfg extends FacetCfg<TreeData> {
|
2461 | readonly line?: Line;
|
2462 | readonly title?: FacetTitle;
|
2463 | }
|
2464 | export interface TreeData extends FacetData {
|
2465 | children?: TreeData[];
|
2466 | originColIndex?: number;
|
2467 | }
|
2468 | /**
|
2469 | * facet object map
|
2470 | */
|
2471 | export interface FacetCfgMap {
|
2472 | /**
|
2473 | * @title rect 类型分面配置
|
2474 | */
|
2475 | readonly rect: RectCfg;
|
2476 | /**
|
2477 | * @title mirror 类型分面配置
|
2478 | */
|
2479 | readonly mirror: MirrorCfg;
|
2480 | /**
|
2481 | * @title list 类型分面配置
|
2482 | */
|
2483 | readonly list: ListCfg;
|
2484 | /**
|
2485 | * @title matrix 类型分面配置
|
2486 | */
|
2487 | readonly matrix: MatrixCfg;
|
2488 | /**
|
2489 | * @title circle 类型分面配置
|
2490 | */
|
2491 | readonly circle: CircleCfg;
|
2492 | /**
|
2493 | * @title tree 类型分面配置
|
2494 | */
|
2495 | readonly tree: TreeCfg;
|
2496 | }
|
2497 | export interface StyleSheet {
|
2498 | /**
|
2499 | * @title 背景色
|
2500 | */
|
2501 | backgroundColor?: string;
|
2502 | /**
|
2503 | * @title 主题色
|
2504 | */
|
2505 | brandColor?: string;
|
2506 | /**
|
2507 | * @title 辅助色
|
2508 | */
|
2509 | subColor?: string;
|
2510 | /**
|
2511 | * @title 分类色板 1,在数据量小于等于 10 时使用
|
2512 | */
|
2513 | paletteQualitative10?: string[];
|
2514 | /**
|
2515 | * @title 分类色板 2,在数据量大于 10 时使用
|
2516 | */
|
2517 | paletteQualitative20?: string[];
|
2518 | /**
|
2519 | * @title 语义色
|
2520 | */
|
2521 | paletteSemanticRed?: string;
|
2522 | /**
|
2523 | * @title 语义色
|
2524 | */
|
2525 | paletteSemanticGreen?: string;
|
2526 | /**
|
2527 | * @title 语义色
|
2528 | */
|
2529 | paletteSemanticYellow?: string;
|
2530 | /**
|
2531 | * @title (单色)顺序色板
|
2532 | */
|
2533 | paletteSequence?: string[];
|
2534 | /**
|
2535 | * @title 字体
|
2536 | */
|
2537 | fontFamily?: string;
|
2538 | /**
|
2539 | * @title 坐标轴线颜色
|
2540 | */
|
2541 | axisLineBorderColor?: string;
|
2542 | /**
|
2543 | * @title 坐标轴线粗细
|
2544 | */
|
2545 | axisLineBorder?: number;
|
2546 | /**
|
2547 | * @title 坐标轴线 lineDash 设置
|
2548 | */
|
2549 | axisLineDash?: number[];
|
2550 | /**
|
2551 | * @title 坐标轴标题颜色
|
2552 | */
|
2553 | axisTitleTextFillColor?: string;
|
2554 | /**
|
2555 | * @title 坐标轴标题文本字体大小
|
2556 | */
|
2557 | axisTitleTextFontSize?: number;
|
2558 | /**
|
2559 | * @title 坐标轴标题文本行高
|
2560 | */
|
2561 | axisTitleTextLineHeight?: number;
|
2562 | /**
|
2563 | * @title 坐标轴标题文本字体粗细
|
2564 | */
|
2565 | axisTitleTextFontWeight?: number | string;
|
2566 | /**
|
2567 | * @title 坐标轴标题距离坐标轴文本的间距
|
2568 | */
|
2569 | axisTitleSpacing?: number;
|
2570 | /**
|
2571 | * @title 坐标轴详细说明icon颜色
|
2572 | */
|
2573 | axisDescriptionIconFillColor?: string;
|
2574 | /**
|
2575 | * @title 坐标轴刻度线颜色
|
2576 | */
|
2577 | axisTickLineBorderColor?: string;
|
2578 | /**
|
2579 | * @title 坐标轴刻度线长度
|
2580 | */
|
2581 | axisTickLineLength?: number;
|
2582 | /**
|
2583 | * @title 坐标轴刻度线粗细
|
2584 | */
|
2585 | axisTickLineBorder?: number;
|
2586 | /**
|
2587 | * @title 坐标轴次刻度线颜色
|
2588 | */
|
2589 | axisSubTickLineBorderColor?: string;
|
2590 | /**
|
2591 | * @title 坐标轴次刻度线长度
|
2592 | */
|
2593 | axisSubTickLineLength?: number;
|
2594 | /**
|
2595 | * @title 坐标轴次刻度线粗细
|
2596 | */
|
2597 | axisSubTickLineBorder?: number;
|
2598 | /**
|
2599 | * @title 坐标轴刻度文本颜色
|
2600 | */
|
2601 | axisLabelFillColor?: string;
|
2602 | /**
|
2603 | * @title 坐标轴刻度文本字体大小
|
2604 | */
|
2605 | axisLabelFontSize?: number;
|
2606 | /**
|
2607 | * @title 坐标轴刻度文本行高
|
2608 | */
|
2609 | axisLabelLineHeight?: number;
|
2610 | /**
|
2611 | * @title 坐标轴刻度文本字体粗细
|
2612 | */
|
2613 | axisLabelFontWeight?: number | string;
|
2614 | /**
|
2615 | * @title 坐标轴刻度文本距离坐标轴线的间距
|
2616 | */
|
2617 | axisLabelOffset: number;
|
2618 | /**
|
2619 | * @title 坐标轴网格线颜色
|
2620 | */
|
2621 | axisGridBorderColor?: string;
|
2622 | /**
|
2623 | * @title 坐标轴网格线粗细
|
2624 | */
|
2625 | axisGridBorder?: number;
|
2626 | /**
|
2627 | * @title 坐标轴网格线虚线设置
|
2628 | */
|
2629 | axisGridLineDash?: number[];
|
2630 | /**
|
2631 | * @title 图例标题颜色
|
2632 | */
|
2633 | legendTitleTextFillColor?: string;
|
2634 | /**
|
2635 | * @title 图例标题文本字体大小
|
2636 | */
|
2637 | legendTitleTextFontSize?: number;
|
2638 | /**
|
2639 | * @title 图例标题文本行高
|
2640 | */
|
2641 | legendTitleTextLineHeight?: number;
|
2642 | /**
|
2643 | * @title 图例标题文本字体粗细
|
2644 | */
|
2645 | legendTitleTextFontWeight?: number | string;
|
2646 | /**
|
2647 | * @title 图例 marker 颜色
|
2648 | */
|
2649 | legendMarkerColor?: string;
|
2650 | /**
|
2651 | * @title 图例 marker 距离图例文本的间距
|
2652 | */
|
2653 | legendMarkerSpacing?: number;
|
2654 | /**
|
2655 | * @title 图例 marker 默认半径大小
|
2656 | */
|
2657 | legendMarkerSize?: number;
|
2658 | /**
|
2659 | * @title 图例 'circle' marker 半径
|
2660 | */
|
2661 | legendCircleMarkerSize?: number;
|
2662 | /**
|
2663 | * @title 图例 'square' marker 半径
|
2664 | */
|
2665 | legendSquareMarkerSize?: number;
|
2666 | /**
|
2667 | * @title 图例 'line' marker 半径
|
2668 | */
|
2669 | legendLineMarkerSize?: number;
|
2670 | /**
|
2671 | * @title 图例项文本颜色
|
2672 | */
|
2673 | legendItemNameFillColor?: string;
|
2674 | /**
|
2675 | * @title 图例项文本字体大小
|
2676 | */
|
2677 | legendItemNameFontSize?: number;
|
2678 | /**
|
2679 | * @title 图例项文本行高
|
2680 | */
|
2681 | legendItemNameLineHeight?: number;
|
2682 | /**
|
2683 | * @title 图例项粗细
|
2684 | */
|
2685 | legendItemNameFontWeight?: number | string;
|
2686 | /**
|
2687 | * @title 图例项之间的水平间距
|
2688 | */
|
2689 | legendItemSpacing?: number;
|
2690 | /**
|
2691 | * @title 图例项垂直方向的间隔
|
2692 | */
|
2693 | legendItemMarginBottom?: number;
|
2694 | /**
|
2695 | * @title 图例与图表绘图区域的偏移距离
|
2696 | */
|
2697 | legendPadding?: number[];
|
2698 | /**
|
2699 | * @title 水平布局的图例与绘图区域偏移距离
|
2700 | */
|
2701 | legendHorizontalPadding?: number[];
|
2702 | /**
|
2703 | * @title 垂直布局的图例与绘图区域偏移距离
|
2704 | */
|
2705 | legendVerticalPadding?: number[];
|
2706 | /**
|
2707 | * @title 图例分页器 marker 大小
|
2708 | */
|
2709 | legendPageNavigatorMarkerSize: number;
|
2710 | /**
|
2711 | * @title 图例分页器 marker 非激活状态填充色
|
2712 | */
|
2713 | legendPageNavigatorMarkerInactiveFillColor: string;
|
2714 | /**
|
2715 | * @title 图例分页器 marker 非激活状态填充色透明度
|
2716 | */
|
2717 | legendPageNavigatorMarkerInactiveFillOpacity: number;
|
2718 | /**
|
2719 | * @title 图例分页器 marker 填充色
|
2720 | */
|
2721 | legendPageNavigatorMarkerFillColor: string;
|
2722 | /**
|
2723 | * @title 图例分页器 marker 填充色透明度
|
2724 | */
|
2725 | legendPageNavigatorMarkerFillOpacity: number;
|
2726 | /**
|
2727 | * @title 图例分页器文本颜色
|
2728 | */
|
2729 | legendPageNavigatorTextFillColor: string;
|
2730 | /**
|
2731 | * @title 图例分页器文本字体大小
|
2732 | */
|
2733 | legendPageNavigatorTextFontSize: number;
|
2734 | /**
|
2735 | * @title 连续图例滑块填充色
|
2736 | */
|
2737 | sliderRailFillColor?: string;
|
2738 | /**
|
2739 | * @title 连续图例滑块边框粗细
|
2740 | */
|
2741 | sliderRailBorder?: number;
|
2742 | /**
|
2743 | * @title 连续图例滑块边框颜色
|
2744 | */
|
2745 | sliderRailBorderColor?: string;
|
2746 | /**
|
2747 | * @title 连续图例滑块宽度
|
2748 | */
|
2749 | sliderRailWidth?: number;
|
2750 | /**
|
2751 | * @title 连续图例滑块高度
|
2752 | */
|
2753 | sliderRailHeight?: number;
|
2754 | /**
|
2755 | * @title 连续图例文本颜色
|
2756 | */
|
2757 | sliderLabelTextFillColor?: string;
|
2758 | /**
|
2759 | * @title 连续图例文本字体大小
|
2760 | */
|
2761 | sliderLabelTextFontSize?: number;
|
2762 | /**
|
2763 | * @title 连续图例文本行高
|
2764 | */
|
2765 | sliderLabelTextLineHeight?: number;
|
2766 | /**
|
2767 | * @title 连续图例文本字体粗细
|
2768 | */
|
2769 | sliderLabelTextFontWeight?: number | string;
|
2770 | /**
|
2771 | * @title 连续图例滑块颜色
|
2772 | */
|
2773 | sliderHandlerFillColor?: string;
|
2774 | /**
|
2775 | * @title 连续图例滑块宽度
|
2776 | */
|
2777 | sliderHandlerWidth?: number;
|
2778 | /**
|
2779 | * @title 连续图例滑块高度
|
2780 | */
|
2781 | sliderHandlerHeight?: number;
|
2782 | /**
|
2783 | * @title 连续图例滑块边框粗细
|
2784 | */
|
2785 | sliderHandlerBorder?: number;
|
2786 | /**
|
2787 | * @title 连续图例滑块边框颜色
|
2788 | */
|
2789 | sliderHandlerBorderColor?: string;
|
2790 | /**
|
2791 | * @title arc 图形标注描边颜色
|
2792 | */
|
2793 | annotationArcBorderColor?: string;
|
2794 | /**
|
2795 | * @title arc 图形标注粗细
|
2796 | */
|
2797 | annotationArcBorder?: number;
|
2798 | /**
|
2799 | * @title line 图形标注颜色
|
2800 | */
|
2801 | annotationLineBorderColor?: string;
|
2802 | /**
|
2803 | * @title line 图形标注粗细
|
2804 | */
|
2805 | annotationLineBorder?: number;
|
2806 | /**
|
2807 | * @title lube 图形标注的虚线间隔
|
2808 | */
|
2809 | annotationLineDash?: number[];
|
2810 | /**
|
2811 | * @title text 图形标注文本颜色
|
2812 | */
|
2813 | annotationTextFillColor?: string;
|
2814 | /**
|
2815 | * @title text 图形标注文本字体大小
|
2816 | */
|
2817 | annotationTextFontSize?: number;
|
2818 | /**
|
2819 | * @title text 图形标注文本行高
|
2820 | */
|
2821 | annotationTextLineHeight?: number;
|
2822 | /**
|
2823 | * @title text 图形标注文本字体粗细
|
2824 | */
|
2825 | annotationTextFontWeight?: number | string;
|
2826 | /**
|
2827 | * @title text 图形标注文本边框颜色
|
2828 | */
|
2829 | annotationTextBorderColor?: string;
|
2830 | /**
|
2831 | * @title text 图形标注文本边框粗细
|
2832 | */
|
2833 | annotationTextBorder?: number;
|
2834 | /**
|
2835 | * @title region 图形标注填充颜色
|
2836 | */
|
2837 | annotationRegionFillColor?: string;
|
2838 | /**
|
2839 | * @title region 图形标注填充颜色透明色
|
2840 | */
|
2841 | annotationRegionFillOpacity?: number;
|
2842 | /**
|
2843 | * @title region 图形标注描边粗细
|
2844 | */
|
2845 | annotationRegionBorder?: number;
|
2846 | /**
|
2847 | * @title region 图形标注描边颜色
|
2848 | */
|
2849 | annotationRegionBorderColor?: string;
|
2850 | /**
|
2851 | * @title dataMarker 图形标注的连接线长度
|
2852 | */
|
2853 | annotationDataMarkerLineLength?: number;
|
2854 | /**
|
2855 | * @title tooltip crosshairs 辅助线颜色
|
2856 | */
|
2857 | tooltipCrosshairsBorderColor?: string;
|
2858 | /**
|
2859 | * @title tooltip crosshairs 辅助线粗细
|
2860 | */
|
2861 | tooltipCrosshairsBorder?: number;
|
2862 | /**
|
2863 | * @title tooltip crosshairs 辅助线虚线间隔
|
2864 | */
|
2865 | tooltipCrosshairsLineDash?: number[];
|
2866 | /**
|
2867 | * @title tooltip 内容框背景色
|
2868 | */
|
2869 | tooltipContainerFillColor?: string;
|
2870 | /**
|
2871 | * @title tooltip 内容框背景透明度
|
2872 | */
|
2873 | tooltipContainerFillOpacity?: number;
|
2874 | /**
|
2875 | * @title tooltip 内容框阴影
|
2876 | */
|
2877 | tooltipContainerShadow?: string;
|
2878 | /**
|
2879 | * @title tooltip 内容框圆角
|
2880 | */
|
2881 | tooltipContainerBorderRadius?: number;
|
2882 | /**
|
2883 | * @title tooltip 文本颜色
|
2884 | */
|
2885 | tooltipTextFillColor?: string;
|
2886 | /**
|
2887 | * @title tooltip 文本字体大小
|
2888 | */
|
2889 | tooltipTextFontSize?: number;
|
2890 | /**
|
2891 | * @title tooltip 文本行高
|
2892 | */
|
2893 | tooltipTextLineHeight?: number;
|
2894 | /**
|
2895 | * @title tooltip 文本字体粗细
|
2896 | */
|
2897 | tooltipTextFontWeight?: number | string;
|
2898 | /**
|
2899 | * @title Geometry label 文本颜色
|
2900 | */
|
2901 | labelFillColor?: string;
|
2902 | /**
|
2903 | * @title Geometry label 暗色文本颜色
|
2904 | */
|
2905 | labelFillColorDark?: string;
|
2906 | /**
|
2907 | * @title Geometry label 亮色文本颜色
|
2908 | */
|
2909 | labelFillColorLight?: string;
|
2910 | /**
|
2911 | * @title Geometry label 文本字体大小
|
2912 | */
|
2913 | labelFontSize?: number;
|
2914 | /**
|
2915 | * @title Geometry label 文本行高
|
2916 | */
|
2917 | labelLineHeight?: number;
|
2918 | /**
|
2919 | * @title Geometry label 文本字体粗细
|
2920 | */
|
2921 | labelFontWeight?: number | string;
|
2922 | /**
|
2923 | * @title Geometry label 文本描边颜色
|
2924 | */
|
2925 | labelBorderColor?: string;
|
2926 | /**
|
2927 | * @title Geometry label 文本描边粗细
|
2928 | */
|
2929 | labelBorder?: number;
|
2930 | /**
|
2931 | * @title Geometry innerLabel 文本颜色
|
2932 | */
|
2933 | innerLabelFillColor?: string;
|
2934 | /**
|
2935 | * @title Geometry innerLabel 文本字体大小
|
2936 | */
|
2937 | innerLabelFontSize?: number;
|
2938 | /**
|
2939 | * @title Geometry innerLabel 文本行高
|
2940 | */
|
2941 | innerLabelLineHeight?: number;
|
2942 | /**
|
2943 | * @title Geometry innerLabel 文本字体粗细
|
2944 | */
|
2945 | innerLabelFontWeight?: number | string;
|
2946 | /**
|
2947 | * @title Geometry innerLabel 文本描边颜色
|
2948 | */
|
2949 | innerLabelBorderColor?: string;
|
2950 | /**
|
2951 | * @title Geometry innerLabel 文本描边粗细
|
2952 | */
|
2953 | innerLabelBorder?: number;
|
2954 | /**
|
2955 | * @title Geometry overflowLabel 文本颜色
|
2956 | */
|
2957 | overflowLabelFillColor?: string;
|
2958 | /**
|
2959 | * @title Geometry overflowLabel 暗色文本颜色
|
2960 | */
|
2961 | overflowLabelFillColorDark?: string;
|
2962 | /**
|
2963 | * @title Geometry overflowLabel 亮色文本颜色
|
2964 | */
|
2965 | overflowLabelFillColorLight?: string;
|
2966 | /**
|
2967 | * @title Geometry overflowLabel 文本字体大小
|
2968 | */
|
2969 | overflowLabelFontSize?: number;
|
2970 | /**
|
2971 | * @title Geometry overflowLabel 文本行高
|
2972 | */
|
2973 | overflowLabelLineHeight?: number;
|
2974 | /**
|
2975 | * @title Geometry overflowLabel 文本字体粗细
|
2976 | */
|
2977 | overflowLabelFontWeight?: number | string;
|
2978 | /**
|
2979 | * @title Geometry overflowLabel 文本描边颜色
|
2980 | */
|
2981 | overflowLabelBorderColor?: string;
|
2982 | /**
|
2983 | * @title Geometry overflowLabel 文本描边粗细
|
2984 | */
|
2985 | overflowLabelBorder?: number;
|
2986 | /**
|
2987 | * @title Geometry label 文本连接线粗细
|
2988 | */
|
2989 | labelLineBorder?: number;
|
2990 | /**
|
2991 | * @title Geometry label 文本连接线颜色
|
2992 | */
|
2993 | labelLineBorderColor?: string;
|
2994 | /**
|
2995 | * @title slider 滑道高度
|
2996 | */
|
2997 | cSliderRailHieght?: number;
|
2998 | /**
|
2999 | * @title slider 滑道背景色
|
3000 | */
|
3001 | cSliderBackgroundFillColor?: string;
|
3002 | /**
|
3003 | * @title slider 滑道背景色透明度
|
3004 | */
|
3005 | cSliderBackgroundFillOpacity?: number;
|
3006 | /**
|
3007 | * @title slider 滑道前景色
|
3008 | */
|
3009 | cSliderForegroundFillColor?: string;
|
3010 | /**
|
3011 | * @title slider 滑道前景色透明度
|
3012 | */
|
3013 | cSliderForegroundFillOpacity?: number;
|
3014 | /**
|
3015 | * @title slider 手柄高度
|
3016 | */
|
3017 | cSliderHandlerHeight?: number;
|
3018 | /**
|
3019 | * @title Slider 手柄宽度
|
3020 | */
|
3021 | cSliderHandlerWidth?: number;
|
3022 | /**
|
3023 | * @title Slider 手柄背景色
|
3024 | */
|
3025 | cSliderHandlerFillColor?: string;
|
3026 | /**
|
3027 | * @title Slider 手柄背景色透明度
|
3028 | */
|
3029 | cSliderHandlerFillOpacity?: number;
|
3030 | /**
|
3031 | * @title Slider 手柄高亮背景色
|
3032 | */
|
3033 | cSliderHandlerHighlightFillColor?: string;
|
3034 | /**
|
3035 | * @title Slider 手柄边框色
|
3036 | */
|
3037 | cSliderHandlerBorderColor?: string;
|
3038 | /**
|
3039 | * @title Slider 手柄边框粗细
|
3040 | */
|
3041 | cSliderHandlerBorder?: number;
|
3042 | /**
|
3043 | * @title Slider 手柄边框圆角
|
3044 | */
|
3045 | cSliderHandlerBorderRadius?: number;
|
3046 | /**
|
3047 | * @title Slider 字体标签颜色
|
3048 | */
|
3049 | cSliderTextFillColor?: string;
|
3050 | /**
|
3051 | * @title Slider 字体标签透明度
|
3052 | */
|
3053 | cSliderTextFillOpacity?: number;
|
3054 | /**
|
3055 | * @title Slider 字体标签大小
|
3056 | */
|
3057 | cSliderTextFontSize?: number;
|
3058 | /**
|
3059 | * @title Slider 字体标签行高
|
3060 | */
|
3061 | cSliderTextLineHeight?: number;
|
3062 | /**
|
3063 | * @title Slider 字体标签字重
|
3064 | */
|
3065 | cSliderTextFontWeight?: number | string;
|
3066 | /**
|
3067 | * @title Slider 字体标签描边色
|
3068 | */
|
3069 | cSliderTextBorderColor?: string;
|
3070 | /**
|
3071 | * @title Slider 字体标签描边粗细
|
3072 | */
|
3073 | cSliderTextBorder?: number;
|
3074 | /**
|
3075 | * @title 滚动条 滚道填充色
|
3076 | */
|
3077 | scrollbarTrackFillColor?: string;
|
3078 | /**
|
3079 | * @title 滚动条 滑块填充色
|
3080 | */
|
3081 | scrollbarThumbFillColor?: string;
|
3082 | /**
|
3083 | * @title 滚动条 滑块高亮填充色
|
3084 | */
|
3085 | scrollbarThumbHighlightFillColor?: string;
|
3086 | /**
|
3087 | * @title 点图的大小范围
|
3088 | */
|
3089 | pointSizeRange?: [number, number];
|
3090 | /**
|
3091 | * @title 点图填充颜色
|
3092 | */
|
3093 | pointFillColor?: string;
|
3094 | /**
|
3095 | * @title 点图填充颜色透明度
|
3096 | */
|
3097 | pointFillOpacity?: number;
|
3098 | /**
|
3099 | * @title 点图大小
|
3100 | */
|
3101 | pointSize?: number;
|
3102 | /**
|
3103 | * @title 点图描边粗细
|
3104 | */
|
3105 | pointBorder?: number;
|
3106 | /**
|
3107 | * @title 点图描边颜色
|
3108 | */
|
3109 | pointBorderColor?: string;
|
3110 | /**
|
3111 | * @title 点图描边透明度
|
3112 | */
|
3113 | pointBorderOpacity?: number;
|
3114 | /**
|
3115 | * @title 点图 active 状态下填充颜色
|
3116 | */
|
3117 | pointActiveFillColor?: string;
|
3118 | /**
|
3119 | * @title 点图 active 状态下填充颜色透明度
|
3120 | */
|
3121 | pointActiveFillOpacity?: number;
|
3122 | /**
|
3123 | * @title 点图 active 状态下大小
|
3124 | */
|
3125 | pointActiveSize?: number;
|
3126 | /**
|
3127 | * @title 点图 active 状态下描边粗细
|
3128 | */
|
3129 | pointActiveBorder?: number;
|
3130 | /**
|
3131 | * @title 点图 active 状态下描边颜色
|
3132 | */
|
3133 | pointActiveBorderColor?: string;
|
3134 | /**
|
3135 | * @title 点图 active 状态下描边透明度
|
3136 | */
|
3137 | pointActiveBorderOpacity?: number;
|
3138 | /**
|
3139 | * @title 点图 selected 状态下填充颜色
|
3140 | */
|
3141 | pointSelectedFillColor?: string;
|
3142 | /**
|
3143 | * @title 点图 selected 状态下填充颜色透明度
|
3144 | */
|
3145 | pointSelectedFillOpacity?: number;
|
3146 | /**
|
3147 | * @title 点图 selected 状态下大小
|
3148 | */
|
3149 | pointSelectedSize?: number;
|
3150 | /**
|
3151 | * @title 点图 selected 状态下描边粗细
|
3152 | */
|
3153 | pointSelectedBorder?: number;
|
3154 | /**
|
3155 | * @title 点图 selected 状态下描边颜色
|
3156 | */
|
3157 | pointSelectedBorderColor?: string;
|
3158 | /**
|
3159 | * @title 点图 selected 状态下描边透明度
|
3160 | */
|
3161 | pointSelectedBorderOpacity?: number;
|
3162 | /**
|
3163 | * @title 点图 inactive 状态下填充颜色
|
3164 | */
|
3165 | pointInactiveFillColor?: string;
|
3166 | /**
|
3167 | * @title 点图 inactive 状态下填充颜色透明度
|
3168 | */
|
3169 | pointInactiveFillOpacity?: number;
|
3170 | /**
|
3171 | * @title 点图 inactive 状态下大小
|
3172 | */
|
3173 | pointInactiveSize?: number;
|
3174 | /**
|
3175 | * @title 点图 inactive 状态下描边粗细
|
3176 | */
|
3177 | pointInactiveBorder?: number;
|
3178 | /**
|
3179 | * @title 点图 inactive 状态下描边颜色
|
3180 | */
|
3181 | pointInactiveBorderColor?: string;
|
3182 | /**
|
3183 | * @title 点图 inactive 状态下描边透明度
|
3184 | */
|
3185 | pointInactiveBorderOpacity?: number;
|
3186 | /**
|
3187 | * @title 描边点图大小
|
3188 | */
|
3189 | hollowPointSize?: number;
|
3190 | /**
|
3191 | * @title 描边点图描边粗细
|
3192 | */
|
3193 | hollowPointBorder?: number;
|
3194 | /**
|
3195 | * @title 描边点图描边颜色
|
3196 | */
|
3197 | hollowPointBorderColor?: string;
|
3198 | /**
|
3199 | * @title 描边点图描边透明度
|
3200 | */
|
3201 | hollowPointBorderOpacity?: number;
|
3202 | /**
|
3203 | * @title 描边点图填充颜色
|
3204 | */
|
3205 | hollowPointFillColor?: string;
|
3206 | /**
|
3207 | * @title 描边点图填充透明度
|
3208 | */
|
3209 | hollowPointFillOpacity?: number;
|
3210 | /**
|
3211 | * @title 点 描边 active 状态下大小
|
3212 | */
|
3213 | hollowPointActiveSize?: number;
|
3214 | /**
|
3215 | * @title 点 描边 active 状态下描边粗细
|
3216 | */
|
3217 | hollowPointActiveBorder?: number;
|
3218 | /**
|
3219 | * @title 点 描边 active 状态下描边颜色
|
3220 | */
|
3221 | hollowPointActiveBorderColor?: string;
|
3222 | /**
|
3223 | * @title 点 描边 active 状态下描边透明度
|
3224 | */
|
3225 | hollowPointActiveBorderOpacity?: number;
|
3226 | /**
|
3227 | * @title 点 描边 selected 状态下大小
|
3228 | */
|
3229 | hollowPointSelectedSize?: number;
|
3230 | /**
|
3231 | * @title 点 描边 selected 状态下描边粗细
|
3232 | */
|
3233 | hollowPointSelectedBorder?: number;
|
3234 | /**
|
3235 | * @title 点 描边 selected 状态下描边颜色
|
3236 | */
|
3237 | hollowPointSelectedBorderColor?: string;
|
3238 | /**
|
3239 | * @title 点 描边 selected 状态下描边透明度
|
3240 | */
|
3241 | hollowPointSelectedBorderOpacity?: number;
|
3242 | /**
|
3243 | * @title 点 描边 inactive 状态下大小
|
3244 | */
|
3245 | hollowPointInactiveSize?: number;
|
3246 | /**
|
3247 | * @title 点 描边 inactive 状态下描边粗细
|
3248 | */
|
3249 | hollowPointInactiveBorder?: number;
|
3250 | /**
|
3251 | * @title 点 描边 inactive 状态下描边颜色
|
3252 | */
|
3253 | hollowPointInactiveBorderColor?: string;
|
3254 | /**
|
3255 | * @title 点 描边 inactive 状态下描边透明度
|
3256 | */
|
3257 | hollowPointInactiveBorderOpacity?: number;
|
3258 | /**
|
3259 | * @title 线图粗细
|
3260 | */
|
3261 | lineBorder?: number;
|
3262 | /**
|
3263 | * @title 线图颜色
|
3264 | */
|
3265 | lineBorderColor?: string;
|
3266 | /**
|
3267 | * @title 线图透明度
|
3268 | */
|
3269 | lineBorderOpacity?: number;
|
3270 | /**
|
3271 | * @title 线图 active 状态下粗细
|
3272 | */
|
3273 | lineActiveBorder?: number;
|
3274 | /**
|
3275 | * @title 线图 active 状态下颜色
|
3276 | */
|
3277 | lineActiveBorderColor?: string;
|
3278 | /**
|
3279 | * @title 线图 active 状态下透明度
|
3280 | */
|
3281 | lineActiveBorderOpacity?: number;
|
3282 | /**
|
3283 | * @title 线图 selected 状态下粗细
|
3284 | */
|
3285 | lineSelectedBorder?: number;
|
3286 | /**
|
3287 | * @title 线图 selected 状态下颜色
|
3288 | */
|
3289 | lineSelectedBorderColor?: string;
|
3290 | /**
|
3291 | * @title 线图 selected 状态下透明度
|
3292 | */
|
3293 | lineSelectedBorderOpacity?: number;
|
3294 | /**
|
3295 | * @title 线图 inactive 状态下粗细
|
3296 | */
|
3297 | lineInactiveBorder?: number;
|
3298 | /**
|
3299 | * @title 线图 inactive 状态下颜色
|
3300 | */
|
3301 | lineInactiveBorderColor?: string;
|
3302 | /**
|
3303 | * @title 线图 inactive 状态下透明度
|
3304 | */
|
3305 | lineInactiveBorderOpacity?: number;
|
3306 | areaBorder?: number;
|
3307 | /**
|
3308 | * @title area 边框颜色
|
3309 | */
|
3310 | areaBorderColor?: string;
|
3311 | /**
|
3312 | * @title area 边框透明度
|
3313 | */
|
3314 | areaBorderOpacity?: number;
|
3315 | /**
|
3316 | * @title area 填充颜色
|
3317 | */
|
3318 | areaFillColor?: string;
|
3319 | /**
|
3320 | * @title area 填充透明度
|
3321 | */
|
3322 | areaFillOpacity?: number;
|
3323 | /**
|
3324 | * @title area Active 状态下边框粗细
|
3325 | */
|
3326 | areaActiveBorder?: number;
|
3327 | /**
|
3328 | * @title area Active 状态下边框颜色
|
3329 | */
|
3330 | areaActiveBorderColor?: string;
|
3331 | /**
|
3332 | * @title area Active 状态下边框透明度
|
3333 | */
|
3334 | areaActiveBorderOpacity?: number;
|
3335 | /**
|
3336 | * @title area Active 状态下填充颜色
|
3337 | */
|
3338 | areaActiveFillColor?: string;
|
3339 | /**
|
3340 | * @title area Active 状态下填充透明度
|
3341 | */
|
3342 | areaActiveFillOpacity?: number;
|
3343 | /**
|
3344 | * @title area selected 状态下边框粗细
|
3345 | */
|
3346 | areaSelectedBorder?: number;
|
3347 | /**
|
3348 | * @title area selected 状态下边框颜色
|
3349 | */
|
3350 | areaSelectedBorderColor?: string;
|
3351 | /**
|
3352 | * @title area selected 状态下边框透明度
|
3353 | */
|
3354 | areaSelectedBorderOpacity?: number;
|
3355 | /**
|
3356 | * @title area selected 状态下填充颜色
|
3357 | */
|
3358 | areaSelectedFillColor?: string;
|
3359 | /**
|
3360 | * @title area selected 状态下填充透明度
|
3361 | */
|
3362 | areaSelectedFillOpacity?: number;
|
3363 | /**
|
3364 | * @title area inactive 状态下边框粗细
|
3365 | */
|
3366 | areaInactiveBorder?: number;
|
3367 | /**
|
3368 | * @title area inactive 状态下边框颜色
|
3369 | */
|
3370 | areaInactiveBorderColor?: string;
|
3371 | /**
|
3372 | * @title area inactive 状态下边框透明度
|
3373 | */
|
3374 | areaInactiveBorderOpacity?: number;
|
3375 | /**
|
3376 | * @title area inactive 状态下填充颜色
|
3377 | */
|
3378 | areaInactiveFillColor?: string;
|
3379 | /**
|
3380 | * @title area inactive 状态下填充透明度
|
3381 | */
|
3382 | areaInactiveFillOpacity?: number;
|
3383 | /**
|
3384 | * @title hollowArea 边框粗细
|
3385 | */
|
3386 | hollowAreaBorder?: number;
|
3387 | /**
|
3388 | * @title hollowArea 边框颜色
|
3389 | */
|
3390 | hollowAreaBorderColor?: string;
|
3391 | /**
|
3392 | * @title hollowArea 边框透明度
|
3393 | */
|
3394 | hollowAreaBorderOpacity?: number;
|
3395 | /**
|
3396 | * @title hollowArea Active 状态下边框粗细
|
3397 | */
|
3398 | hollowAreaActiveBorder?: number;
|
3399 | /**
|
3400 | * @title hollowArea Active 状态下边框颜色
|
3401 | */
|
3402 | hollowAreaActiveBorderColor?: string;
|
3403 | /**
|
3404 | * @title hollowArea Active 状态下边框透明度
|
3405 | */
|
3406 | hollowAreaActiveBorderOpacity?: number;
|
3407 | /**
|
3408 | * @title hollowArea selected 状态下边框粗细
|
3409 | */
|
3410 | hollowAreaSelectedBorder?: number;
|
3411 | /**
|
3412 | * @title hollowArea selected 状态下边框颜色
|
3413 | */
|
3414 | hollowAreaSelectedBorderColor?: string;
|
3415 | /**
|
3416 | * @title hollowArea selected 状态下边框透明度
|
3417 | */
|
3418 | hollowAreaSelectedBorderOpacity?: number;
|
3419 | /**
|
3420 | * @title hollowArea inactive 状态下边框粗细
|
3421 | */
|
3422 | hollowAreaInactiveBorder?: number;
|
3423 | /**
|
3424 | * @title hollowArea inactive 状态下边框颜色
|
3425 | */
|
3426 | hollowAreaInactiveBorderColor?: string;
|
3427 | /**
|
3428 | * @title hollowArea inactive 状态下边框透明度
|
3429 | */
|
3430 | hollowAreaInactiveBorderOpacity?: number;
|
3431 | /**
|
3432 | * @title interval 边框粗细
|
3433 | */
|
3434 | intervalBorder?: number;
|
3435 | /**
|
3436 | * @title interval 边框颜色
|
3437 | */
|
3438 | intervalBorderColor?: string;
|
3439 | /**
|
3440 | * @title interval 边框透明度
|
3441 | */
|
3442 | intervalBorderOpacity?: number;
|
3443 | /**
|
3444 | * @title interval 填充颜色
|
3445 | */
|
3446 | intervalFillColor?: string;
|
3447 | /**
|
3448 | * @title interval 填充透明度
|
3449 | */
|
3450 | intervalFillOpacity?: number;
|
3451 | /**
|
3452 | * @title interval active 状态下边框粗细
|
3453 | */
|
3454 | intervalActiveBorder?: number;
|
3455 | /**
|
3456 | * @title interval active 状态下边框颜色
|
3457 | */
|
3458 | intervalActiveBorderColor?: string;
|
3459 | /**
|
3460 | * @title interval active 状态下边框透明度
|
3461 | */
|
3462 | intervalActiveBorderOpacity?: number;
|
3463 | /**
|
3464 | * @title interval active 状态下填充颜色
|
3465 | */
|
3466 | intervalActiveFillColor?: string;
|
3467 | /**
|
3468 | * @title interval active 状态下填充透明度
|
3469 | */
|
3470 | intervalActiveFillOpacity?: number;
|
3471 | /**
|
3472 | * @title interval selected 状态下边框粗细
|
3473 | */
|
3474 | intervalSelectedBorder?: number;
|
3475 | /**
|
3476 | * @title interval selected 状态下边框颜色
|
3477 | */
|
3478 | intervalSelectedBorderColor?: string;
|
3479 | /**
|
3480 | * @title interval selected 状态下边框透明度
|
3481 | */
|
3482 | intervalSelectedBorderOpacity?: number;
|
3483 | /**
|
3484 | * @title interval selected 状态下填充颜色
|
3485 | */
|
3486 | intervalSelectedFillColor?: string;
|
3487 | /**
|
3488 | * @title interval selected 状态下填充透明度
|
3489 | */
|
3490 | intervalSelectedFillOpacity?: number;
|
3491 | /**
|
3492 | * @title interval inactive 状态下边框粗细
|
3493 | */
|
3494 | intervalInactiveBorder?: number;
|
3495 | /**
|
3496 | * @title interval inactive 状态下边框颜色
|
3497 | */
|
3498 | intervalInactiveBorderColor?: string;
|
3499 | /**
|
3500 | * @title interval inactive 状态下边框透明度
|
3501 | */
|
3502 | intervalInactiveBorderOpacity?: number;
|
3503 | /**
|
3504 | * @title interval inactive 状态下填充颜色
|
3505 | */
|
3506 | intervalInactiveFillColor?: string;
|
3507 | /**
|
3508 | * @title interval inactive 状态下填充透明度
|
3509 | */
|
3510 | intervalInactiveFillOpacity?: number;
|
3511 | /**
|
3512 | * @title hollowInterval 边框粗细
|
3513 | */
|
3514 | hollowIntervalBorder?: number;
|
3515 | /**
|
3516 | * @title hollowInterval 边框颜色
|
3517 | */
|
3518 | hollowIntervalBorderColor?: string;
|
3519 | /**
|
3520 | * @title hollowInterval 边框透明度
|
3521 | */
|
3522 | hollowIntervalBorderOpacity?: number;
|
3523 | /**
|
3524 | * @title hollowInterval 填充颜色
|
3525 | */
|
3526 | hollowIntervalFillColor?: string;
|
3527 | /**
|
3528 | * @title hollowInterval 填充透明度
|
3529 | */
|
3530 | hollowIntervalFillOpacity?: number;
|
3531 | /**
|
3532 | * @title hollowInterval active 状态下边框粗细
|
3533 | */
|
3534 | hollowIntervalActiveBorder?: number;
|
3535 | /**
|
3536 | * @title hollowInterval active 状态下边框颜色
|
3537 | */
|
3538 | hollowIntervalActiveBorderColor?: string;
|
3539 | /**
|
3540 | * @title hollowInterval active 状态下边框透明度
|
3541 | */
|
3542 | hollowIntervalActiveBorderOpacity?: number;
|
3543 | /**
|
3544 | * @title hollowInterval selected 状态下边框粗细
|
3545 | */
|
3546 | hollowIntervalSelectedBorder?: number;
|
3547 | /**
|
3548 | * @title hollowInterval selected 状态下边框颜色
|
3549 | */
|
3550 | hollowIntervalSelectedBorderColor?: string;
|
3551 | /**
|
3552 | * @title hollowInterval selected 状态下边框透明度
|
3553 | */
|
3554 | hollowIntervalSelectedBorderOpacity?: number;
|
3555 | /**
|
3556 | * @title hollowInterval inactive 状态下边框粗细
|
3557 | */
|
3558 | hollowIntervalInactiveBorder?: number;
|
3559 | /**
|
3560 | * @title hollowInterval inactive 状态下边框颜色
|
3561 | */
|
3562 | hollowIntervalInactiveBorderColor?: string;
|
3563 | /**
|
3564 | * @title hollowInterval inactive 状态下边框透明度
|
3565 | */
|
3566 | hollowIntervalInactiveBorderOpacity?: number;
|
3567 | }
|
3568 | /**
|
3569 | * @title createTheme 主题样式表配置
|
3570 | */
|
3571 | export declare type StyleSheetCfg = Partial<StyleSheet>;
|
3572 | /**
|
3573 | * @title 交互反馈的定义
|
3574 | */
|
3575 | export interface IAction {
|
3576 | /**
|
3577 | * 初始化
|
3578 | */
|
3579 | init(): any;
|
3580 | /**
|
3581 | * 交互 action (反馈)的名称
|
3582 | */
|
3583 | name: string;
|
3584 | /**
|
3585 | * 上下文
|
3586 | */
|
3587 | context: IInteractionContext;
|
3588 | /**
|
3589 | * 销毁函数
|
3590 | */
|
3591 | destroy(): any;
|
3592 | }
|
3593 | /**
|
3594 | * @title 交互上下文的接口定义
|
3595 | */
|
3596 | export interface IInteractionContext extends LooseObject {
|
3597 | /**
|
3598 | * @title 事件对象
|
3599 | */
|
3600 | event: LooseObject;
|
3601 | /**
|
3602 | * 当前的 view
|
3603 | */
|
3604 | view: View;
|
3605 | /**
|
3606 | * @title 交互相关的 Actions
|
3607 | */
|
3608 | actions: IAction[];
|
3609 | /**
|
3610 | * 缓存属性,用于上下文传递信息
|
3611 | * @param key 键名
|
3612 | * @param value 值
|
3613 | */
|
3614 | cache(key: string, value?: any): any;
|
3615 | /**
|
3616 | * 获取 action
|
3617 | * @param name - action 的名称
|
3618 | * @returns 指定 name 的 Action
|
3619 | */
|
3620 | getAction(name: any): IAction;
|
3621 | /**
|
3622 | * 获取当前的点
|
3623 | * @returns 返回当前的点
|
3624 | */
|
3625 | getCurrentPoint(): Point;
|
3626 | /**
|
3627 | * 获取当前的图形
|
3628 | */
|
3629 | getCurrentShape(): IShape;
|
3630 | /**
|
3631 | * 添加 action
|
3632 | * @param action 指定交互 action
|
3633 | */
|
3634 | addAction(action: IAction): any;
|
3635 | /**
|
3636 | * 移除 action
|
3637 | * @param action 移除的 action
|
3638 | */
|
3639 | removeAction(action: IAction): any;
|
3640 | /**
|
3641 | * 事件触发时是否在 view 内部
|
3642 | */
|
3643 | isInPlot(): any;
|
3644 | /**
|
3645 | * 是否在组件的包围盒内
|
3646 | * @param name 组件名,可省略
|
3647 | */
|
3648 | isInComponent(name?: string): any;
|
3649 | /**
|
3650 | * 是否在指定的图形内
|
3651 | * @param name shape 的名称
|
3652 | */
|
3653 | isInShape(name: any): any;
|
3654 | /**
|
3655 | * 销毁
|
3656 | */
|
3657 | destroy(): any;
|
3658 | }
|
3659 | /**
|
3660 | * @title G 的渲染类型
|
3661 | */
|
3662 | export declare type Renderer = 'svg' | 'canvas';
|
3663 | /**
|
3664 | * @title 数据的定义
|
3665 | */
|
3666 | export declare type Datum = Record<string, any>;
|
3667 | export declare type Data = Datum[];
|
3668 | export declare type ActionCallback = (context: IInteractionContext) => void;
|
3669 | export declare type Padding = [number, number, number, number];
|
3670 | export declare type ViewPadding = number | number[] | 'auto';
|
3671 | export declare type ViewAppendPadding = number | number[];
|
3672 | export declare type Position = [number, number];
|
3673 | export declare type AttributeType = 'position' | 'size' | 'color' | 'shape';
|
3674 | export declare type ShapeVertices = RangePoint[] | Point[] | Point[][];
|
3675 | /**
|
3676 | * @title easing 的回调函数, 入参 data 为对应的原始数据记录
|
3677 | */
|
3678 | export declare type AnimateEasingCallback = (data: Datum) => string;
|
3679 | /**
|
3680 | * @title delay 的回调函数, 入参 data 为对应的原始数据记录
|
3681 | */
|
3682 | export declare type AnimateDelayCallback = (data: Datum) => number;
|
3683 | /**
|
3684 | * @title duration 的回调函数, 入参 data 为对应的原始数据记录
|
3685 | */
|
3686 | export declare type AnimateDurationCallback = (data: Datum) => number;
|
3687 |
|
\ | No newline at end of file |