@visactor/vchart-types 1.13.7-alpha.0 → 2.0.0-alpha.0

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 (189) hide show
  1. package/package.json +3 -3
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/animation/animate-manager.d.ts +2 -4
  4. package/types/animation/interface.d.ts +86 -2
  5. package/types/animation/spec.d.ts +27 -3
  6. package/types/animation/utils.d.ts +3 -4
  7. package/types/chart/base/base-chart.d.ts +10 -7
  8. package/types/chart/funnel/util.d.ts +2 -0
  9. package/types/chart/interface/chart.d.ts +3 -4
  10. package/types/chart/interface/common.d.ts +2 -9
  11. package/types/chart/sankey/sankey.d.ts +1 -1
  12. package/types/compile/compilable-base.d.ts +1 -1
  13. package/types/compile/compiler.d.ts +35 -25
  14. package/types/compile/data/compilable-data.d.ts +7 -7
  15. package/types/compile/data/interface.d.ts +4 -1
  16. package/types/compile/grammar-item.d.ts +7 -13
  17. package/types/compile/interface/compilable-item.d.ts +22 -28
  18. package/types/compile/interface/compiler.d.ts +13 -4
  19. package/types/compile/mark/index.d.ts +0 -1
  20. package/types/compile/mark/interface.d.ts +42 -33
  21. package/types/compile/mark/mark-state-manager.d.ts +11 -13
  22. package/types/compile/mark/util.d.ts +1 -1
  23. package/types/compile/state-manager.d.ts +11 -0
  24. package/types/compile/util.d.ts +14 -0
  25. package/types/component/axis/base-axis.d.ts +5 -3
  26. package/types/component/axis/cartesian/axis.d.ts +1 -1
  27. package/types/component/axis/cartesian/time-axis.d.ts +1 -0
  28. package/types/component/axis/interface/common.d.ts +8 -0
  29. package/types/component/base/base-component.d.ts +1 -2
  30. package/types/component/brush/brush.d.ts +12 -10
  31. package/types/component/crosshair/base.d.ts +2 -2
  32. package/types/component/custom-mark/custom-mark.d.ts +0 -1
  33. package/types/component/data-zoom/data-filter-base-component.d.ts +2 -2
  34. package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
  35. package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +1 -1
  36. package/types/component/geo/geo-coordinate.d.ts +2 -2
  37. package/types/component/geo/interface.d.ts +1 -1
  38. package/types/component/label/base-label.d.ts +5 -0
  39. package/types/component/label/interface.d.ts +2 -3
  40. package/types/component/label/label.d.ts +3 -3
  41. package/types/component/label/util.d.ts +9 -10
  42. package/types/component/legend/util.d.ts +3 -3
  43. package/types/component/marker/base-marker.d.ts +1 -1
  44. package/types/component/tooltip/processor/interface.d.ts +1 -1
  45. package/types/component/tooltip/processor/util.d.ts +1 -1
  46. package/types/component/tooltip/tooltip.d.ts +2 -3
  47. package/types/constant/data.d.ts +1 -0
  48. package/types/constant/event.d.ts +53 -2
  49. package/types/core/factory.d.ts +28 -3
  50. package/types/core/index.d.ts +1 -0
  51. package/types/core/interface.d.ts +13 -4
  52. package/types/core/vchart.d.ts +6 -6
  53. package/types/data/transforms/treemap.d.ts +5 -6
  54. package/types/data/transforms/venn.d.ts +10 -0
  55. package/types/event/events/base.d.ts +1 -2
  56. package/types/event/interface.d.ts +6 -9
  57. package/types/index-harmony-simple.d.ts +2 -1
  58. package/types/index.d.ts +0 -3
  59. package/types/interaction/config.d.ts +13 -0
  60. package/types/interaction/index.d.ts +9 -1
  61. package/types/interaction/interaction.d.ts +17 -25
  62. package/types/interaction/interface/common.d.ts +22 -0
  63. package/types/interaction/interface/spec.d.ts +53 -0
  64. package/types/interaction/interface/trigger.d.ts +87 -0
  65. package/types/interaction/triggers/base.d.ts +28 -0
  66. package/types/interaction/triggers/dimension-hover.d.ts +22 -0
  67. package/types/interaction/triggers/element-active-by-legend.d.ts +21 -0
  68. package/types/interaction/triggers/element-active.d.ts +20 -0
  69. package/types/interaction/triggers/element-highlight-by-graphic-name.d.ts +13 -0
  70. package/types/interaction/triggers/element-highlight-by-group.d.ts +23 -0
  71. package/types/interaction/triggers/element-highlight-by-key.d.ts +9 -0
  72. package/types/interaction/triggers/element-highlight-by-legend.d.ts +22 -0
  73. package/types/interaction/triggers/element-highlight-by-name.d.ts +24 -0
  74. package/types/interaction/triggers/element-highlight.d.ts +25 -0
  75. package/types/interaction/triggers/element-select-by-graphic-name.d.ts +8 -0
  76. package/types/interaction/triggers/element-select.d.ts +24 -0
  77. package/types/interaction/triggers/enum.d.ts +8 -0
  78. package/types/interaction/triggers/util.d.ts +12 -0
  79. package/types/layout/interface.d.ts +2 -2
  80. package/types/layout/layout-item.d.ts +2 -3
  81. package/types/mark/arc.d.ts +2 -2
  82. package/types/mark/area.d.ts +2 -0
  83. package/types/mark/base/base-line.d.ts +16 -2
  84. package/types/mark/base/base-mark.d.ts +131 -13
  85. package/types/mark/box-plot.d.ts +11 -5
  86. package/types/mark/cell.d.ts +5 -2
  87. package/types/mark/component.d.ts +11 -3
  88. package/types/mark/glyph.d.ts +29 -0
  89. package/types/mark/group.d.ts +10 -6
  90. package/types/mark/index.d.ts +3 -1
  91. package/types/mark/interface/common.d.ts +61 -9
  92. package/types/mark/interface/enum.d.ts +6 -0
  93. package/types/mark/interface/index.d.ts +1 -0
  94. package/types/mark/interface/mark.d.ts +18 -1
  95. package/types/mark/interface/type.d.ts +1 -0
  96. package/types/mark/label.d.ts +4 -3
  97. package/types/mark/link-path.d.ts +35 -5
  98. package/types/mark/liquid.d.ts +47 -5
  99. package/types/mark/ripple.d.ts +39 -4
  100. package/types/mark/rule.d.ts +3 -0
  101. package/types/mark/symbol.d.ts +4 -4
  102. package/types/mark/text.d.ts +4 -2
  103. package/types/mark/transform/data-sampling.d.ts +10 -0
  104. package/types/mark/transform/filter.d.ts +1 -0
  105. package/types/mark/transform/map.d.ts +1 -0
  106. package/types/mark/transform/symbol-overlap.d.ts +14 -0
  107. package/types/mark/utils/common.d.ts +4 -0
  108. package/types/mark/utils/glyph.d.ts +2 -0
  109. package/types/mark/utils/index.d.ts +2 -0
  110. package/types/mark/utils/line.d.ts +3 -0
  111. package/types/model/base-model.d.ts +8 -8
  112. package/types/model/interface.d.ts +4 -8
  113. package/types/model/layout-model.d.ts +2 -2
  114. package/types/plugin/components/tooltip-handler/base.d.ts +2 -2
  115. package/types/plugin/other.d.ts +3 -3
  116. package/types/region/interface.d.ts +0 -2
  117. package/types/region/region.d.ts +3 -9
  118. package/types/series/area/animation.d.ts +1 -1
  119. package/types/series/area/area.d.ts +1 -1
  120. package/types/series/bar/animation.d.ts +1 -1
  121. package/types/series/bar/bar.d.ts +3 -3
  122. package/types/series/base/base-series.d.ts +26 -42
  123. package/types/series/base/tooltip-helper.d.ts +1 -2
  124. package/types/series/box-plot/box-plot.d.ts +3 -3
  125. package/types/series/cartesian/cartesian.d.ts +1 -1
  126. package/types/series/circle-packing/animation.d.ts +1 -1
  127. package/types/series/circle-packing/circle-packing.d.ts +1 -1
  128. package/types/series/correlation/animation.d.ts +1 -1
  129. package/types/series/correlation/correlation.d.ts +3 -4
  130. package/types/series/dot/dot.d.ts +2 -2
  131. package/types/series/funnel/funnel.d.ts +3 -2
  132. package/types/series/funnel/interface.d.ts +0 -1
  133. package/types/series/funnel/tooltip-helper.d.ts +2 -4
  134. package/types/series/gauge/animation.d.ts +1 -1
  135. package/types/series/gauge/gauge-pointer.d.ts +4 -1
  136. package/types/series/gauge/gauge.d.ts +2 -2
  137. package/types/series/geo/geo.d.ts +2 -2
  138. package/types/series/heatmap/animation.d.ts +1 -1
  139. package/types/series/heatmap/heatmap.d.ts +4 -1
  140. package/types/series/interface/common.d.ts +1 -4
  141. package/types/series/interface/series.d.ts +6 -1
  142. package/types/series/line/animation.d.ts +1 -1
  143. package/types/series/line/line.d.ts +1 -1
  144. package/types/series/link/link.d.ts +5 -2
  145. package/types/series/liquid/animation.d.ts +1 -1
  146. package/types/series/liquid/liquid.d.ts +4 -1
  147. package/types/series/map/interface.d.ts +10 -0
  148. package/types/series/mixin/line-mixin.d.ts +5 -5
  149. package/types/series/pictogram/pictogram.d.ts +13 -19
  150. package/types/series/pie/animation/animation.d.ts +4 -3
  151. package/types/series/pie/animation/centerOffset.d.ts +1 -1
  152. package/types/series/pie/interface.d.ts +2 -2
  153. package/types/series/pie/pie.d.ts +8 -6
  154. package/types/series/polar/progress-like/animation.d.ts +1 -1
  155. package/types/series/polar/progress-like/progress-like.d.ts +1 -2
  156. package/types/series/progress/circular/circular.d.ts +4 -1
  157. package/types/series/progress/linear/animation.d.ts +1 -1
  158. package/types/series/progress/linear/linear.d.ts +4 -1
  159. package/types/series/radar/animation.d.ts +11 -9
  160. package/types/series/radar/radar.d.ts +2 -2
  161. package/types/series/range-column/animation.d.ts +1 -1
  162. package/types/series/rose/animation.d.ts +1 -1
  163. package/types/series/sankey/animation.d.ts +1 -1
  164. package/types/series/sankey/sankey.d.ts +11 -12
  165. package/types/series/sankey/tooltip-helper.d.ts +1 -1
  166. package/types/series/scatter/animation.d.ts +1 -1
  167. package/types/series/sunburst/animation/enter.d.ts +1 -1
  168. package/types/series/sunburst/animation/exit.d.ts +1 -1
  169. package/types/series/sunburst/animation/preset.d.ts +1 -1
  170. package/types/series/sunburst/animation/utils.d.ts +2 -2
  171. package/types/series/sunburst/sunburst.d.ts +1 -1
  172. package/types/series/treemap/animation.d.ts +1 -1
  173. package/types/series/treemap/treemap.d.ts +1 -2
  174. package/types/series/venn/animation.d.ts +1 -1
  175. package/types/series/venn/venn.d.ts +2 -1
  176. package/types/series/waterfall/animation.d.ts +1 -1
  177. package/types/series/waterfall/waterfall.d.ts +2 -3
  178. package/types/series/word-cloud/animation.d.ts +1 -1
  179. package/types/series/word-cloud/base.d.ts +1 -1
  180. package/types/series/word-cloud/interface.d.ts +1 -1
  181. package/types/typings/common.d.ts +13 -0
  182. package/types/typings/spec/common.d.ts +37 -36
  183. package/types/typings/visual.d.ts +2 -2
  184. package/types/util/array.d.ts +1 -0
  185. package/types/util/index.d.ts +1 -0
  186. package/types/util/mark.d.ts +5 -0
  187. package/types/util/math.d.ts +1 -1
  188. package/types/util/scale.d.ts +0 -1
  189. package/types/vrender-tools.d.ts +0 -1
