@antv/g2 4.2.9 → 4.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/g2.min.js +2 -2
  2. package/dist/g2.min.js.map +1 -1
  3. package/esm/animate/animation/index.d.ts +1 -1
  4. package/esm/animate/animation/sector-path-update.js +2 -1
  5. package/esm/animate/animation/sector-path-update.js.map +1 -1
  6. package/esm/animate/animation/wave-in.js +2 -0
  7. package/esm/animate/animation/wave-in.js.map +1 -1
  8. package/esm/animate/animation/zoom.js +2 -1
  9. package/esm/animate/animation/zoom.js.map +1 -1
  10. package/esm/animate/index.js.map +1 -1
  11. package/esm/chart/controller/axis.d.ts +1 -1
  12. package/esm/chart/controller/base.d.ts +1 -1
  13. package/esm/chart/layout/constraint/types.d.ts +2 -2
  14. package/esm/chart/layout/index.d.ts +1 -1
  15. package/esm/chart/layout/padding-cal.d.ts +1 -1
  16. package/esm/component/update-label.d.ts +1 -1
  17. package/esm/core.d.ts +1 -1
  18. package/esm/core.js +3 -1
  19. package/esm/core.js.map +1 -1
  20. package/esm/dependents.d.ts +1 -1
  21. package/esm/geometry/label/base.d.ts +1 -1
  22. package/esm/geometry/label/index.d.ts +1 -1
  23. package/esm/geometry/label/interface.d.ts +2 -2
  24. package/esm/geometry/shape/area/index.js.map +1 -1
  25. package/esm/geometry/shape/area/line.js.map +1 -1
  26. package/esm/geometry/shape/area/smooth-line.js.map +1 -1
  27. package/esm/geometry/shape/area/smooth.js.map +1 -1
  28. package/esm/geometry/shape/base.js.map +1 -1
  29. package/esm/geometry/shape/edge/arc.js.map +1 -1
  30. package/esm/geometry/shape/edge/index.js.map +1 -1
  31. package/esm/geometry/shape/edge/smooth.js.map +1 -1
  32. package/esm/geometry/shape/edge/vhv.js.map +1 -1
  33. package/esm/geometry/shape/interval/funnel.js.map +1 -1
  34. package/esm/geometry/shape/interval/hollow-rect.js +1 -0
  35. package/esm/geometry/shape/interval/hollow-rect.js.map +1 -1
  36. package/esm/geometry/shape/interval/index.js +1 -0
  37. package/esm/geometry/shape/interval/index.js.map +1 -1
  38. package/esm/geometry/shape/interval/line.js.map +1 -1
  39. package/esm/geometry/shape/interval/pyramid.js.map +1 -1
  40. package/esm/geometry/shape/interval/tick.js.map +1 -1
  41. package/esm/geometry/shape/line/index.js.map +1 -1
  42. package/esm/geometry/shape/line/step.js.map +1 -1
  43. package/esm/geometry/shape/point/hollow.js.map +1 -1
  44. package/esm/geometry/shape/point/image.js.map +1 -1
  45. package/esm/geometry/shape/point/index.js.map +1 -1
  46. package/esm/geometry/shape/point/solid.js.map +1 -1
  47. package/esm/geometry/shape/polygon/index.js.map +1 -1
  48. package/esm/geometry/shape/polygon/square.js.map +1 -1
  49. package/esm/geometry/shape/schema/box.js.map +1 -1
  50. package/esm/geometry/shape/schema/candle.js.map +1 -1
  51. package/esm/geometry/shape/violin/hollow.js.map +1 -1
  52. package/esm/geometry/shape/violin/index.js.map +1 -1
  53. package/esm/geometry/shape/violin/smooth.js.map +1 -1
  54. package/esm/index.js +2 -2
  55. package/esm/index.js.map +1 -1
  56. package/esm/interaction/action/element/highlight-util.d.ts +1 -1
  57. package/esm/interaction/action/element/highlight.d.ts +1 -1
  58. package/esm/interaction/action/element/link-by-color.d.ts +1 -1
  59. package/esm/interaction/action/register.d.ts +1 -1
  60. package/esm/interaction/interaction.d.ts +1 -1
  61. package/esm/interface.d.ts +59 -59
  62. package/esm/util/collision-detect.d.ts +1 -1
  63. package/esm/util/legend.d.ts +1 -1
  64. package/esm/util/text.d.ts +2 -2
  65. package/esm/util/types.d.ts +1 -1
  66. package/lib/animate/animation/index.d.ts +1 -1
  67. package/lib/animate/animation/sector-path-update.js +1 -0
  68. package/lib/animate/animation/sector-path-update.js.map +1 -1
  69. package/lib/animate/animation/wave-in.js +2 -0
  70. package/lib/animate/animation/wave-in.js.map +1 -1
  71. package/lib/animate/animation/zoom.js +1 -0
  72. package/lib/animate/animation/zoom.js.map +1 -1
  73. package/lib/animate/index.js.map +1 -1
  74. package/lib/chart/controller/axis.d.ts +1 -1
  75. package/lib/chart/controller/base.d.ts +1 -1
  76. package/lib/chart/layout/constraint/types.d.ts +2 -2
  77. package/lib/chart/layout/index.d.ts +1 -1
  78. package/lib/chart/layout/padding-cal.d.ts +1 -1
  79. package/lib/component/update-label.d.ts +1 -1
  80. package/lib/core.d.ts +1 -1
  81. package/lib/core.js +9 -9
  82. package/lib/core.js.map +1 -1
  83. package/lib/dependents.d.ts +1 -1
  84. package/lib/geometry/label/base.d.ts +1 -1
  85. package/lib/geometry/label/index.d.ts +1 -1
  86. package/lib/geometry/label/interface.d.ts +2 -2
  87. package/lib/geometry/shape/area/index.js.map +1 -1
  88. package/lib/geometry/shape/area/line.js.map +1 -1
  89. package/lib/geometry/shape/area/smooth-line.js.map +1 -1
  90. package/lib/geometry/shape/area/smooth.js.map +1 -1
  91. package/lib/geometry/shape/base.js.map +1 -1
  92. package/lib/geometry/shape/edge/arc.js.map +1 -1
  93. package/lib/geometry/shape/edge/index.js.map +1 -1
  94. package/lib/geometry/shape/edge/smooth.js.map +1 -1
  95. package/lib/geometry/shape/edge/vhv.js.map +1 -1
  96. package/lib/geometry/shape/interval/funnel.js.map +1 -1
  97. package/lib/geometry/shape/interval/hollow-rect.js +1 -0
  98. package/lib/geometry/shape/interval/hollow-rect.js.map +1 -1
  99. package/lib/geometry/shape/interval/index.js +1 -0
  100. package/lib/geometry/shape/interval/index.js.map +1 -1
  101. package/lib/geometry/shape/interval/line.js.map +1 -1
  102. package/lib/geometry/shape/interval/pyramid.js.map +1 -1
  103. package/lib/geometry/shape/interval/tick.js.map +1 -1
  104. package/lib/geometry/shape/line/index.js.map +1 -1
  105. package/lib/geometry/shape/line/step.js.map +1 -1
  106. package/lib/geometry/shape/point/hollow.js.map +1 -1
  107. package/lib/geometry/shape/point/image.js.map +1 -1
  108. package/lib/geometry/shape/point/index.js.map +1 -1
  109. package/lib/geometry/shape/point/solid.js.map +1 -1
  110. package/lib/geometry/shape/polygon/index.js.map +1 -1
  111. package/lib/geometry/shape/polygon/square.js.map +1 -1
  112. package/lib/geometry/shape/schema/box.js.map +1 -1
  113. package/lib/geometry/shape/schema/candle.js.map +1 -1
  114. package/lib/geometry/shape/violin/hollow.js.map +1 -1
  115. package/lib/geometry/shape/violin/index.js.map +1 -1
  116. package/lib/geometry/shape/violin/smooth.js.map +1 -1
  117. package/lib/index.js +2 -2
  118. package/lib/index.js.map +1 -1
  119. package/lib/interaction/action/element/highlight-util.d.ts +1 -1
  120. package/lib/interaction/action/element/highlight.d.ts +1 -1
  121. package/lib/interaction/action/element/link-by-color.d.ts +1 -1
  122. package/lib/interaction/action/register.d.ts +1 -1
  123. package/lib/interaction/interaction.d.ts +1 -1
  124. package/lib/interface.d.ts +59 -59
  125. package/lib/util/collision-detect.d.ts +1 -1
  126. package/lib/util/legend.d.ts +1 -1
  127. package/lib/util/text.d.ts +2 -2
  128. package/lib/util/types.d.ts +1 -1
  129. package/package.json +1 -1
  130. package/src/animate/animation/sector-path-update.ts +2 -1
  131. package/src/animate/animation/wave-in.ts +2 -0
  132. package/src/animate/animation/zoom.ts +2 -1
  133. package/src/core.ts +1 -1
  134. package/src/geometry/shape/interval/hollow-rect.ts +1 -0
  135. package/src/geometry/shape/interval/index.ts +1 -0
  136. package/src/index.ts +2 -2
  137. package/CHANGELOG.md +0 -1433
