@visactor/vchart-types 1.13.1 → 1.13.2

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 (171) hide show
  1. package/package.json +1 -1
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/animation/utils.d.ts +2 -2
  4. package/types/chart/base/base-chart.d.ts +1 -2
  5. package/types/chart/common/interface.d.ts +5 -4
  6. package/types/chart/gauge/interface.d.ts +2 -2
  7. package/types/chart/interface/common.d.ts +2 -2
  8. package/types/chart/polar/interface.d.ts +1 -1
  9. package/types/chart/sequence/interface.d.ts +2 -1
  10. package/types/compile/compilable-base.d.ts +2 -3
  11. package/types/compile/compiler.d.ts +8 -8
  12. package/types/compile/interface/compilable-item.d.ts +63 -5
  13. package/types/compile/interface/compiler.d.ts +4 -20
  14. package/types/compile/mark/compilable-mark.d.ts +4 -5
  15. package/types/compile/mark/interface.d.ts +19 -7
  16. package/types/compile/mark/mark-data.d.ts +2 -2
  17. package/types/compile/mark/mark-state-manager.d.ts +2 -2
  18. package/types/component/axis/base-axis.d.ts +1 -1
  19. package/types/component/axis/interface/common.d.ts +2 -2
  20. package/types/component/axis/polar/interface/common.d.ts +1 -1
  21. package/types/component/crosshair/interface/cartesian.d.ts +1 -1
  22. package/types/component/crosshair/interface/common.d.ts +1 -1
  23. package/types/component/crosshair/interface/polar.d.ts +1 -1
  24. package/types/component/crosshair/interface/theme.d.ts +1 -1
  25. package/types/component/data-zoom/data-zoom/interface.d.ts +1 -2
  26. package/types/component/data-zoom/scroll-bar/interface.d.ts +1 -2
  27. package/types/component/interface/theme.d.ts +13 -9
  28. package/types/component/label/interface.d.ts +14 -2
  29. package/types/component/label/label.d.ts +2 -15
  30. package/types/component/label/util.d.ts +1 -2
  31. package/types/component/legend/interface.d.ts +5 -2
  32. package/types/component/legend/util.d.ts +2 -2
  33. package/types/component/marker/base-marker.d.ts +1 -1
  34. package/types/component/marker/interface.d.ts +3 -4
  35. package/types/component/marker/mark-line/interface/spec.d.ts +1 -1
  36. package/types/component/marker/mark-point/interface/theme.d.ts +1 -1
  37. package/types/component/player/interface/theme.d.ts +1 -2
  38. package/types/component/poptip/interface.d.ts +1 -1
  39. package/types/component/title/interface/theme.d.ts +1 -1
  40. package/types/component/tooltip/interface/theme.d.ts +1 -1
  41. package/types/core/factory.d.ts +1 -1
  42. package/types/core/interface.d.ts +6 -7
  43. package/types/core/vchart.d.ts +3 -3
  44. package/types/data/transforms/aggregation.d.ts +2 -29
  45. package/types/data/transforms/dimension-statistics.d.ts +1 -13
  46. package/types/data/transforms/hierarchy-dimension-statistics.d.ts +1 -1
  47. package/types/data/transforms/interface.d.ts +47 -0
  48. package/types/data/transforms/regression.d.ts +1 -4
  49. package/types/event/events/dimension/interface.d.ts +1 -1
  50. package/types/event/interface.d.ts +1 -2
  51. package/types/interaction/interface.d.ts +1 -5
  52. package/types/mark/arc-3d.d.ts +1 -2
  53. package/types/mark/arc.d.ts +1 -2
  54. package/types/mark/area.d.ts +1 -2
  55. package/types/mark/box-plot.d.ts +1 -2
  56. package/types/mark/cell.d.ts +1 -2
  57. package/types/mark/component.d.ts +1 -2
  58. package/types/mark/group.d.ts +1 -9
  59. package/types/mark/image.d.ts +1 -2
  60. package/types/mark/interface/common.d.ts +1 -1
  61. package/types/mark/interface/index.d.ts +1 -0
  62. package/types/mark/interface/mark.d.ts +44 -0
  63. package/types/mark/label.d.ts +2 -11
  64. package/types/mark/line.d.ts +1 -2
  65. package/types/mark/link-path.d.ts +1 -2
  66. package/types/mark/path.d.ts +1 -2
  67. package/types/mark/polygon/polygon.d.ts +1 -2
  68. package/types/mark/polygon/pyramid-3d.d.ts +1 -2
  69. package/types/mark/rect-3d.d.ts +1 -2
  70. package/types/mark/rect.d.ts +1 -2
  71. package/types/mark/ripple.d.ts +1 -2
  72. package/types/mark/rule.d.ts +1 -2
  73. package/types/mark/symbol.d.ts +1 -2
  74. package/types/mark/text.d.ts +2 -8
  75. package/types/model/interface.d.ts +5 -5
  76. package/types/plugin/chart/interface.d.ts +1 -2
  77. package/types/plugin/chart/media-query/interface/common.d.ts +2 -2
  78. package/types/plugin/components/tooltip-handler/base.d.ts +3 -3
  79. package/types/region/interface.d.ts +1 -2
  80. package/types/region/region.d.ts +1 -2
  81. package/types/scale/global-scale.d.ts +1 -1
  82. package/types/scale/interface.d.ts +1 -1
  83. package/types/series/area/animation.d.ts +1 -5
  84. package/types/series/area/area.d.ts +1 -2
  85. package/types/series/area/interface.d.ts +7 -4
  86. package/types/series/bar/animation.d.ts +1 -8
  87. package/types/series/bar/bar.d.ts +1 -3
  88. package/types/series/bar/interface.d.ts +10 -4
  89. package/types/series/base/base-series.d.ts +2 -3
  90. package/types/series/box-plot/box-plot.d.ts +1 -1
  91. package/types/series/cartesian/cartesian.d.ts +2 -2
  92. package/types/series/cartesian/interface.d.ts +1 -1
  93. package/types/series/circle-packing/animation.d.ts +1 -2
  94. package/types/series/circle-packing/circle-packing.d.ts +1 -1
  95. package/types/series/circle-packing/interface.d.ts +2 -1
  96. package/types/series/correlation/animation.d.ts +1 -5
  97. package/types/series/correlation/correlation.d.ts +1 -2
  98. package/types/series/correlation/interface.d.ts +7 -4
  99. package/types/series/dot/dot.d.ts +1 -1
  100. package/types/series/funnel/3d/funnel-3d.d.ts +1 -1
  101. package/types/series/funnel/funnel.d.ts +1 -5
  102. package/types/series/funnel/interface.d.ts +1 -1
  103. package/types/series/gauge/gauge.d.ts +2 -0
  104. package/types/series/gauge/interface.d.ts +1 -2
  105. package/types/series/heatmap/animation.d.ts +1 -1
  106. package/types/series/heatmap/heatmap.d.ts +1 -3
  107. package/types/series/heatmap/interface.d.ts +2 -2
  108. package/types/series/index.d.ts +7 -3
  109. package/types/series/interface/common.d.ts +2 -3
  110. package/types/series/interface/series.d.ts +6 -9
  111. package/types/series/interface/theme.d.ts +1 -1
  112. package/types/series/line/animation.d.ts +1 -5
  113. package/types/series/line/interface.d.ts +7 -4
  114. package/types/series/link/link.d.ts +1 -1
  115. package/types/series/liquid/animation.d.ts +1 -11
  116. package/types/series/liquid/interface.d.ts +12 -2
  117. package/types/series/map/interface.d.ts +1 -1
  118. package/types/series/map/map.d.ts +1 -2
  119. package/types/series/mixin/interface.d.ts +14 -0
  120. package/types/series/mixin/line-mixin.d.ts +3 -18
  121. package/types/series/pictogram/pictogram.d.ts +8 -7
  122. package/types/series/pie/3d/pie-3d.d.ts +1 -1
  123. package/types/series/pie/animation/animation.d.ts +1 -5
  124. package/types/series/pie/animation/centerOffset.d.ts +1 -4
  125. package/types/series/pie/interface.d.ts +9 -2
  126. package/types/series/pie/pie.d.ts +1 -4
  127. package/types/series/polar/progress-like/animation.d.ts +1 -4
  128. package/types/series/polar/progress-like/interface.d.ts +4 -0
  129. package/types/series/polar/progress-like/progress-like.d.ts +1 -2
  130. package/types/series/progress/circular/interface.d.ts +1 -2
  131. package/types/series/progress/linear/animation.d.ts +1 -5
  132. package/types/series/progress/linear/interface.d.ts +4 -1
  133. package/types/series/radar/animation.d.ts +2 -8
  134. package/types/series/radar/interface.d.ts +11 -4
  135. package/types/series/range-column/animation.d.ts +1 -5
  136. package/types/series/range-column/interface.d.ts +6 -2
  137. package/types/series/range-column/range-column.d.ts +1 -1
  138. package/types/series/rose/animation.d.ts +1 -5
  139. package/types/series/rose/interface.d.ts +7 -3
  140. package/types/series/rose/rose.d.ts +1 -3
  141. package/types/series/sankey/animation.d.ts +1 -7
  142. package/types/series/sankey/interface.d.ts +7 -2
  143. package/types/series/sankey/sankey.d.ts +2 -3
  144. package/types/series/scatter/animation.d.ts +1 -5
  145. package/types/series/scatter/interface.d.ts +7 -3
  146. package/types/series/scatter/scatter.d.ts +1 -2
  147. package/types/series/sunburst/interface.d.ts +1 -1
  148. package/types/series/sunburst/sunburst.d.ts +1 -1
  149. package/types/series/treemap/animation.d.ts +1 -2
  150. package/types/series/treemap/interface.d.ts +3 -2
  151. package/types/series/treemap/tooltip-helper.d.ts +1 -1
  152. package/types/series/treemap/treemap.d.ts +2 -3
  153. package/types/series/util/label-mark.d.ts +1 -1
  154. package/types/series/util/utils.d.ts +1 -1
  155. package/types/series/venn/animation.d.ts +1 -2
  156. package/types/series/venn/interface.d.ts +3 -2
  157. package/types/series/venn/venn.d.ts +3 -4
  158. package/types/series/waterfall/animation.d.ts +3 -3
  159. package/types/series/waterfall/interface.d.ts +3 -3
  160. package/types/series/waterfall/waterfall.d.ts +2 -4
  161. package/types/series/word-cloud/animation.d.ts +1 -8
  162. package/types/series/word-cloud/base.d.ts +1 -3
  163. package/types/series/word-cloud/interface.d.ts +9 -1
  164. package/types/theme/interface.d.ts +1 -1
  165. package/types/typings/params.d.ts +1 -1
  166. package/types/typings/spec/chart.d.ts +26 -26
  167. package/types/typings/spec/common.d.ts +10 -9
  168. package/types/typings/spec/index.d.ts +1 -1
  169. package/types/typings/spec/media-query.d.ts +3 -2
  170. package/types/typings/visual.d.ts +3 -3
  171. package/types/util/data.d.ts +1 -1