@@ -1,10 +1,9 @@
1
1
  import type { IVChart } from './../../core/interface';
2
2
  import type { IImageMarkSpec } from '../visual';
3
3
  import type { LayoutCallBack } from '../../layout/interface';
4
- import type { IElement, srIOption3DType } from '@visactor/vgrammar-core';
5
4
  import type { DataSet, DataView, ISimplifyOptions, IFieldsOptions, IFilterOptions, IFoldOptions, IDsvParserOptions } from '@visactor/vdataset';
6
5
  import type { RegionSpec } from '../../region/interface';
7
- import type { IHoverSpec, ISelectSpec, IInteractionSpec } from '../../interaction/interface';
6
+ import type { IHoverSpec, ISelectSpec, IInteractionSpec } from '../../interaction/interface/spec';
8
7
  import type { IRenderOption } from '../../compile/interface';
9
8
  import type { ISeriesTooltipSpec, ITooltipSpec } from '../../component/tooltip/interface';
10
9
  import type { ILayoutSpec } from '../../layout/interface';
@@ -14,7 +13,7 @@ import type { Datum, StringOrNumber } from '../common';
14
13
  import type { IInvalidType } from '../data';
15
14
  import type { IAnimationSpec, IMorphSeriesSpec } from '../../animation/spec';