@@ -42,7 +42,7 @@ export interface RangePoint {
42
42
  /**
43
43
  * WAI-ARIA 无障碍标签配置
44
44
  */
45
- export type AriaOption = false | {
45
+ export declare type AriaOption = false | {
46
46
  readonly label: string;
47
47
  };
48
48
  /**
@@ -281,7 +281,7 @@ export interface StyleOption {
281
281
  /**
282
282
  * @title geometry.custom() custom 自定义的配置,可以传入任何数据
283
283
  */
284
- export type CustomOption = any;
284
+ export declare type CustomOption = any;
285
285
  /**
286
286
  * @title `geometry.tooltip({})` Tooltip 配置定义
287
287
  */
@@ -457,43 +457,43 @@ export interface StateOption {
457
457
  /**
458
458
  * @title interval label 的位置
459
459
  */
460
- export type IntervalGeometryLabelPosition = 'top' | 'bottom' | 'middle' | 'left' | 'right';
460
+ export declare type IntervalGeometryLabelPosition = 'top' | 'bottom' | 'middle' | 'left' | 'right';
461
461
  /**
462
462
  * @title G2 提供的 adjust 类型
463
463
  */
464
- export type AdjustType = 'stack' | 'jitter' | 'dodge' | 'symmetric';
464
+ export declare type AdjustType = 'stack' | 'jitter' | 'dodge' | 'symmetric';
465
465
  /**
466
466
  * @title geometry.color() 图形属性回调函数定义
467
467
  */
468
- export type ColorAttrCallback = (...args: any[]) => string;
468
+ export declare type ColorAttrCallback = (...args: any[]) => string;
469
469
  /**
470
470
  * @title geometry.shape() 图形属性回调函数定义
471
471
  */
472
- export type ShapeAttrCallback = (...args: any[]) => string | any[];
472
+ export declare type ShapeAttrCallback = (...args: any[]) => string | any[];
473
473
  /**
474
474
  * @title geometry.size() 图形属性回调函数定义
475
475
  */
476
- export type SizeAttrCallback = (...args: any[]) => number;
476
+ export declare type SizeAttrCallback = (...args: any[]) => number;
477
477
  /**
478
478
  * @title geometry.tooltip() 接口回调函数定义
479
479
  */
480
- export type TooltipCallback = (...args: any[]) => LooseObject;
480
+ export declare type TooltipCallback = (...args: any[]) => LooseObject;
481
481
  /**
482
482
  * @title geometry.style() 接口回调函数定义
483
483
  */
484
- export type StyleCallback = (...args: any[]) => LooseObject;
484
+ export declare type StyleCallback = (...args: any[]) => LooseObject;
485
485
  /**
486
486
  * @title geometry.label() 接口回调函数定义
487
487
  */
488
- export type LabelCallback = (...args: any[]) => GeometryLabelCfg | null | undefined;
488
+ export declare type LabelCallback = (...args: any[]) => GeometryLabelCfg | null | undefined;
489
489
  /**
490
490
  * @title geometry label 中 content 属性的回调函数类型定义
491
491
  */
492
- export type GeometryLabelContentCallback = (data: Datum, mappingData: MappingDatum, index: number) => string | IShape | IGroup;
492
+ export declare type GeometryLabelContentCallback = (data: Datum, mappingData: MappingDatum, index: number) => string | IShape | IGroup;
493
493
  /**
494
494
  * @title state 下 style 回调函数定义
495
495
  */
496
- export type StateStyleCallback = (element: Element) => LooseObject;
496
+ export declare type StateStyleCallback = (element: Element) => LooseObject;
497
497
  /**
498
498
  * @title 获取 shape marker 时需要的信息
499
499
  */
@@ -610,7 +610,7 @@ export interface ShapePoint {
610
610
  /**
611
611
  * @title 小提琴图 shape 关键点信息
612
612
  */
613
- export type ViolinShapePoint = ShapePoint & {
613
+ export declare type ViolinShapePoint = ShapePoint & {
614
614
  _size?: number[];
615
615
  };
616
616
  /**
@@ -704,15 +704,15 @@ export interface ShapeFactory extends RegisterShapeFactory {
704
704
  /**
705
705
  * @title 自定义 Shape marker 的函数
706
706
  */
707
- export type ShapeMarkerSymbol = (x: number, y: number, r: number) => PathCommand[];
707
+ export declare type ShapeMarkerSymbol = (x: number, y: number, r: number) => PathCommand[];
708
708
  /**
709
709
  * @title Annotation position 回调函数
710
710
  */
711
- export type AnnotationPositionCallback = (xScales: Scale[] | Record<string, Scale>, yScales: Scale[] | Record<string, Scale>) => [number | string, number | string];
711
+ export declare type AnnotationPositionCallback = (xScales: Scale[] | Record<string, Scale>, yScales: Scale[] | Record<string, Scale>) => [number | string, number | string];
712
712
  /**
713
713
  * @title Annotation 位置相关属性的类型定义
714
714
  */
715
- export type AnnotationPosition = [number | string, number | string] | Record<string, number | string> | AnnotationPositionCallback;
715
+ export declare type AnnotationPosition = [number | string, number | string] | Record<string, number | string> | AnnotationPositionCallback;
716
716
  /**
717
717
  * @title Annotation 定义的通用属性,chart.annotation().line({})
718
718
  */
@@ -791,11 +791,11 @@ export interface LineOption extends RegionPositionBaseOption {
791
791
  /**
792
792
  * @title 使用 Arc Annotation 组件的配置定义
793
793
  */
794
- export type ArcOption = RegionPositionBaseOption;
794
+ export declare type ArcOption = RegionPositionBaseOption;
795
795
  /**
796
796
  * @title 使用 Region Annotation 组件的配置定义
797
797
  */
798
- export type RegionOption = RegionPositionBaseOption;
798
+ export declare type RegionOption = RegionPositionBaseOption;
799
799
  /**
800
800
  * @title 使用 Text Annotation 组件的配置定义
801
801
  */
@@ -1191,7 +1191,7 @@ export interface ChartCfg extends Omit<ViewCfg, 'parent' | 'canvas' | 'foregroun
1191
1191
  */
1192
1192
  readonly defaultInteractions?: string[];
1193
1193
  }
1194
- export type SyncViewPaddingFn = (chart: View, views: View[], PC: PaddingCalCtor) => void;
1194
+ export declare type SyncViewPaddingFn = (chart: View, views: View[], PC: PaddingCalCtor) => void;
1195
1195
  /**
1196
1196
  * @title View 构造参数
1197
1197
  */
@@ -1624,7 +1624,7 @@ export interface TooltipCrosshairsText extends CrosshairTextCfg {
1624
1624
  * @param currentPoint 对应当前坐标点
1625
1625
  * @returns 返回当前 crosshairs 对应的辅助线文本配置
1626
1626
  */
1627
- export type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
1627
+ export declare type TooltipCrosshairsTextCallback = (type: string, defaultContent: any, items: any[], currentPoint: Point) => TooltipCrosshairsText;
1628
1628
  /**
1629
1629
  * @title Tooltip crosshairs 配置结构
1630
1630
  */
@@ -1682,8 +1682,8 @@ export interface TooltipCrosshairs {
1682
1682
  */
1683
1683
  follow?: boolean;
1684
1684
  }
1685
- export type TooltipTitle = string | ((title: string, datum: Datum) => string);
1686
- export type TooltipItem = {
1685
+ export declare type TooltipTitle = string | ((title: string, datum: Datum) => string);
1686
+ export declare type TooltipItem = {
1687
1687
  /**
1688
1688
  * @title 原始数据
1689
1689
  */
@@ -2086,13 +2086,13 @@ export interface SliderCfg {
2086
2086
  /**
2087
2087
  * 事件 payload
2088
2088
  */
2089
- export type EventPayload = LooseObject & {
2089
+ export declare type EventPayload = LooseObject & {
2090
2090
  /**
2091
2091
  * @title 触发事件的来源
2092
2092
  */
2093
2093
  source?: string;
2094
2094
  };
2095
- export type EventCallback = (event: LooseObject) => void;
2095
+ export declare type EventCallback = (event: LooseObject) => void;
2096
2096
  /**
2097
2097
  * todo: 事件名可穷举,后续需要补充
2098
2098
  * 事件配置项
@@ -2103,7 +2103,7 @@ export interface EventCfg {
2103
2103
  /**
2104
2104
  * 缩略轴的配置项
2105
2105
  */
2106
- export type SliderOption = SliderCfg | boolean;
2106
+ export declare type SliderOption = SliderCfg | boolean;
2107
2107
  /**
2108
2108
  * @title 滚动条组件配置项
2109
2109
  */
@@ -2157,7 +2157,7 @@ export interface ScrollbarCfg {
2157
2157
  /**
2158
2158
  * @title 滚动条配置
2159
2159
  */
2160
- export type ScrollbarOption = ScrollbarCfg | boolean;
2160
+ export declare type ScrollbarOption = ScrollbarCfg | boolean;
2161
2161
  /**
2162
2162
  * @title 配置项声明式
2163
2163
  */
@@ -2234,47 +2234,47 @@ export interface Options {
2234
2234
  /**
2235
2235
  * @title 支持的 Marker 类型
2236
2236
  */
2237
- export type Marker = 'circle' | 'square' | 'diamond' | 'triangle' | 'triangle-down' | 'hexagon' | 'bowtie' | 'cross' | 'tick' | 'plus' | 'hyphen' | 'line';
2237
+ export declare type Marker = 'circle' | 'square' | 'diamond' | 'triangle' | 'triangle-down' | 'hexagon' | 'bowtie' | 'cross' | 'tick' | 'plus' | 'hyphen' | 'line';
2238
2238
  /**
2239
2239
  * @title 自定义 Marker 的回调函数定义
2240
2240
  */
2241
- export type MarkerCallback = (x: number, y: number, r: number) => PathCommand[];
2241
+ export declare type MarkerCallback = (x: number, y: number, r: number) => PathCommand[];
2242
2242
  /**
2243
2243
  * @title chart.tooltip() 参数类型
2244
2244
  */
2245
- export type TooltipOption = TooltipCfg | boolean;
2246
- export type FilterCondition = (value: any, datum: Datum, idx?: number) => boolean;
2245
+ export declare type TooltipOption = TooltipCfg | boolean;
2246
+ export declare type FilterCondition = (value: any, datum: Datum, idx?: number) => boolean;
2247
2247
  /**
2248
2248
  * @title chart.axis() 参数类型
2249
2249
  */
2250
- export type AxisOption = AxisCfg | boolean;
2250
+ export declare type AxisOption = AxisCfg | boolean;
2251
2251
  /**
2252
2252
  * @title chart.legend() 参数类型
2253
2253
  */
2254
- export type LegendOption = LegendCfg | boolean;
2254
+ export declare type LegendOption = LegendCfg | boolean;
2255
2255
  /**
2256
2256
  * @title Options 中 legends 的配置定义
2257
2257
  */
2258
- export type AllLegendsOptions = LegendCfg | Record<string, LegendOption> | boolean;
2258
+ export declare type AllLegendsOptions = LegendCfg | Record<string, LegendOption> | boolean;
2259
2259
  /**
2260
2260
  * @title G2 支持的度量类型
2261
2261
  */
2262
- export type ScaleType = 'linear' | 'cat' | 'category' | 'identity' | 'log' | 'pow' | 'time' | 'timeCat' | 'quantize' | 'quantile';
2263
- export type CoordinateRotate = ['rotate', number];
2264
- export type CoordinateReflect = ['reflect', 'x' | 'y'];
2265
- export type CoordinateScale = ['scale', number, number];
2266
- export type CoordinateTranspose = ['transpose'];
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
2267
  /**
2268
2268
  * @title 坐标系支持的 action 配置
2269
2269
  */
2270
- export type CoordinateActions = CoordinateRotate | CoordinateReflect | CoordinateScale | CoordinateTranspose;
2271
- export type FacetCtor = new (view: View, cfg: any) => Facet;
2270
+ export declare type CoordinateActions = CoordinateRotate | CoordinateReflect | CoordinateScale | CoordinateTranspose;
2271
+ export declare type FacetCtor = new (view: View, cfg: any) => Facet;
2272
2272
  export interface Condition {
2273
2273
  readonly field: string;
2274
2274
  readonly value: any;
2275
2275
  readonly values: any[];
2276
2276
  }
2277
- export type FacetDataFilter = (data: Datum[]) => boolean;
2277
+ export declare type FacetDataFilter = (data: Datum[]) => boolean;
2278
2278
  /**
2279
2279
  * 默认的基础配置
2280
2280
  */
@@ -2395,7 +2395,7 @@ export interface RectCfg extends FacetCfg<RectData> {
2395
2395
  */
2396
2396
  readonly rowTitle?: FacetTitle;
2397
2397
  }
2398
- export type RectData = FacetData;
2398
+ export declare type RectData = FacetData;
2399
2399
  /**
2400
2400
  * @title mirror 分面类型配置
2401
2401
  */
@@ -2409,7 +2409,7 @@ export interface MirrorCfg extends FacetCfg<MirrorData> {
2409
2409
  */
2410
2410
  readonly title?: FacetTitle;
2411
2411
  }
2412
- export type MirrorData = FacetData;
2412
+ export declare type MirrorData = FacetData;
2413
2413
  /**
2414
2414
  * @title list 分面类型配置
2415
2415
  */
@@ -2439,7 +2439,7 @@ export interface MatrixCfg extends FacetCfg<MirrorData> {
2439
2439
  */
2440
2440
  readonly rowTitle?: FacetTitle;
2441
2441
  }
2442
- export type MatrixData = FacetData;
2442
+ export declare type MatrixData = FacetData;
2443
2443
  /**
2444
2444
  * @title circle 分面类型配置
2445
2445
  */
@@ -2449,7 +2449,7 @@ export interface CircleCfg extends FacetCfg<CircleData> {
2449
2449
  */
2450
2450
  readonly title?: FacetTitle;
2451
2451
  }
2452
- export type CircleData = FacetData;
2452
+ export declare type CircleData = FacetData;
2453
2453
  export interface Line {
2454
2454
  readonly style?: ShapeAttrs;
2455
2455
  readonly smooth?: boolean;
@@ -3568,7 +3568,7 @@ export interface StyleSheet {
3568
3568
  /**
3569
3569
  * @title createTheme 主题样式表配置
3570
3570
  */
3571
- export type StyleSheetCfg = Partial<StyleSheet>;
3571
+ export declare type StyleSheetCfg = Partial<StyleSheet>;
3572
3572
  /**
3573
3573
  * @title 交互反馈的定义
3574
3574
  */
@@ -3659,28 +3659,28 @@ export interface IInteractionContext extends LooseObject {
3659
3659
  /**
3660
3660
  * @title G 的渲染类型
3661
3661
  */
3662
- export type Renderer = 'svg' | 'canvas';
3662
+ export declare type Renderer = 'svg' | 'canvas';
3663
3663
  /**
3664
3664
  * @title 数据的定义
3665
3665
  */
3666
- export type Datum = Record<string, any>;
3667
- export type Data = Datum[];
3668
- export type ActionCallback = (context: IInteractionContext) => void;
3669
- export type Padding = [number, number, number, number];
3670
- export type ViewPadding = number | number[] | 'auto';
3671
- export type ViewAppendPadding = number | number[];
3672
- export type Position = [number, number];
3673
- export type AttributeType = 'position' | 'size' | 'color' | 'shape';
3674
- export type ShapeVertices = RangePoint[] | Point[] | Point[][];
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
3675
  /**
3676
3676
  * @title easing 的回调函数, 入参 data 为对应的原始数据记录
3677
3677
  */
3678
- export type AnimateEasingCallback = (data: Datum) => string;
3678
+ export declare type AnimateEasingCallback = (data: Datum) => string;
3679
3679
  /**
3680
3680
  * @title delay 的回调函数, 入参 data 为对应的原始数据记录
3681
3681
  */
3682
- export type AnimateDelayCallback = (data: Datum) => number;
3682
+ export declare type AnimateDelayCallback = (data: Datum) => number;
3683
3683
  /**
3684
3684
  * @title duration 的回调函数, 入参 data 为对应的原始数据记录
3685
3685
  */
3686
- export type AnimateDurationCallback = (data: Datum) => number;
3686
+ export declare type AnimateDurationCallback = (data: Datum) => number;
@@ -1,4 +1,4 @@
1
- type Item = {
1
+ declare type Item = {
2
2
  x: number;
3
3
  y: number;
4
4
  width: number;
@@ -11,7 +11,7 @@ import { LegendCfg, LegendItem } from '../interface';
11
11
  */
12
12
  export declare function getLegendLayout(direction: DIRECTION): 'vertical' | 'horizontal';
13
13
  /** item of @antv/component legend */
14
- type ComponentLegendItem = Omit<LegendItem, 'marker'> & {
14
+ declare type ComponentLegendItem = Omit<LegendItem, 'marker'> & {
15
15
  marker: any;
16
16
  };
17
17
  /**
@@ -1,6 +1,6 @@
1
1
  import * as CSS from 'csstype';
2
- type FontFace = CSS.Properties;
3
- type Font = Pick<FontFace, 'fontFamily' | 'fontWeight' | 'fontStyle' | 'fontVariant'> & {
2
+ declare type FontFace = CSS.Properties;
3
+ declare type Font = Pick<FontFace, 'fontFamily' | 'fontWeight' | 'fontStyle' | 'fontVariant'> & {
4
4
  fontSize?: number;
5
5
  };
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Remove readonly modifier from a type
3
3
  */
4
- export type Writeable<T> = {
4
+ export declare type Writeable<T> = {
5
5
  -readonly [P in keyof T]: T[P];
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2",
3
- "version": "4.2.9",
3
+ "version": "4.2.10",
4
4
  "description": "the Grammar of Graphics in Javascript",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -1,5 +1,5 @@
1
1
  import { getArcParams } from '@antv/g-canvas';
2
- import { isNumberEqual, isEqual } from '@antv/util';
2
+ import { isNumberEqual, isEqual, isFunction } from '@antv/util';
3
3
 
4
4
  import { IShape, PathCommand } from '../../dependents';
5
5
  import { GAnimateCfg } from '../../interface';
@@ -153,6 +153,7 @@ export function sectorPathUpdate(shape: IShape, animateCfg: GAnimateCfg, cfg: An
153
153
  callback: () => {
154
154
  // 将 path 保持原始态,否则会影响 setState() 的动画
155
155
  shape.attr('path', path);
156
+ isFunction(animateCfg.callback) && animateCfg.callback();
156
157
  },
157
158
  }
158
159
  );
@@ -1,3 +1,4 @@
1
+ import { isFunction } from '@antv/util';
1
2
  import { IGroup, IShape } from '../../dependents';
2
3
  import { GAnimateCfg } from '../../interface';
3
4
  import { getCoordinateClipCfg } from '../../util/coordinate';
@@ -32,6 +33,7 @@ export function waveIn(element: IShape | IGroup, animateCfg: GAnimateCfg, cfg: A
32
33
  element.set('clipShape', null);
33
34
  }
34
35
  clipShape.remove(true); // 动画结束需要将剪切图形销毁
36
+ isFunction(animateCfg.callback) && animateCfg.callback();
35
37
  },
36
38
  });
37
39
  }
@@ -1,5 +1,5 @@
1
1
  import { ext } from '@antv/matrix-util';
2
- import { each } from '@antv/util';
2
+ import { each, isFunction } from '@antv/util';
3
3
  import { IGroup, IShape } from '../../dependents';
4
4
  import { GAnimateCfg } from '../../interface';
5
5
  import { AnimateExtraCfg } from '../interface';
@@ -46,6 +46,7 @@ function doShapeZoom(shape: IShape | IGroup, animateCfg: GAnimateCfg, type: 'zoo
46
46
  ...animateCfg,
47
47
  callback: () => {
48
48
  shape.remove(true);
49
+ isFunction(animateCfg.callback) && animateCfg.callback();
49
50
  },
50
51
  }
51
52
  );
package/src/core.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* G2 的一个壳子,不包含 Geometry,由开发者自己定义和引入 */
2
2
 
3
- export const VERSION = '4.2.9';
3
+ export const VERSION = '4.2.10';
4
4
 
5
5
  // 核心基类导出
6
6
  export { Chart, View, Event } from './chart'; // Chart, View 类
@@ -21,6 +21,7 @@ registerShape('interval', 'hollow-rect', {
21
21
  ...backgroundStyle,
22
22
  path: backgroundPath,
23
23
  },
24
+ capture: false,
24
25
  zIndex: -1,
25
26
  name: BACKGROUND_SHAPE,
26
27
  });
@@ -32,6 +32,7 @@ registerShape('interval', 'rect', {
32
32
  ...backgroundStyle,
33
33
  path: backgroundPath,
34
34
  },
35
+ capture: false,
35
36
  zIndex: -1,
36
37
  name: BACKGROUND_SHAPE,
37
38
  });
package/src/index.ts CHANGED
@@ -290,8 +290,8 @@ registerAction('brush', DataRangeFilter);
290
290
  registerAction('brush-x', DataRangeFilter, { dims: ['x'] });
291
291
  registerAction('brush-y', DataRangeFilter, { dims: ['y'] });
292
292
  registerAction('sibling-filter', SiblingFilter);
293
- registerAction('sibling-x-filter', SiblingFilter);
294
- registerAction('sibling-y-filter', SiblingFilter);
293
+ registerAction('sibling-x-filter', SiblingFilter, { dims: 'x' });
294
+ registerAction('sibling-y-filter', SiblingFilter, { dims: 'y' });
295
295
 
296
296
  registerAction('element-filter', ElementFilter);
297
297
  registerAction('element-sibling-filter', ElementSiblingFilter);