@@ -10,9 +10,9 @@ export declare function animationConfig<Preset extends string>(defaultConfig?: M
10
10
  dataIndex: (datum: any, params: any) => number;
11
11
  dataCount: () => number;
12
12
  }): MarkAnimationSpec;
13
- export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: IModelMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
13
+ export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: IModelMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "enter" | "exit" | "update" | "appear" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
14
14
  export declare function shouldMarkDoMorph(spec: ISeriesSpec & IAnimationSpec<string, string>, markName: string): boolean;
15
15
  export declare function isTimeLineAnimation(animationConfig: IAnimationConfig): boolean;
16
16
  export declare function isChannelAnimation(animationConfig: IAnimationConfig): boolean;
17
- export declare function uniformAnimationConfig<Preset extends string>(config: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, ctx: IModelMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
17
+ export declare function uniformAnimationConfig<Preset extends string>(config: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, ctx: IModelMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "enter" | "exit" | "update" | "appear" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
18
18
  export declare function isAnimationEnabledForSeries(series: ISeries): boolean;
@@ -7,7 +7,7 @@ import type { IChart, IChartLayoutOption, IChartRenderOption, IChartOption, ICha
7
7
  import type { ISeries, ISeriesConstructor } from '../../series/interface';
8
8
  import type { IRegion } from '../../region/interface';
9
9
  import type { IComponent, IComponentConstructor } from '../../component/interface';
10
- import type { IMark } from '../../mark/interface';
10
+ import type { IMark, IRectMark } from '../../mark/interface';
11
11
  import type { IEvent } from '../../event/interface';
12
12
  import type { DataView } from '@visactor/vdataset';
13
13
  import type { DataSet } from '@visactor/vdataset';
@@ -16,7 +16,6 @@ import type { IBoundsLike } from '@visactor/vutils';
16
16
  import type { IRunningConfig as IMorphConfig, IView } from '@visactor/vgrammar-core';
17
17
  import { CompilableBase } from '../../compile/compilable-base';
18
18
  import type { IGlobalScale } from '../../scale/interface';
19
- import type { IRectMark } from '../../mark/rect';
20
19
  export declare class BaseChart<T extends IChartSpec> extends CompilableBase implements IChart {
21
20
  readonly type: string;
22
21
  readonly seriesType: string;
@@ -2,8 +2,8 @@ import type { ILineSeriesSpec } from '../../series/line/interface';
2
2
  import type { IAreaSeriesSpec } from '../../series/area/interface';
3
3
  import type { IChartSpec } from '../../typings/spec/common';
4
4
  import type { IBar3dSeriesSpec, IBarSeriesSpec } from '../../series/bar/interface';
5
- import type { IRangeColumnChartSpec } from '../range-column';
6
- import type { IRangeAreaChartSpec } from '../range-area';
5
+ import type { IRangeColumnChartSpec } from '../range-column/interface';
6
+ import type { IRangeAreaChartSpec } from '../range-area/interface';
7
7
  import type { IDotSeriesSpec } from '../../series/dot/interface';
8
8
  import type { IMapSeriesSpec } from '../../series/map/interface';
9
9
  import type { IPie3dSeriesSpec, IPieSeriesSpec } from '../../series/pie/interface';
@@ -12,7 +12,7 @@ import type { IRadarSeriesSpec } from '../../series/radar/interface';
12
12
  import type { IRoseSeriesSpec } from '../../series/rose/interface';
13
13
  import type { IScatterSeriesSpec } from '../../series/scatter/interface';
14
14
  import type { IWordCloud3dSeriesSpec, IWordCloudSeriesSpec } from '../../series/word-cloud/interface';
15
- import type { IGaugePointerSeriesSpec, IGaugeSeriesSpec } from '../../series/gauge';
15
+ import type { IGaugePointerSeriesSpec, IGaugeSeriesSpec } from '../../series/gauge/interface';
16
16
  import type { IBoxPlotSeriesSpec } from '../../series/box-plot/interface';
17
17
  import type { ICirclePackingSeriesSpec } from '../../series/circle-packing/interface';
18
18
  import type { IFunnelSeriesSpec, IFunnel3dSeriesSpec } from '../../series/funnel/interface';
@@ -24,7 +24,8 @@ import type { ISunburstSeriesSpec } from '../../series/sunburst/interface';
24
24
  import type { ITreemapSeriesSpec } from '../../series/treemap/interface';
25
25
  import type { IWaterfallSeriesSpec } from '../../series/waterfall/interface';
26
26
  import type { ICorrelationSeriesSpec } from '../../series/correlation/interface';
27
- import type { ICartesianAxisSpec, IPolarAxisSpec } from '../../component';
27
+ import type { ICartesianAxisSpec } from '../../component/axis/cartesian/interface';
28
+ import type { IPolarAxisSpec } from '../../component/axis/polar/interface';
28
29
  import type { ICartesianCrosshairSpec, IPolarCrosshairSpec } from '../../component/crosshair/interface';
29
30
  import type { IMarkLineSpec } from '../../component/marker/mark-line/interface';
30
31
  import type { IMarkAreaSpec } from '../../component/marker/mark-area/interface';
@@ -1,8 +1,8 @@
1
1
  import type { IPolarAxisSpec } from '../../component/axis/polar/interface';
2
- import type { IGaugePointerSeriesSpec, IGaugeSeriesSpec } from '../../series/gauge';
2
+ import type { IGaugePointerSeriesSpec, IGaugeSeriesSpec } from '../../series/gauge/interface';
3
3
  import type { ILinearAxisSpec } from '../../component/axis/interface';
4
4
  import type { ICircularProgressSeriesSpec } from '../../series/progress/circular/interface';
5
- import type { IPolarChartSpec } from '../polar';
5
+ import type { IPolarChartSpec } from '../polar/interface';
6
6
  export interface IGaugeChartSpec extends Omit<IPolarChartSpec, 'axes'>, Omit<IGaugePointerSeriesSpec, 'data' | 'type' | 'morph' | 'tooltip'> {
7
7
  type: 'gauge';
8
8
  gauge?: Omit<IGaugeSeriesSpec, 'data'> | Omit<ICircularProgressSeriesSpec, 'data'>;
@@ -3,8 +3,8 @@ import type { IRenderOption } from '../../compile/interface';
3
3
  import type { IModelOption, IModelSpecInfo } from '../../model/interface';
4
4
  import type { IView } from '@visactor/vgrammar-core';
5
5
  import type { IBoundsLike } from '@visactor/vutils';
6
- import type { ISeriesSpecInfo } from '../../series';
7
- import type { IRegionSpecInfo } from '../../region';
6
+ import type { ISeriesSpecInfo } from '../../series/interface';
7
+ import type { IRegionSpecInfo } from '../../region/interface';
8
8
  export interface ILayoutParams {
9
9
  srView?: IView;
10
10
  group?: any;
@@ -2,7 +2,7 @@ import type { IPointLike } from '@visactor/vutils';
2
2
  import type { IPolarAxisSpec } from '../../component/axis/polar/interface';
3
3
  import type { IPolarCrosshairSpec } from '../../component/crosshair/interface';
4
4
  import type { IChartSpec, ILayoutRect } from '../../typings';
5
- import type { IIndicatorSpec } from '../../component';
5
+ import type { IIndicatorSpec } from '../../component/indicator/interface';
6
6
  export interface IPolarChartSpec extends IChartSpec {
7
7
  axes?: IPolarAxisSpec[];
8
8
  crosshair?: IPolarCrosshairSpec | IPolarCrosshairSpec[];
@@ -1,6 +1,7 @@
1
1
  import type { IChartSpec, ISeriesSpec } from '../../typings/spec/common';
2
2
  import type { ICartesianAxisSpec } from '../../component/axis/cartesian/interface';
3
- import type { IDataZoomSpec, IScrollBarSpec } from '../../component/data-zoom';
3
+ import type { IDataZoomSpec } from '../../component/data-zoom/data-zoom/interface';
4
+ import type { IScrollBarSpec } from '../../component/data-zoom/scroll-bar/interface';
4
5
  import type { ICartesianCrosshairSpec } from '../../component/crosshair/interface';
5
6
  import type { ILayoutSpec } from '../../layout/interface';
6
7
  import type { RegionSpec } from '../../region/interface';
@@ -1,9 +1,8 @@
1
- import type { Compiler } from './compiler';
2
- import type { ICompilableInitOption, ICompilable } from './interface';
1
+ import type { ICompilableInitOption, ICompilable, ICompiler } from './interface';
3
2
  export declare abstract class CompilableBase implements ICompilable {
4
3
  protected _option: ICompilableInitOption;
5
4
  getOption(): ICompilableInitOption;
6
- getCompiler: () => Compiler;
5
+ getCompiler: () => ICompiler;
7
6
  constructor(option: ICompilableInitOption);
8
7
  getVGrammarView(): import("@visactor/vgrammar-core").IView;
9
8
  abstract compile(): void;
@@ -1,16 +1,16 @@
1
1
  import type { InteractionSpec, IView } from '@visactor/vgrammar-core';
2
- import type { CompilerListenerParameters, CompilerModel, IGrammarItem, IRenderContainer, IRenderOption } from './interface';
2
+ import type { CompilerListenerParameters, ICompiler, ICompilerModel, IGrammarItem, IRenderContainer, IRenderOption } from './interface';
3
3
  import type { IBoundsLike } from '@visactor/vutils';
4
4
  import type { EventSourceType } from '../event/interface';
5
5
  import type { IChart } from '../chart/interface';
6
- import type { IColor, Stage } from '@visactor/vrender-core';
6
+ import type { IColor, IStage } from '@visactor/vrender-core';
7
7
  import type { IMorphConfig } from '../animation/spec';
8
8
  import type { IVChart } from '../core/interface';
9
9
  type EventListener = {
10
10
  type: string;
11
11
  callback: (...args: any[]) => void;
12
12
  };
13
- export declare class Compiler {
13
+ export declare class Compiler implements ICompiler {
14
14
  protected _view: IView;
15
15
  getVGrammarView(): IView;
16
16
  protected _viewListeners: Map<(...args: any[]) => any, EventListener>;
@@ -23,21 +23,21 @@ export declare class Compiler {
23
23
  protected _container: IRenderContainer;
24
24
  protected _option: IRenderOption;
25
25
  private _released;
26
- protected _model: CompilerModel;
26
+ protected _model: ICompilerModel;
27
27
  protected _interactions: (InteractionSpec & {
28
28
  seriesId?: number;
29
29
  regionId?: number;
30
30
  })[];
31
- getModel(): CompilerModel;
31
+ getModel(): ICompilerModel;
32
32
  private _compileChart;
33
33
  constructor(container: IRenderContainer, option: IRenderOption);
34
34
  getRenderer(): import("@visactor/vgrammar-core").IRenderer;
35
35
  getCanvas(): HTMLCanvasElement | undefined;
36
- getStage(): Stage | undefined;
36
+ getStage(): IStage | undefined;
37
37
  initView(): void;
38
- handleStageRender: () => void;
38
+ protected handleStageRender: () => void;
39
39
  private _setCanvasStyle;
40
- compileInteractions(): void;
40
+ protected compileInteractions(): void;
41
41
  compile(ctx: {
42
42
  chart: IChart;
43
43
  vChart: IVChart;
@@ -1,8 +1,66 @@
1
- import type { IGroupMark, IGrammarBase, IView } from '@visactor/vgrammar-core';
2
- import type { Compiler } from '../compiler';
3
- import type { Maybe, IPerformanceHook } from '../../typings';
1
+ import type { IGroupMark, IGrammarBase, IView, IRenderer, InteractionSpec } from '@visactor/vgrammar-core';
2
+ import type { Maybe, IPerformanceHook, StringOrNumber } from '../../typings';
3
+ import type { IColor, IStage } from '@visactor/vrender-core';
4
+ import type { IChart } from '../../chart/interface/chart';
5
+ import type { IVChart } from '../../core/interface';
6
+ import type { IMorphConfig } from '../../animation/spec';
7
+ import type { IBoundsLike } from '@visactor/vutils';
8
+ import type { EventSourceType, EventType } from '../../event/interface';
9
+ export type CompilerListenerParameters = {
10
+ type: EventType;
11
+ event: Event;
12
+ source: EventSourceType;
13
+ item: any | null;
14
+ datum: any | null;
15
+ markId: number | null;
16
+ modelId: number | null;
17
+ markUserId: StringOrNumber | null;
18
+ modelUserId: StringOrNumber | null;
19
+ };
20
+ export interface IProductMap<T extends IGrammarItem> {
21
+ [productId: string]: IGrammarItemMap<T>;
22
+ }
23
+ export interface IGrammarItemMap<T extends IGrammarItem> {
24
+ [id: number]: T;
25
+ }
26
+ export type ICompilerModel = Record<GrammarType, IProductMap<IGrammarItem>>;
27
+ export interface ICompiler {
28
+ isInited?: boolean;
29
+ getVGrammarView: () => IView;
30
+ getModel: () => ICompilerModel;
31
+ getRenderer: () => IRenderer;
32
+ getCanvas: () => HTMLCanvasElement | undefined;
33
+ getStage: () => IStage | undefined;
34
+ compile: (ctx: {
35
+ chart: IChart;
36
+ vChart: IVChart;
37
+ }, option: any) => void;
38
+ clear: (ctx: {
39
+ chart: IChart;
40
+ vChart: IVChart;
41
+ }, removeGraphicItems?: boolean) => void;
42
+ renderNextTick: (morphConfig?: IMorphConfig) => void;
43
+ render: (morphConfig?: IMorphConfig) => void;
44
+ updateViewBox: (viewBox: IBoundsLike, reRender?: boolean) => void;
45
+ resize: (width: number, height: number, reRender?: boolean) => void;
46
+ setBackground: (color: IColor) => void;
47
+ setSize: (width: number, height: number) => void;
48
+ setViewBox: (viewBox: IBoundsLike, reRender?: boolean) => void;
49
+ addEventListener: (source: EventSourceType, type: string, callback: (params: CompilerListenerParameters) => void) => void;
50
+ removeEventListener: (source: EventSourceType, type: string, callback: (params: CompilerListenerParameters) => void) => void;
51
+ release: () => void;
52
+ releaseGrammar: (removeGraphicItems: boolean) => void;
53
+ addGrammarItem: (grammarItem: IGrammarItem) => void;
54
+ removeGrammarItem: (grammarItem: IGrammarItem, reserveVGrammarModel?: boolean) => void;
55
+ addInteraction: (interaction: InteractionSpec & {
56
+ seriesId?: number;
57
+ regionId?: number;
58
+ }) => void;
59
+ removeInteraction: (seriesId: number) => void;
60
+ updateDepend: (items?: IGrammarItem[]) => boolean;
61
+ }
4
62
  export interface ICompilable {
5
- getCompiler: () => Compiler;
63
+ getCompiler: () => ICompiler;
6
64
  getVGrammarView: () => IView;
7
65
  compile: () => void;
8
66
  compileMarks?: (group?: string | IGroupMark) => void;
@@ -13,7 +71,7 @@ export interface ICompilable {
13
71
  release: () => void;
14
72
  }
15
73
  export interface ICompilableInitOption {
16
- getCompiler: () => Compiler;
74
+ getCompiler: () => ICompiler;
17
75
  performanceHook?: IPerformanceHook;
18
76
  }
19
77
  export declare enum GrammarType {
@@ -1,8 +1,7 @@
1
+ import type { Hooks } from '@visactor/vgrammar-core';
1
2
  import type { IColor, IStageParams, IStage, ILayer } from '@visactor/vrender-core';
2
- import type { EventSourceType, EventType } from '../../event/interface';
3
3
  import type { RenderMode } from '../../typings/spec/common';
4
4
  import type { IBoundsLike } from '@visactor/vutils';
5
- import type { GrammarType, IGrammarItem } from './compilable-item';
6
5
  import type { StringOrNumber } from '../../typings';
7
6
  export interface IRenderContainer {
8
7
  dom?: HTMLElement | 'none';
@@ -52,22 +51,7 @@ export interface IRenderOption {
52
51
  supportsTouchEvents?: boolean;
53
52
  supportsPointerEvents?: boolean;
54
53
  ReactDOM?: any;
55
- }
56
- export type CompilerListenerParameters = {
57
- type: EventType;
58
- event: Event;
59
- source: EventSourceType;
60
- item: any | null;
61
- datum: any | null;
62
- markId: number | null;
63
- modelId: number | null;
64
- markUserId: StringOrNumber | null;
65
- modelUserId: StringOrNumber | null;
66
- };
67
- export type CompilerModel = Record<GrammarType, IProductMap<IGrammarItem>>;
68
- export interface IProductMap<T extends IGrammarItem> {
69
- [productId: string]: IGrammarItemMap<T>;
70
- }
71
- export interface IGrammarItemMap<T extends IGrammarItem> {
72
- [id: number]: T;
54
+ clickInterval?: number;
55
+ autoPreventDefault?: boolean;
56
+ performanceHook?: Hooks;
73
57
  }
@@ -5,8 +5,7 @@ import type { Maybe, Datum, StringOrNumber } from '../../typings';
5
5
  import type { IMarkStateStyle, MarkType } from '../../mark/interface';
6
6
  import type { IModel } from '../../model/interface';
7
7
  import { MarkStateManager } from './mark-state-manager';
8
- import type { ICompilableMark, IMarkDataInitOption, ICompilableMarkOption, StateValueType, IMarkCompileOption, IAttributeOpt } from './interface';
9
- import { MarkData } from './mark-data';
8
+ import type { ICompilableMark, IMarkDataInitOption, ICompilableMarkOption, StateValueType, IMarkCompileOption, IAttributeOpt, IMarkData } from './interface';
10
9
  import { GrammarType } from '../interface/compilable-item';
11
10
  import type { IEvent } from '../../event/interface';
12
11
  export declare abstract class CompilableMark extends GrammarItem implements ICompilableMark {
@@ -24,11 +23,11 @@ export declare abstract class CompilableMark extends GrammarItem implements ICom
24
23
  getUserId(): StringOrNumber;
25
24
  setUserId(userId: StringOrNumber): void;
26
25
  readonly model: IModel;
27
- protected _data: Maybe<MarkData>;
26
+ protected _data: IMarkData;
28
27
  getDataView(): DataView | undefined;
29
28
  setDataView(d?: DataView, productId?: string): void;
30
- getData(): MarkData;
31
- setData(d?: MarkData): void;
29
+ getData(): IMarkData;
30
+ setData(d?: IMarkData): void;
32
31
  stateStyle: IMarkStateStyle<any>;
33
32
  state: MarkStateManager;
34
33
  protected _unCompileChannel: {
@@ -1,13 +1,25 @@
1
1
  import type { IMarkStateStyle, MarkType } from '../../mark/interface';
2
2
  import type { IModel } from '../../model/interface';
3
- import type { GrammarItemCompileOption, GrammarItemInitOption } from '../interface';
4
- import type { IGrammarItem } from '../interface';
5
- import type { MarkStateManager } from './mark-state-manager';
3
+ import type { GrammarItemCompileOption, GrammarItemInitOption, IGrammarItem } from '../interface';
6
4
  import type { DataView } from '@visactor/vdataset';
7
5
  import type { IAnimate, IAnimateArranger, IElement, IGroupMark, IMark, IMarkConfig, MarkAnimationSpec, Nil, TransformSpec } from '@visactor/vgrammar-core';
8
6
  import type { Maybe, Datum, StringOrNumber } from '../../typings';
9
- import type { MarkData } from './mark-data';
10
7
  import type { IRegion } from '../../region/interface';
8
+ import type { ICompilableData } from '../data/interface';
9
+ export interface IMarkStateManager {
10
+ getStateInfoList: () => IStateInfo[];
11
+ getStateInfo: (stateValue: StateValue) => IStateInfo;
12
+ addStateInfo: (stateInfo: IStateInfo) => void;
13
+ changeStateInfo: (stateInfo: Partial<IStateInfo>) => void;
14
+ clearStateInfo: (stateValues: StateValue[]) => void;
15
+ checkOneState: (renderNode: IElement, datum: Datum | Datum[], state: IStateInfo, isMultiMark?: boolean) => 'in' | 'out' | 'skip';
16
+ checkState: (renderNode: IElement, datum: Datum | Datum[]) => StateValue[];
17
+ updateLayoutState: (noRender?: boolean) => void;
18
+ }
19
+ export interface IMarkData extends ICompilableData {
20
+ setCompiledProductId: (name: string) => any;
21
+ generateProductId: () => string;
22
+ }
11
23
  export interface ICompilableMarkOption extends GrammarItemInitOption {
12
24
  key?: string | ((datum: Datum) => string);
13
25
  groupKey?: string;
@@ -21,11 +33,11 @@ export interface ICompilableMark extends IGrammarItem {
21
33
  readonly name: string;
22
34
  readonly key?: string | ((datum: Datum) => string);
23
35
  readonly model: IModel;
24
- getData: () => MarkData | undefined;
25
- setData: (d: MarkData) => void;
36
+ getData: () => IMarkData | undefined;
37
+ setData: (d: IMarkData) => void;
26
38
  getDataView: () => DataView | undefined;
27
39
  setDataView: (d?: DataView, productId?: string) => void;
28
- state: MarkStateManager;
40
+ state: IMarkStateManager;
29
41
  readonly stateStyle: IMarkStateStyle<any>;
30
42
  hasState: (state: string) => boolean;
31
43
  getState: (state: string) => any;
@@ -1,6 +1,6 @@
1
1
  import { CompilableData } from '../data/compilable-data';
2
- import type { ICompilableMark, IMarkDataInitOption } from './interface';
3
- export declare class MarkData extends CompilableData {
2
+ import type { ICompilableMark, IMarkData, IMarkDataInitOption } from './interface';
3
+ export declare class MarkData extends CompilableData implements IMarkData {
4
4
  protected _mark: ICompilableMark;
5
5
  constructor(option: IMarkDataInitOption);
6
6
  setCompiledProductId(name: string): void;
@@ -3,8 +3,8 @@ import type { Datum, StringOrNumber } from '../../typings';
3
3
  import type { IStateManagerOption } from '../signal/interface';
4
4
  import { StateManager } from '../signal/state-manager';
5
5
  import type { CompilableMark } from './compilable-mark';
6
- import type { IStateInfo, StateValue } from './interface';
7
- export declare class MarkStateManager extends StateManager {
6
+ import type { IMarkStateManager, IStateInfo, StateValue } from './interface';
7
+ export declare class MarkStateManager extends StateManager implements IMarkStateManager {
8
8
  protected _mark: CompilableMark;
9
9
  private _stateInfoList;
10
10
  getStateInfoList(): IStateInfo[];
@@ -9,7 +9,7 @@ import { type IComponentOption } from '../interface';
9
9
  import type { ISeries } from '../../series/interface';
10
10
  import type { ITransformOptions } from '@visactor/vdataset';
11
11
  import { DataView } from '@visactor/vdataset';
12
- import type { IComponentMark } from '../../mark/component';
12
+ import type { IComponentMark } from '../../mark/interface/mark';
13
13
  export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<string, any> = any> extends BaseComponent<T> implements IAxis {
14
14
  static specKey: string;
15
15
  specKey: string;
@@ -1,4 +1,4 @@
1
- import type { ContinuousScale, IBaseScale, CustomTicksFunc } from '@visactor/vscale';
1
+ import type { IContinuousScale, IBaseScale, CustomTicksFunc } from '@visactor/vscale';
2
2
  import type { CoordinateType, Datum, IPolarOrientType, StringOrNumber } from '../../../typings';
3
3
  import type { IComponent } from '../../interface/common';
4
4
  import type { ICartesianAxisSpec } from '../cartesian/interface';
@@ -42,7 +42,7 @@ export interface ITickCalculationCfg {
42
42
  tickStep?: number;
43
43
  tickCount?: number | ((option: ITickCallbackOption) => number);
44
44
  forceTickCount?: number;
45
- tickMode?: 'average' | 'd3' | CustomTicksFunc<ContinuousScale>;
45
+ tickMode?: 'average' | 'd3' | CustomTicksFunc<IContinuousScale>;
46
46
  noDecimals?: boolean;
47
47
  }
48
48
  export interface IBandAxisLayer extends Omit<ITickCalculationCfg, 'noDecimals' | 'tickMode'> {
@@ -1,7 +1,7 @@
1
1
  import type { IBaseScale } from '@visactor/vscale';
2
2
  import type { IPoint, IPolarOrientType, IPolarPoint } from '../../../../typings';
3
3
  import type { IAxis, IGrid } from '../../interface';
4
- import type { ICompilableData } from '../../../../compile/data';
4
+ import type { ICompilableData } from '../../../../compile/data/interface';
5
5
  export type IPolarGrid = IGrid & {
6
6
  smooth?: boolean;
7
7
  };
@@ -1,5 +1,5 @@
1
1
  import type { StringOrNumber } from '../../../typings';
2
- import type { IAxis } from '../../axis';
2
+ import type { IAxis } from '../../axis/interface';
3
3
  export interface ICrosshairLabelInfo {
4
4
  visible: boolean;
5
5
  text: StringOrNumber;
@@ -1,5 +1,5 @@
1
1
  import type { StringOrNumber } from '../../../typings';
2
- import type { IAxis } from '../../axis';
2
+ import type { IAxis } from '../../axis/interface';
3
3
  export type AxisCurrentValueMap = Map<number, {
4
4
  value: StringOrNumber;
5
5
  axis: IAxis;
@@ -1,5 +1,5 @@
1
1
  import type { IPoint, StringOrNumber } from '../../../typings';
2
- import type { IPolarAxis } from '../../axis';
2
+ import type { IPolarAxis } from '../../axis/polar/interface';
3
3
  export interface IPolarCrosshairInfo {
4
4
  x: number;
5
5
  y: number;
@@ -1,4 +1,4 @@
1
- import type { ICartesianCrosshairSpec, ICommonCrosshairSpec, ICrosshairCategoryFieldSpec, ICrosshairValueFieldSpec, IPolarCrosshairSpec } from '.';
1
+ import type { ICartesianCrosshairSpec, ICommonCrosshairSpec, ICrosshairCategoryFieldSpec, ICrosshairValueFieldSpec, IPolarCrosshairSpec } from './spec';
2
2
  export interface ICrosshairTheme extends ICommonCrosshairSpec {
3
3
  bandField?: Partial<ICrosshairCategoryFieldSpec>;
4
4
  linearField?: Partial<ICrosshairValueFieldSpec>;
@@ -2,8 +2,7 @@ import type { IMarkSpec } from '../../../typings/spec';
2
2
  import type { IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec } from '../../../typings/visual';
3
3
  import type { IComponentSpec } from '../../base/interface';
4
4
  import type { ComponentThemeWithDirection, IComponent } from '../../interface';
5
- import type { IFilterMode } from '../interface';
6
- import type { IDataFilterComponent, IDataFilterComponentSpec } from '../interface';
5
+ import type { IFilterMode, IDataFilterComponent, IDataFilterComponentSpec } from '../interface';
7
6
  export type IDataZoom = IComponent & IDataFilterComponent;
8
7
  export interface IDataZoomStyle {
9
8
  showDetail?: 'auto' | boolean;
@@ -2,8 +2,7 @@ import type { ILayoutItemSpec } from '../../../layout/interface';
2
2
  import type { IPadding } from '../../../typings';
3
3
  import type { IRectMarkSpec } from '../../../typings/visual';
4
4
  import type { ComponentThemeWithDirection } from '../../interface';
5
- import type { IFilterMode } from '../interface';
6
- import type { IDataFilterComponentSpec } from '../interface';
5
+ import type { IFilterMode, IDataFilterComponentSpec } from '../interface';
7
6
  export interface IScrollBarStyle {
8
7
  rail?: Omit<IRectMarkSpec, 'width' | 'height'>;
9
8
  slider?: Omit<IRectMarkSpec, 'width' | 'height'>;
@@ -1,21 +1,25 @@
1
- import type { IAxisCommonTheme, ICartesianAxisCommonTheme, IPolarAxisCommonTheme } from '../axis';
2
- import type { IBrushTheme } from '../brush';
1
+ import type { IAxisCommonTheme } from '../axis/interface';
2
+ import type { IBrushTheme } from '../brush/interface';
3
3
  import type { ICrosshairTheme } from '../crosshair/interface';
4
- import type { IDataZoomTheme, IScrollBarTheme } from '../data-zoom';
4
+ import type { IDataZoomTheme } from '../data-zoom/data-zoom/interface';
5
+ import type { IScrollBarTheme } from '../data-zoom/scroll-bar/interface';
5
6
  import type { IIndicatorTheme } from '../indicator/interface';
6
- import type { IDiscreteLegendTheme, IColorLegendTheme, ISizeLegendTheme } from '../legend';
7
- import type { IMapLabelTheme } from '../map-label';
7
+ import type { IDiscreteLegendTheme } from '../legend/discrete/interface';
8
+ import type { IColorLegendTheme, ISizeLegendTheme } from '../legend/continuous/interface';
9
+ import type { IMapLabelTheme } from '../map-label/interface';
8
10
  import type { IMarkAreaTheme } from '../marker/mark-area/interface';
9
11
  import type { IMarkLineTheme } from '../marker/mark-line/interface';
10
12
  import type { IMarkPointTheme } from '../marker/mark-point/interface';
11
- import type { IPlayerTheme } from '../player';
12
- import type { ITitleTheme } from '../title';
13
+ import type { IPlayerTheme } from '../player/interface';
14
+ import type { ITitleTheme } from '../title/interface';
13
15
  import type { ITooltipTheme } from '../tooltip/interface';
14
16
  import type { ComponentTypeEnum } from './type';
15
- import type { ITotalLabelTheme } from '../label';
17
+ import type { ITotalLabelTheme } from '../label/interface';
16
18
  import type { IPoptipTheme } from '../poptip/interface';
17
- import type { IColorKey } from '../../theme';
19
+ import type { IColorKey } from '../../theme/color-scheme/interface';
18
20
  import type { Direction, IOrientType } from '../../typings';
21
+ import type { ICartesianAxisCommonTheme } from '../axis/cartesian/interface/theme';
22
+ import type { IPolarAxisCommonTheme } from '../axis/polar/interface/theme';
19
23
  export interface IComponentTheme {
20
24
  axis?: IAxisCommonTheme;
21
25
  axisBand?: IAxisCommonTheme;
@@ -1,8 +1,20 @@
1
1
  import type { BaseLabelAttrs } from '@visactor/vrender-components';
2
2
  import type { ConvertToMarkStyleSpec, Datum, IComposedTextMarkSpec, IFormatMethod, ITextMarkSpec } from '../../typings';
3
3
  import type { IComponentSpec } from '../base/interface';
4
- import type { ILabelMark } from '../../mark/label';
5
- import type { ISeries } from '../../series';
4
+ import type { ILabelMark } from '../../mark/interface';
5
+ import type { ISeries } from '../../series/interface';
6
+ import type { ICompilableMark } from '../../compile/mark/interface';
7
+ import type { IRegion } from '../../region/interface';
8
+ export interface ILabelInfo {
9
+ baseMark: ICompilableMark;
10
+ labelMark: ILabelMark;
11
+ series: ISeries;
12
+ labelSpec: TransformedLabelSpec;
13
+ }
14
+ export interface ILabelComponentContext {
15
+ region: IRegion;
16
+ labelInfo: ILabelInfo[];
17
+ }
6
18
  export interface ILabelFormatMethodContext {
7
19
  series?: ISeries;
8
20
  }
@@ -2,27 +2,14 @@ import type { IComponentOption } from '../interface';
2
2
  import { ComponentTypeEnum } from '../interface/type';
3
3
  import type { IRegion } from '../../region/interface';
4
4
  import type { IModelInitOption, IModelSpecInfo } from '../../model/interface';
5
- import type { ISeries } from '../../series/interface';
5
+ import type { IComponentMark } from '../../mark/interface';
6
6
  import type { ILabel, IMark as IVGrammarMark } from '@visactor/vgrammar-core';
7
- import type { IComponentMark } from '../../mark/component';
8
7
  import { BaseLabelComponent } from './base-label';
9
8
  import type { Maybe } from '@visactor/vutils';
10
- import type { TransformedLabelSpec } from './interface';
11
- import type { ILabelMark } from '../../mark/label';
12
- import type { ICompilableMark } from '../../compile/mark';
9
+ import type { ILabelInfo } from './interface';
13
10
  import type { IChartSpecInfo } from '../../chart/interface';
14
11
  import type { IChartSpec } from '../../typings';
15
12
  import { LabelSpecTransformer } from './label-transformer';
16
- export interface ILabelInfo {
17
- baseMark: ICompilableMark;
18
- labelMark: ILabelMark;
19
- series: ISeries;
20
- labelSpec: TransformedLabelSpec;
21
- }
22
- export interface ILabelComponentContext {
23
- region: IRegion;
24
- labelInfo: ILabelInfo[];
25
- }
26
13
  export declare class Label<T extends IChartSpec = any> extends BaseLabelComponent<T> {
27
14
  static type: ComponentTypeEnum;
28
15
  type: ComponentTypeEnum;
@@ -1,8 +1,7 @@
1
1
  import type { WaterfallSeries } from './../../series/waterfall/waterfall';
2
2
  import type { Datum } from '../../typings/common';
3
- import type { ILabelInfo } from './label';
4
3
  import type { LabelItem, Strategy } from '@visactor/vrender-components';
5
- import type { ILabelSpec } from './interface';
4
+ import type { ILabelInfo, ILabelSpec } from './interface';
6
5
  export declare const labelRuleMap: {
7
6
  rect: typeof barLabel;
8
7
  symbol: typeof symbolLabel;
@@ -2,13 +2,16 @@ import type { LegendTitle } from '@visactor/vrender-components';
2
2
  import type { Datum, IOrientType, IPadding, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, StringOrNumber } from '../../typings';
3
3
  import type { IComponent } from '../interface';
4
4
  import type { IComponentSpec } from '../base/interface';
5
- import type { IDiscreteLegendSpec } from './discrete';
6
- import type { IColorLegendSpec, ISizeLegendSpec } from './continuous';
5
+ import type { IDiscreteLegendSpec } from './discrete/interface';
6
+ import type { IColorLegendSpec, ISizeLegendSpec } from './continuous/interface';
7
7
  export type ILegend = IComponent & {
8
8
  getLegendData: () => Datum[];
9
9
  getSelectedData: () => StringOrNumber[];
10
10
  setSelectedData: (d: StringOrNumber[]) => void;
11
11
  };
12
+ export interface IDiscreteLegend extends ILegend {
13
+ getLegendDefaultData: (originalData?: boolean) => StringOrNumber[];
14
+ }
12
15
  export type NoVisibleMarkStyle<T> = Omit<T, 'visible'>;
13
16
  export type ITitle = {
14
17
  textStyle?: NoVisibleMarkStyle<ITextMarkSpec>;
@@ -15,9 +15,9 @@ export declare function transformLegendTitleAttributes(title: ITitle): {
15
15
  visible?: boolean;
16
16
  style?: Omit<import("./interface").NoVisibleMarkStyle<import("../..").IRectMarkSpec>, "width" | "height" | "visible">;
17
17
  };
18
- text?: string | number | number[] | string[] | {
18
+ text?: string | number | string[] | number[] | {
19
19
  type?: "text";
20
- text: string | number | number[] | string[];
20
+ text: string | number | string[] | number[];
21
21
  } | {
22
22
  type: "rich";
23
23
  text: import("@visactor/vrender-core").IRichTextCharacter[];
@@ -6,7 +6,7 @@ import type { CoordinateType, ILayoutRect, ILayoutType, IRect } from '../../typi
6
6
  import { BaseComponent } from '../base/base-component';
7
7
  import type { IDataPos, IDataPosCallback, IMarkerAttributeContext, IMarkerSpec, IMarkerSupportSeries } from './interface';
8
8
  import type { IGraphic, IGroup } from '@visactor/vrender-core';
9
- import type { IOptionWithCoordinates } from '../../data/transforms/aggregation';
9
+ import type { IOptionWithCoordinates } from '../../data/transforms/interface';
10
10
  export declare abstract class BaseMarker<T extends IMarkerSpec> extends BaseComponent<T> {
11
11
  layoutType: ILayoutType | 'none';
12
12
  static specKey: string;