16
15
  import type { IPlayer } from '../../component/player/interface';
17
- import type { IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';
16
+ import type { IMark, IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';
18
17
  import type { IDataZoomSpec } from '../../component/data-zoom/data-zoom/interface';
19
18
  import type { IScrollBarSpec } from '../../component/data-zoom/scroll-bar/interface';
20
19
  import type { ICrosshairSpec } from '../../component/crosshair/interface';
@@ -24,7 +23,7 @@ import type { IBrushSpec } from '../../component/brush/interface';
24
23
  import type { ITotalLabelSpec } from '../../component/label/interface';
25
24
  import type { ILegendSpec } from '../../component/legend/interface';
26
25
  import type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';
27
- import type { IColor, ICustomPath2D, IRichTextCharacter } from '@visactor/vrender-core';
26
+ import type { IColor, ICustomPath2D, IGraphic, IRichTextCharacter } from '@visactor/vrender-core';
28
27
  import type { ICommonAxisSpec } from '../../component/axis/interface';
29
28
  import type { IMediaQuerySpec } from './media-query';
30
29
  import type { IModelSpec } from '../../model/interface';
@@ -34,9 +33,7 @@ export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
34
33
  renderCanvas?: string | HTMLCanvasElement;
35
34
  dataSet?: DataSet;
36
35
  autoFit?: boolean;
37
- performanceHook?: IPerformanceHook;
38
36
  animation?: boolean;
39
- options3d?: srIOption3DType;
40
37
  layout?: LayoutCallBack;
41
38
  poptip?: boolean;
42
39
  onError?: (...args: any[]) => void;
@@ -199,8 +196,12 @@ export type IMarkStateFilter = {
199
196
  datums: Datum[];
200
197
  datumKeys: string[];
201
198
  } | {
202
- items: IElement[];
203
- } | ((datum: Datum, options: Record<string, any>) => boolean);
199
+ items: IGraphic[];
200
+ } | ((datum: Datum, options: {
201
+ mark?: IMark;
202
+ type?: string;
203
+ renderNode?: IGraphic;
204
+ }) => boolean);
204
205
  export interface IMarkStateSpec<T> {
205
206
  filter?: IMarkStateFilter;
206
207
  level?: number | undefined;
@@ -224,35 +225,35 @@ export interface IPerformanceHook {
224
225
  afterCreateVChart?: (vchart?: IVChart) => void;
225
226
  beforeInitializeChart?: (vchart?: IVChart) => void;
226
227
  afterInitializeChart?: (vchart?: IVChart) => void;
227
- beforeCompileToVGrammar?: () => void;
228
- afterCompileToVGrammar?: () => void;
229
- beforeRegionCompile?: () => void;
230
- afterRegionCompile?: () => void;
231
- beforeSeriesCompile?: () => void;
232
- afterSeriesCompile?: () => void;
233
- beforeComponentCompile?: () => void;
234
- afterComponentCompile?: () => void;
235
- beforeResizeWithUpdate?: () => void;
236
- afterResizeWithUpdate?: () => void;
237
- beforeLayoutWithSceneGraph?: () => void;
238
- afterLayoutWithSceneGraph?: () => void;
239
- beforeParseView?: () => void;
240
- afterParseView?: () => void;
241
- beforeCreateRuntime?: () => void;
242
- afterCreateRuntime?: () => void;
243
- beforeSrViewEvaluateAsync?: () => void;
244
- afterSrViewEvaluateAsync?: () => void;
245
- beforeSrViewRunAsync?: () => void;
246
- afterSrViewRunAsync?: () => void;
247
- beforeTransform?: (name: string) => void;
248
- afterTransform?: (name: string) => void;
249
- beforeCreateVRenderStage?: () => void;
250
- afterCreateVRenderStage?: () => void;
251
- beforeCreateVRenderMark?: () => void;
252
- afterCreateVRenderMark?: () => void;
228
+ beforeCompileToVGrammar?: (vchart?: IVChart) => void;
229
+ afterCompileToVGrammar?: (vchart?: IVChart) => void;
230
+ beforeRegionCompile?: (vchart?: IVChart) => void;
231
+ afterRegionCompile?: (vchart?: IVChart) => void;
232
+ beforeSeriesCompile?: (vchart?: IVChart) => void;
233
+ afterSeriesCompile?: (vchart?: IVChart) => void;
234
+ beforeComponentCompile?: (vchart?: IVChart) => void;
235
+ afterComponentCompile?: (vchart?: IVChart) => void;
236
+ beforeResizeWithUpdate?: (vchart?: IVChart) => void;
237
+ afterResizeWithUpdate?: (vchart?: IVChart) => void;
238
+ beforeLayoutWithSceneGraph?: (vchart?: IVChart) => void;
239
+ afterLayoutWithSceneGraph?: (vchart?: IVChart) => void;
240
+ beforeParseView?: (vchart?: IVChart) => void;
241
+ afterParseView?: (vchart?: IVChart) => void;
242
+ beforeCreateRuntime?: (vchart?: IVChart) => void;
243
+ afterCreateRuntime?: (vchart?: IVChart) => void;
244
+ beforeSrViewEvaluateAsync?: (vchart?: IVChart) => void;
245
+ afterSrViewEvaluateAsync?: (vchart?: IVChart) => void;
246
+ beforeSrViewRunAsync?: (vchart?: IVChart) => void;
247
+ afterSrViewRunAsync?: (vchart?: IVChart) => void;
248
+ beforeTransform?: (name: string, vchart?: IVChart) => void;
249
+ afterTransform?: (name: string, vchart?: IVChart) => void;
250
+ beforeCreateVRenderStage?: (vchart?: IVChart) => void;
251
+ afterCreateVRenderStage?: (vchart?: IVChart) => void;
252
+ beforeCreateVRenderMark?: (vchart?: IVChart) => void;
253
+ afterCreateVRenderMark?: (vchart?: IVChart) => void;
253
254
  beforeDoRender?: (vchart?: IVChart) => void;
254
- beforeVRenderDraw?: () => void;
255
- afterVRenderDraw?: () => void;
255
+ beforeVRenderDraw?: (vchart?: IVChart) => void;
256
+ afterVRenderDraw?: (vchart?: IVChart) => void;
256
257
  }
257
258
  export type IBuildinMarkSpec = {
258
259
  group: IGroupMarkSpec;
@@ -5,7 +5,7 @@ import type { InterpolateType } from './interpolate';
5
5
  import type { ScaleType } from './scale';
6
6
  import type { ShapeType } from './shape';
7
7
  import type { IPoint } from './coordinate';
8
- import type { IAttributeOpt, IModelMarkAttributeContext } from '../compile/mark/interface';
8
+ import type { IModelMarkAttributeContext } from '../compile/mark/interface';
9
9
  import type { Datum } from './common';
10
10
  import type { IPadding } from '@visactor/vutils';
11
11
  import type { IColorKey } from '../theme/color-scheme/interface';
@@ -37,7 +37,7 @@ export interface IVisualScale {
37
37
  field?: string;
38
38
  changeDomain?: 'none' | 'replace' | 'expand';
39
39
  }
40
- export type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, opt?: IAttributeOpt, source?: DataView) => T;
40
+ export type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, source?: DataView) => T;
41
41
  export type ValueType<T> = T;
42
42
  export type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;
43
43
  export type TextureType = 'circle' | 'dimond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';
@@ -1,4 +1,5 @@
1
1
  import { array, last as peek, maxInArray as maxInArr, minInArray as minInArr } from '@visactor/vutils';
2
2
  export declare function shallowCompare<T, U>(arrA: T | T[], arrB: U | U[]): boolean;
3
3
  export declare function combineDomains(domains: number[][]): number[];
4
+ export declare function moveAfterInArray<T>(array: T[], target: T, ref: T): void;
4
5
  export { array, peek, maxInArr, minInArr };
@@ -17,6 +17,7 @@ export * from './text';
17
17
  export * from './data';
18
18
  export * from './hierarchy';
19
19
  export * from './style';
20
+ export * from './mark';
20
21
  export declare const Utils: {
21
22
  TimeUtil: typeof TimeUtil;
22
23
  };
@@ -0,0 +1,5 @@
1
+ import type { IGraphic } from '@visactor/vrender-core';
2
+ import type { IMarkGraphic } from '../mark/interface/common';
3
+ export declare const isCollectionMark: (type: string) => boolean;
4
+ export declare const getDatumOfGraphic: (g: IMarkGraphic) => import("../typings").Datum;
5
+ export declare const findMarkGraphic: (rootGroup: IGraphic, target: IGraphic) => IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
@@ -23,5 +23,5 @@ export declare function radiusLabelOrientAttribute(angle: number): {
23
23
  };
24
24
  export declare function vectorAngle(v1: IPoint, v2: IPoint): number;
25
25
  export declare function distance(p1: IPoint, p2?: IPoint): number;
26
- export declare function getPercentValue(valueList: number[], precision?: number): number[] | 0;
26
+ export declare function getPercentValue(valueList: number[], precision?: number): 0 | number[];
27
27
  export declare function isValidPoint(p: IPoint): boolean;
@@ -17,6 +17,5 @@ export declare function createScaleWithSpec(spec: IVisual<any>, context: {
17
17
  seriesId: number;
18
18
  }): IBaseScale | null;
19
19
  export declare function valueInScaleRange(v: number, s?: IBaseScale, useWholeRange?: boolean): number;
20
- export declare function isValueInScaleDomain(v: number | number[], s?: IBaseScale, useWholeRange?: boolean): boolean;
21
20
  export declare function isSpecValueWithScale(specValue: any): boolean;
22
21
  export {};
@@ -1 +0,0 @@
1
- export { randomOpacity, columnLeftToRight, columnRightToLeft, rowTopToBottom, rowBottomToTop, diagonalCenterToEdge, diagonalTopLeftToBottomRight, rotationScan, rippleEffect, snakeWave, alternatingWave, spiralEffect, columnEdgeToCenter, columnCenterToEdge, rowEdgeToCenter, rowCenterToEdge, cornerToCenter, centerToCorner, pulseWave, particleEffect } from '@visactor/vrender-kits';