@visactor/vchart-types 1.8.0-alpha.0 → 1.8.0-beta.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 (277) 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/area/area-transformer.d.ts +6 -0
  5. package/types/chart/area/area.d.ts +6 -4
  6. package/types/chart/area/index.d.ts +1 -0
  7. package/types/chart/bar/3d/bar-3d-transformer.d.ts +6 -0
  8. package/types/chart/bar/3d/bar-3d.d.ts +14 -0
  9. package/types/chart/bar/3d/index.d.ts +2 -0
  10. package/types/chart/bar/bar-transformer.d.ts +6 -0
  11. package/types/chart/bar/bar.d.ts +7 -4
  12. package/types/chart/bar/index.d.ts +2 -1
  13. package/types/chart/base/base-chart-transformer.d.ts +21 -0
  14. package/types/chart/base/base-chart.d.ts +148 -0
  15. package/types/chart/base/index.d.ts +2 -0
  16. package/types/chart/box-plot/box-plot-transformer.d.ts +6 -0
  17. package/types/chart/box-plot/box-plot.d.ts +6 -4
  18. package/types/chart/box-plot/index.d.ts +1 -0
  19. package/types/chart/cartesian/cartesian-transformer.d.ts +8 -0
  20. package/types/chart/cartesian/index.d.ts +1 -1
  21. package/types/chart/circle-packing/circle-packing-transformer.d.ts +7 -0
  22. package/types/chart/circle-packing/circle-packing.d.ts +6 -5
  23. package/types/chart/circle-packing/index.d.ts +1 -0
  24. package/types/chart/common/common-transformer.d.ts +7 -0
  25. package/types/chart/common/common.d.ts +7 -4
  26. package/types/chart/common/index.d.ts +1 -0
  27. package/types/chart/correlation/correlation-transformer.d.ts +6 -0
  28. package/types/chart/correlation/correlation.d.ts +6 -4
  29. package/types/chart/correlation/index.d.ts +1 -0
  30. package/types/chart/funnel/3d/funnel-3d.d.ts +14 -0
  31. package/types/chart/funnel/3d/index.d.ts +1 -0
  32. package/types/chart/funnel/funnel-transformer.d.ts +8 -0
  33. package/types/chart/funnel/funnel.d.ts +7 -2
  34. package/types/chart/funnel/index.d.ts +2 -1
  35. package/types/chart/funnel/interface.d.ts +1 -1
  36. package/types/chart/gauge/gauge-transformer.d.ts +9 -0
  37. package/types/chart/gauge/gauge.d.ts +8 -6
  38. package/types/chart/gauge/index.d.ts +1 -0
  39. package/types/chart/gauge/interface.d.ts +2 -2
  40. package/types/chart/heatmap/heatmap-transformer.d.ts +5 -0
  41. package/types/chart/heatmap/heatmap.d.ts +7 -3
  42. package/types/chart/heatmap/index.d.ts +1 -0
  43. package/types/chart/histogram/3d/histogram-3d.d.ts +14 -0
  44. package/types/chart/histogram/3d/index.d.ts +1 -0
  45. package/types/chart/histogram/base/base.d.ts +8 -0
  46. package/types/chart/histogram/base/histogram-base-transformer.d.ts +6 -0
  47. package/types/chart/histogram/base/index.d.ts +2 -0
  48. package/types/chart/histogram/histogram-transformer.d.ts +5 -0
  49. package/types/chart/histogram/histogram.d.ts +7 -3
  50. package/types/chart/histogram/index.d.ts +2 -1
  51. package/types/chart/index.d.ts +2 -4
  52. package/types/chart/interface/chart.d.ts +20 -7
  53. package/types/chart/interface/common.d.ts +17 -1
  54. package/types/chart/line/index.d.ts +1 -0
  55. package/types/chart/line/interface.d.ts +1 -1
  56. package/types/chart/line/line-transformer.d.ts +6 -0
  57. package/types/chart/line/line.d.ts +6 -4
  58. package/types/chart/map/index.d.ts +1 -0
  59. package/types/chart/map/map-transformer.d.ts +8 -0
  60. package/types/chart/map/map.d.ts +6 -6
  61. package/types/chart/pie/3d/index.d.ts +1 -0
  62. package/types/chart/pie/3d/pie-3d.d.ts +17 -0
  63. package/types/chart/pie/base/base.d.ts +8 -0
  64. package/types/chart/pie/base/index.d.ts +2 -0
  65. package/types/chart/pie/base/pie-transformer.d.ts +7 -0
  66. package/types/chart/pie/index.d.ts +2 -1
  67. package/types/chart/pie/pie.d.ts +7 -2
  68. package/types/chart/polar/index.d.ts +1 -1
  69. package/types/chart/polar/polar-transformer.d.ts +9 -0
  70. package/types/chart/polar/progress-like/index.d.ts +1 -0
  71. package/types/chart/polar/progress-like/progress-like-transformer.d.ts +8 -0
  72. package/types/chart/polar/rose-like/index.d.ts +1 -0
  73. package/types/chart/polar/rose-like/rose-like-transformer.d.ts +7 -0
  74. package/types/chart/progress/circular/circular-progress-transformer.d.ts +7 -0
  75. package/types/chart/progress/circular/circular.d.ts +8 -4
  76. package/types/chart/progress/circular/index.d.ts +1 -0
  77. package/types/chart/progress/circular/interface.d.ts +1 -1
  78. package/types/chart/progress/linear/index.d.ts +1 -0
  79. package/types/chart/progress/linear/interface.d.ts +1 -1
  80. package/types/chart/progress/linear/linear-progress-transformer.d.ts +7 -0
  81. package/types/chart/progress/linear/linear.d.ts +6 -5
  82. package/types/chart/radar/index.d.ts +1 -0
  83. package/types/chart/radar/radar-transformer.d.ts +6 -0
  84. package/types/chart/radar/radar.d.ts +8 -4
  85. package/types/chart/range-area/index.d.ts +1 -0
  86. package/types/chart/range-area/range-area-transformer.d.ts +6 -0
  87. package/types/chart/range-area/range-area.d.ts +7 -4
  88. package/types/chart/range-column/3d/index.d.ts +2 -0
  89. package/types/chart/range-column/3d/range-column-3d-transformer.d.ts +5 -0
  90. package/types/chart/range-column/3d/range-column-3d.d.ts +13 -0
  91. package/types/chart/range-column/index.d.ts +2 -1
  92. package/types/chart/range-column/range-column-transformer.d.ts +6 -0
  93. package/types/chart/range-column/range-column.d.ts +7 -4
  94. package/types/chart/rose/index.d.ts +1 -0
  95. package/types/chart/rose/rose-transformer.d.ts +6 -0
  96. package/types/chart/rose/rose.d.ts +8 -4
  97. package/types/chart/sankey/index.d.ts +1 -0
  98. package/types/chart/sankey/sankey-transformer.d.ts +6 -0
  99. package/types/chart/sankey/sankey.d.ts +6 -4
  100. package/types/chart/scatter/index.d.ts +1 -0
  101. package/types/chart/scatter/scatter-transformer.d.ts +5 -0
  102. package/types/chart/scatter/scatter.d.ts +6 -3
  103. package/types/chart/sequence/index.d.ts +1 -0
  104. package/types/chart/sequence/sequence-transformer.d.ts +7 -0
  105. package/types/chart/sequence/sequence.d.ts +9 -7
  106. package/types/chart/sunburst/index.d.ts +1 -0
  107. package/types/chart/sunburst/sunburst-transformer.d.ts +7 -0
  108. package/types/chart/sunburst/sunburst.d.ts +6 -5
  109. package/types/chart/treemap/index.d.ts +1 -0
  110. package/types/chart/treemap/treemap-transformer.d.ts +7 -0
  111. package/types/chart/treemap/treemap.d.ts +7 -4
  112. package/types/chart/util.d.ts +3 -3
  113. package/types/chart/waterfall/index.d.ts +1 -0
  114. package/types/chart/waterfall/waterfall-transformer.d.ts +7 -0
  115. package/types/chart/waterfall/waterfall.d.ts +6 -3
  116. package/types/chart/word-cloud/3d/index.d.ts +2 -0
  117. package/types/chart/word-cloud/3d/word-cloud-3d-transformer.d.ts +6 -0
  118. package/types/chart/word-cloud/3d/word-cloud-3d.d.ts +15 -0
  119. package/types/chart/word-cloud/base/base.d.ts +9 -0
  120. package/types/chart/word-cloud/base/index.d.ts +2 -0
  121. package/types/chart/word-cloud/base/word-cloud-base-transformer.d.ts +5 -0
  122. package/types/chart/word-cloud/index.d.ts +2 -1
  123. package/types/chart/word-cloud/word-cloud-transformer.d.ts +5 -0
  124. package/types/chart/word-cloud/word-cloud.d.ts +6 -3
  125. package/types/compile/mark/compilable-mark.d.ts +0 -5
  126. package/types/compile/mark/interface.d.ts +1 -4
  127. package/types/component/axis/base-axis.d.ts +3 -4
  128. package/types/component/axis/cartesian/axis.d.ts +6 -7
  129. package/types/component/axis/cartesian/band-axis.d.ts +1 -0
  130. package/types/component/axis/cartesian/linear-axis.d.ts +1 -0
  131. package/types/component/axis/cartesian/log-axis.d.ts +1 -0
  132. package/types/component/axis/cartesian/symlog-axis.d.ts +1 -0
  133. package/types/component/axis/cartesian/time-axis.d.ts +1 -0
  134. package/types/component/axis/cartesian/util/common.d.ts +4 -0
  135. package/types/component/axis/interface/common.d.ts +1 -0
  136. package/types/component/axis/polar/axis.d.ts +7 -7
  137. package/types/component/axis/polar/band-axis.d.ts +1 -0
  138. package/types/component/axis/polar/interface/common.d.ts +0 -1
  139. package/types/component/axis/polar/linear-axis.d.ts +1 -0
  140. package/types/component/axis/polar/util/common.d.ts +5 -0
  141. package/types/component/axis/polar/util/index.d.ts +1 -0
  142. package/types/component/axis/util.d.ts +4 -3
  143. package/types/component/base/base-component-transformer.d.ts +10 -0
  144. package/types/component/base/base-component.d.ts +10 -7
  145. package/types/component/base/index.d.ts +1 -0
  146. package/types/component/base/util.d.ts +2 -2
  147. package/types/component/brush/brush.d.ts +7 -5
  148. package/types/component/crosshair/base.d.ts +5 -4
  149. package/types/component/crosshair/cartesian.d.ts +3 -2
  150. package/types/component/crosshair/polar.d.ts +3 -2
  151. package/types/component/crosshair/util.d.ts +3 -4
  152. package/types/component/custom-mark/custom-mark.d.ts +7 -5
  153. package/types/component/data-zoom/data-filter-base-component.d.ts +2 -2
  154. package/types/component/data-zoom/data-zoom/data-zoom-transformer.d.ts +9 -0
  155. package/types/component/data-zoom/data-zoom/data-zoom.d.ts +8 -2
  156. package/types/component/data-zoom/data-zoom/index.d.ts +1 -0
  157. package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +5 -1
  158. package/types/component/data-zoom/util.d.ts +2 -2
  159. package/types/component/geo/geo-coordinate.d.ts +4 -4
  160. package/types/component/index.d.ts +1 -1
  161. package/types/component/indicator/indicator.d.ts +5 -4
  162. package/types/component/interface/common.d.ts +6 -4
  163. package/types/component/interface/type.d.ts +8 -0
  164. package/types/component/label/base-label.d.ts +2 -2
  165. package/types/component/label/index.d.ts +2 -0
  166. package/types/component/label/interface.d.ts +2 -2
  167. package/types/component/label/label-transformer.d.ts +8 -0
  168. package/types/component/label/label.d.ts +13 -5
  169. package/types/component/label/total-label.d.ts +28 -0
  170. package/types/component/label/util.d.ts +1 -0
  171. package/types/component/legend/base-legend.d.ts +3 -1
  172. package/types/component/legend/continuous/legend.d.ts +4 -6
  173. package/types/component/legend/discrete/legend.d.ts +4 -7
  174. package/types/component/map-label/component.d.ts +5 -2
  175. package/types/component/marker/mark-area/mark-area.d.ts +6 -4
  176. package/types/component/marker/mark-line/mark-line.d.ts +6 -4
  177. package/types/component/marker/mark-point/mark-point.d.ts +6 -4
  178. package/types/component/player/player.d.ts +4 -4
  179. package/types/component/title/title.d.ts +9 -6
  180. package/types/component/tooltip/index.d.ts +1 -0
  181. package/types/component/tooltip/tooltip-transformer.d.ts +8 -0
  182. package/types/component/tooltip/tooltip.d.ts +10 -8
  183. package/types/component/util.d.ts +2 -2
  184. package/types/constant/event.d.ts +1 -0
  185. package/types/constant/polar.d.ts +0 -10
  186. package/types/core/factory.d.ts +12 -3
  187. package/types/core/index.d.ts +1 -0
  188. package/types/core/interface.d.ts +17 -11
  189. package/types/core/vchart.d.ts +30 -7
  190. package/types/mark/arc-3d.d.ts +1 -0
  191. package/types/model/base-model-transformer.d.ts +24 -0
  192. package/types/model/base-model.d.ts +9 -12
  193. package/types/model/index.d.ts +3 -0
  194. package/types/model/interface.d.ts +31 -4
  195. package/types/plugin/base/base-plugin-service.d.ts +13 -0
  196. package/types/plugin/base/base-plugin.d.ts +9 -0
  197. package/types/plugin/base/interface.d.ts +22 -0
  198. package/types/plugin/chart/index.d.ts +2 -0
  199. package/types/plugin/chart/interface.d.ts +22 -2
  200. package/types/plugin/chart/media-query/index.d.ts +2 -0
  201. package/types/plugin/chart/media-query/interface/common.d.ts +28 -0
  202. package/types/plugin/chart/media-query/interface/index.d.ts +2 -0
  203. package/types/plugin/chart/media-query/interface/spec.d.ts +25 -0
  204. package/types/plugin/chart/media-query/media-query.d.ts +28 -0
  205. package/types/plugin/chart/media-query/util/action.d.ts +3 -0
  206. package/types/plugin/chart/media-query/util/filter.d.ts +4 -0
  207. package/types/plugin/chart/media-query/util/index.d.ts +2 -0
  208. package/types/plugin/chart/media-query/util/query.d.ts +3 -0
  209. package/types/plugin/chart/plugin-service.d.ts +12 -0
  210. package/types/plugin/chart/register.d.ts +2 -0
  211. package/types/plugin/components/axis-sync-plugin/axis-sync.d.ts +5 -3
  212. package/types/plugin/components/interface.d.ts +15 -25
  213. package/types/plugin/components/plugin-service.d.ts +2 -10
  214. package/types/plugin/index.d.ts +1 -0
  215. package/types/region/index.d.ts +3 -0
  216. package/types/region/interface.d.ts +10 -2
  217. package/types/region/region-transformer.d.ts +8 -0
  218. package/types/region/region.d.ts +7 -4
  219. package/types/series/area/area-transformer.d.ts +5 -0
  220. package/types/series/area/area.d.ts +5 -3
  221. package/types/series/bar/bar-transformer.d.ts +5 -0
  222. package/types/series/bar/bar.d.ts +5 -3
  223. package/types/series/base/base-series-transformer.d.ts +18 -0
  224. package/types/series/base/base-series.d.ts +7 -8
  225. package/types/series/base/index.d.ts +2 -0
  226. package/types/series/box-plot/box-plot.d.ts +2 -3
  227. package/types/series/box-plot/interface.d.ts +1 -2
  228. package/types/series/cartesian/cartesian.d.ts +1 -1
  229. package/types/series/circle-packing/interface.d.ts +1 -2
  230. package/types/series/correlation/correlation-transformer.d.ts +5 -0
  231. package/types/series/correlation/correlation.d.ts +5 -4
  232. package/types/series/dot/dot.d.ts +2 -3
  233. package/types/series/funnel/3d/funnel-3d-transformer.d.ts +6 -0
  234. package/types/series/funnel/3d/funnel-3d.d.ts +22 -0
  235. package/types/series/funnel/3d/index.d.ts +2 -0
  236. package/types/series/funnel/funnel-transformer.d.ts +5 -0
  237. package/types/series/funnel/funnel.d.ts +5 -3
  238. package/types/series/gauge/gauge-pointer.d.ts +2 -3
  239. package/types/series/gauge/gauge-transformer.d.ts +5 -0
  240. package/types/series/gauge/gauge.d.ts +4 -3
  241. package/types/series/geo/interface.d.ts +1 -1
  242. package/types/series/heatmap/heatmap-transformer.d.ts +5 -0
  243. package/types/series/heatmap/heatmap.d.ts +4 -3
  244. package/types/series/index.d.ts +3 -3
  245. package/types/series/interface/common.d.ts +11 -6
  246. package/types/series/interface/series.d.ts +2 -3
  247. package/types/series/line/line.d.ts +5 -3
  248. package/types/series/link/link.d.ts +2 -3
  249. package/types/series/map/map-transformer.d.ts +5 -0
  250. package/types/series/map/map.d.ts +5 -3
  251. package/types/series/mixin/line-mixin-transformer.d.ts +5 -0
  252. package/types/series/mixin/line-mixin.d.ts +1 -2
  253. package/types/series/pie/3d/index.d.ts +2 -0
  254. package/types/series/pie/3d/pie-3d-transformer.d.ts +5 -0
  255. package/types/series/pie/3d/pie-3d.d.ts +20 -0
  256. package/types/series/pie/interface.d.ts +3 -0
  257. package/types/series/pie/pie-transformer.d.ts +9 -0
  258. package/types/series/pie/pie.d.ts +6 -13
  259. package/types/series/polar/index.d.ts +3 -0
  260. package/types/series/polar/polar.d.ts +0 -2
  261. package/types/series/progress/circular/circular.d.ts +2 -3
  262. package/types/series/progress/linear/linear.d.ts +1 -3
  263. package/types/series/radar/radar.d.ts +5 -3
  264. package/types/series/range-column/3d/index.d.ts +2 -0
  265. package/types/series/range-column/3d/range-column-3d-transformer.d.ts +5 -0
  266. package/types/series/range-column/3d/range-column-3d.d.ts +15 -0
  267. package/types/series/range-column/range-column-transformer.d.ts +5 -0
  268. package/types/series/range-column/range-column.d.ts +2 -0
  269. package/types/series/rose/rose-transformer.d.ts +5 -0
  270. package/types/series/rose/rose.d.ts +4 -3
  271. package/types/series/scatter/scatter-transformer.d.ts +5 -0
  272. package/types/series/scatter/scatter.d.ts +5 -3
  273. package/types/series/sunburst/sunburst.d.ts +1 -1
  274. package/types/series/waterfall/waterfall-transformer.d.ts +5 -0
  275. package/types/series/waterfall/waterfall.d.ts +4 -3
  276. package/types/typings/spec/common.d.ts +2 -0
  277. package/types/util/color.d.ts +1 -3
@@ -9,10 +9,15 @@ import type { IAnimate } from '../../animation/interface';
9
9
  import type { Datum, ILayoutRect } from '../../typings';
10
10
  import type { IComponentSpec } from './interface';
11
11
  import { LayoutModel } from '../../model/layout-model';
12
- export declare abstract class BaseComponent<T extends IComponentSpec = IComponentSpec> extends LayoutModel<T> implements IComponent {
12
+ import { BaseComponentSpecTransformer } from './base-component-transformer';
13
+ import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
14
+ export declare class BaseComponent<T extends IComponentSpec = IComponentSpec> extends LayoutModel<T> implements IComponent {
15
+ static transformerConstructor: typeof BaseComponentSpecTransformer;
13
16
  name: string;
14
17
  readonly modelType: string;
18
+ readonly transformerConstructor: any;
15
19
  pluginService?: IComponentPluginService;
20
+ static createComponent(specInfo: IModelSpecInfo, options: IComponentOption): IComponent;
16
21
  protected _option: IComponentOption;
17
22
  protected _regions: IRegion[];
18
23
  getRegions(): IRegion[];
@@ -21,19 +26,17 @@ export declare abstract class BaseComponent<T extends IComponentSpec = IComponen
21
26
  animate?: IAnimate;
22
27
  constructor(spec: T, options: IComponentOption);
23
28
  initLayout(): void;
24
- abstract changeRegions(regions: IRegion[]): void;
25
- protected abstract _getNeedClearVRenderComponents(): IGraphic[];
29
+ changeRegions(regions: IRegion[]): void;
30
+ protected _getNeedClearVRenderComponents(): IGraphic[];
31
+ onRender(ctx: IModelRenderOption): void;
26
32
  getVRenderComponents(): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>[];
27
33
  protected callPlugin(cb: (plugin: IComponentPlugin) => void): void;
28
34
  protected eventPos(markEventParams: BaseEventParams): {
29
35
  x: number;
30
36
  y: number;
31
37
  };
32
- protected _getTheme(): any;
33
- protected _adjustPadding(): void;
34
- protected _mergeThemeToSpec(): void;
35
38
  protected getContainer(): IGroup;
36
- _compareSpec(): {
39
+ _compareSpec(spec: T, prevSpec: T): {
37
40
  change: boolean;
38
41
  reMake: boolean;
39
42
  reRender: boolean;
@@ -1 +1,2 @@
1
1
  export * from './base-component';
2
+ export * from './base-component-transformer';
@@ -1,3 +1,3 @@
1
- import type { IModelOption } from '../../model/interface';
1
+ import type { ITheme } from '../../theme';
2
2
  import { ComponentTypeEnum } from '../interface/type';
3
- export declare function getComponentThemeFromGlobalTheme(type: ComponentTypeEnum, option: Partial<IModelOption>, componentSpec: any): any;
3
+ export declare function getComponentThemeFromGlobalTheme(type: ComponentTypeEnum, chartTheme: ITheme, componentSpec: any, chartSpec: any): any;
@@ -1,18 +1,20 @@
1
1
  import { BaseComponent } from '../base/base-component';
2
- import type { IComponentOption } from '../interface';
3
2
  import { ComponentTypeEnum } from '../interface/type';
4
3
  import { Brush as BrushComponent } from '@visactor/vrender-components';
5
- import type { IModelRenderOption } from '../../model/interface';
4
+ import type { Maybe } from '@visactor/vutils';
5
+ import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
6
6
  import type { IRegion } from '../../region/interface';
7
7
  import type { IGraphic } from '@visactor/vrender-core';
8
8
  import type { ISeries } from '../../series/interface';
9
9
  import type { IElement } from '@visactor/vgrammar-core';
10
10
  import type { BrushInteractiveRangeAttr, IBrush, IBrushSpec } from './interface';
11
- export declare class Brush extends BaseComponent<IBrushSpec> implements IBrush {
11
+ export declare class Brush<T extends IBrushSpec = IBrushSpec> extends BaseComponent<T> implements IBrush {
12
12
  layoutType: 'none';
13
13
  static type: ComponentTypeEnum;
14
14
  type: ComponentTypeEnum;
15
15
  name: string;
16
+ static specKey: string;
17
+ specKey: string;
16
18
  layoutZIndex: number;
17
19
  protected _brushComponents: BrushComponent[];
18
20
  protected _relativeRegions: IRegion[];
@@ -39,7 +41,7 @@ export declare class Brush extends BaseComponent<IBrushSpec> implements IBrush {
39
41
  private _cacheInteractiveRangeAttrs;
40
42
  private _needEnablePickable;
41
43
  init(): void;
42
- static createComponent(spec: any, options: IComponentOption): Brush[];
44
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
43
45
  created(): void;
44
46
  protected _extendDataInBrush(elementsMap: {
45
47
  [brushName: string]: {
@@ -66,7 +68,7 @@ export declare class Brush extends BaseComponent<IBrushSpec> implements IBrush {
66
68
  onRender(ctx: IModelRenderOption): void;
67
69
  changeRegions(regions: IRegion[]): void;
68
70
  protected _getNeedClearVRenderComponents(): IGraphic[];
69
- _compareSpec(): {
71
+ _compareSpec(spec: T, prevSpec: T): {
70
72
  change: boolean;
71
73
  reMake: boolean;
72
74
  reRender: boolean;
@@ -2,9 +2,9 @@ import type { Dict, IBoundsLike } from '@visactor/vutils';
2
2
  import type { IModelLayoutOption, IModelRenderOption } from '../../model/interface';
3
3
  import type { IRegion } from '../../region/interface';
4
4
  import { BaseComponent } from '../base/base-component';
5
- import type { IPadding, Maybe, StringOrNumber } from '../../typings';
5
+ import type { IPadding, StringOrNumber } from '../../typings';
6
6
  import type { IComponentOption } from '../interface';
7
- import type { ICrossHair, CrossHairTrigger, ICartesianCrosshairSpec, IPolarCrosshairSpec, ICrosshairTheme, ICrosshairCategoryFieldSpec } from './interface';
7
+ import type { ICrossHair, CrossHairTrigger, ICartesianCrosshairSpec, IPolarCrosshairSpec, ICrosshairCategoryFieldSpec } from './interface';
8
8
  import type { IAxis } from '../axis/interface';
9
9
  export type IBound = {
10
10
  x1: number;
@@ -31,6 +31,8 @@ export interface IHair {
31
31
  };
32
32
  }
33
33
  export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec | IPolarCrosshairSpec> extends BaseComponent<T> implements ICrossHair {
34
+ static specKey: string;
35
+ specKey: string;
34
36
  layoutType: 'none';
35
37
  gridZIndex: number;
36
38
  labelZIndex: number;
@@ -38,7 +40,6 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
38
40
  enable: boolean;
39
41
  showDefault: boolean;
40
42
  triggerOff: CrossHairTrigger | 'none';
41
- protected _theme: Maybe<ICrosshairTheme>;
42
43
  get enableRemain(): boolean;
43
44
  private _limitBounds;
44
45
  constructor(spec: T, options: IComponentOption);
@@ -50,7 +51,7 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
50
51
  protected _showDefaultCrosshair(): void;
51
52
  setAttrFromSpec(): void;
52
53
  created(): void;
53
- _compareSpec(): {
54
+ _compareSpec(spec: T, prevSpec: T): {
54
55
  change: boolean;
55
56
  reMake: boolean;
56
57
  reRender: boolean;
@@ -1,3 +1,4 @@
1
+ import type { Maybe } from '@visactor/vutils';
1
2
  import type { IComponentOption } from '../interface';
2
3
  import { ComponentTypeEnum } from '../interface/type';
3
4
  import type { ICartesianCrosshairSpec } from './interface';
@@ -5,9 +6,9 @@ import { BaseCrossHair } from './base';
5
6
  import type { IGraphic } from '@visactor/vrender-core';
6
7
  import type { IAxis } from '../axis/interface';
7
8
  import type { StringOrNumber } from '../../typings';
9
+ import type { IModelSpecInfo } from '../../model/interface';
8
10
  export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICartesianCrosshairSpec> extends BaseCrossHair<T> {
9
11
  static specKey: string;
10
- specKey: string;
11
12
  static type: ComponentTypeEnum;
12
13
  type: ComponentTypeEnum;
13
14
  name: string;
@@ -23,7 +24,7 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
23
24
  private _yRightLabel;
24
25
  private _currValueX;
25
26
  private _currValueY;
26
- static createComponent(spec: any, options: IComponentOption): CartesianCrossHair<any> | CartesianCrossHair<ICartesianCrosshairSpec>[];
27
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
27
28
  constructor(spec: T, options: IComponentOption);
28
29
  protected _showDefaultCrosshairBySpec(): void;
29
30
  private _defaultCrosshair;
@@ -2,10 +2,11 @@ import type { IComponentOption } from '../interface';
2
2
  import { ComponentTypeEnum } from '../interface/type';
3
3
  import type { IPolarCrosshairSpec } from './interface';
4
4
  import { BaseCrossHair } from './base';
5
+ import type { Maybe } from '@visactor/vutils';
5
6
  import type { IGraphic } from '@visactor/vrender-core';
7
+ import type { IModelSpecInfo } from '../../model/interface';
6
8
  export declare class PolarCrossHair<T extends IPolarCrosshairSpec = IPolarCrosshairSpec> extends BaseCrossHair<T> {
7
9
  static specKey: string;
8
- specKey: string;
9
10
  static type: ComponentTypeEnum;
10
11
  type: ComponentTypeEnum;
11
12
  name: string;
@@ -19,7 +20,7 @@ export declare class PolarCrossHair<T extends IPolarCrosshairSpec = IPolarCrossh
19
20
  private _radiusLabelCrosshair;
20
21
  private _angleCrosshair;
21
22
  private _angleLabelCrosshair;
22
- static createComponent(spec: any, options: IComponentOption): PolarCrossHair<any> | PolarCrossHair<IPolarCrosshairSpec>[];
23
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
23
24
  constructor(spec: T, options: IComponentOption);
24
25
  protected _showDefaultCrosshairBySpec(): void;
25
26
  private _defaultCrosshair;
@@ -1,10 +1,9 @@
1
1
  import type { Tag } from '@visactor/vrender-components';
2
2
  import type { IBoundsLike } from '@visactor/vutils';
3
3
  import type { Datum } from '../../typings';
4
- import type { IChart } from '../../chart/interface';
5
4
  import type { ICrosshairTheme } from './interface';
6
- import type { IModelOption } from '../../model/interface';
5
+ import type { ITheme } from '../../theme';
7
6
  export declare function limitTagInBounds(shape: Tag, bounds: IBoundsLike): void;
8
7
  export declare function getDatumByValue(data: Datum[], value: number, startField: string, endField?: string): Datum | null;
9
- export declare const getCartesianCrosshairTheme: (option: Partial<IModelOption>, chart: IChart) => ICrosshairTheme;
10
- export declare const getPolarCrosshairTheme: (option: Partial<IModelOption>, chart: IChart) => ICrosshairTheme;
8
+ export declare const getCartesianCrosshairTheme: (chartTheme: ITheme, chartSpec: any) => ICrosshairTheme;
9
+ export declare const getPolarCrosshairTheme: (chartTheme: ITheme, chartSpec: any) => ICrosshairTheme;
@@ -1,24 +1,26 @@
1
1
  import { BaseComponent } from '../base/base-component';
2
2
  import { ComponentTypeEnum } from '../interface/type';
3
- import type { IComponentOption } from '../interface';
4
3
  import type { IRegion } from '../../region/interface';
5
- import type { IModelRenderOption } from '../../model/interface';
4
+ import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
6
5
  import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec } from '../../typings';
7
6
  import type { MarkTypeEnum } from '../../mark/interface';
7
+ import type { Maybe } from '@visactor/vutils';
8
8
  import type { IGraphic } from '@visactor/vrender-core';
9
- export declare class CustomMark extends BaseComponent<any> {
9
+ export declare class CustomMark<T = any> extends BaseComponent<any> {
10
10
  static type: ComponentTypeEnum;
11
11
  type: ComponentTypeEnum;
12
+ static specKey: string;
13
+ specKey: string;
12
14
  layoutType: 'none';
13
15
  layoutZIndex: number;
14
16
  layoutLevel: number;
15
17
  protected _spec: (ICustomMarkSpec<Exclude<EnableMarkType, MarkTypeEnum.group>> | ICustomMarkGroupSpec)[];
16
- static createComponent(spec: any, options: IComponentOption): CustomMark[];
18
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
17
19
  created(): void;
18
20
  protected initMarks(): void;
19
21
  private _createExtensionMark;
20
22
  initEvent(): void;
21
- _compareSpec(): {
23
+ _compareSpec(spec: T, prevSpec: T): {
22
24
  change: boolean;
23
25
  reMake: boolean;
24
26
  reRender: boolean;
@@ -85,14 +85,14 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
85
85
  init(option: IModelInitOption): void;
86
86
  protected _addTransformToSeries(): void;
87
87
  onRender(ctx: any): void;
88
- _compareSpec(): {
88
+ _compareSpec(spec: AdaptiveSpec<T, 'width' | 'height'>, prevSpec: AdaptiveSpec<T, 'width' | 'height'>): {
89
89
  change: boolean;
90
90
  reMake: boolean;
91
91
  reRender: boolean;
92
92
  reSize: boolean;
93
93
  reCompile: boolean;
94
94
  };
95
- reInit(theme?: any): void;
95
+ reInit(spec?: AdaptiveSpec<T, 'width' | 'height'>): void;
96
96
  changeRegions(): void;
97
97
  protected update(ctx: IComponentOption): void;
98
98
  protected resize(ctx: IComponentOption): void;
@@ -0,0 +1,9 @@
1
+ import type { AdaptiveSpec } from '../../../typings';
2
+ import { BaseComponentSpecTransformer } from '../../base';
3
+ import type { IDataZoomSpec, IDataZoomTheme } from './interface';
4
+ export declare class DataZoomSpecTransformer<T extends IDataZoomSpec = IDataZoomSpec, K extends IDataZoomTheme = IDataZoomTheme> extends BaseComponentSpecTransformer<AdaptiveSpec<T, 'width' | 'height'>, K> {
5
+ protected _mergeThemeToSpec(spec: AdaptiveSpec<T, 'width' | 'height'>, chartSpec: any): {
6
+ spec: AdaptiveSpec<T, 'width' | 'height'>;
7
+ theme: K;
8
+ };
9
+ }
@@ -1,3 +1,4 @@
1
+ import type { Maybe } from '@visactor/vutils';
1
2
  import type { IComponentOption } from '../../interface';
2
3
  import { ComponentTypeEnum } from '../../interface/type';
3
4
  import { DataFilterBaseComponent } from '../data-filter-base-component';
@@ -6,10 +7,16 @@ import type { IRectGraphicAttribute, ISymbolGraphicAttribute, IGraphic } from '@
6
7
  import type { Datum, ILayoutType } from '../../../typings';
7
8
  import type { ILinearScale, IBaseScale } from '@visactor/vscale';
8
9
  import type { IDataZoomSpec } from './interface';
10
+ import type { IModelSpecInfo } from '../../../model/interface';
11
+ import { DataZoomSpecTransformer } from './data-zoom-transformer';
9
12
  export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends DataFilterBaseComponent<T> {
10
13
  static type: ComponentTypeEnum;
14
+ static readonly transformerConstructor: any;
11
15
  type: ComponentTypeEnum;
12
16
  name: string;
17
+ readonly transformerConstructor: typeof DataZoomSpecTransformer;
18
+ static specKey: string;
19
+ specKey: string;
13
20
  layoutZIndex: number;
14
21
  layoutLevel: number;
15
22
  layoutType: ILayoutType;
@@ -19,11 +26,10 @@ export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends D
19
26
  protected _middleHandlerSize: number;
20
27
  protected _startHandlerSize: number;
21
28
  protected _endHandlerSize: number;
22
- static createComponent(spec: any, options: IComponentOption): DataZoom<any> | DataZoom<IDataZoomSpec>[];
29
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
23
30
  constructor(spec: T, options: IComponentOption);
24
31
  created(): void;
25
32
  setAttrFromSpec(): void;
26
- protected _mergeThemeToSpec(): void;
27
33
  onLayoutEnd(ctx: any): void;
28
34
  protected _initValueScale(): void;
29
35
  protected _updateScaleRange(): void;
@@ -1,2 +1,3 @@
1
1
  export * from './data-zoom';
2
2
  export * from './interface';
3
+ export * from './data-zoom-transformer';
@@ -1,3 +1,4 @@
1
+ import type { Maybe } from '@visactor/vutils';
1
2
  import type { IComponentOption } from '../../interface';
2
3
  import { ComponentTypeEnum } from '../../interface/type';
3
4
  import { DataFilterBaseComponent } from '../data-filter-base-component';
@@ -6,15 +7,18 @@ import { ScrollBar as ScrollBarComponent } from '@visactor/vrender-components';
6
7
  import type { IGraphic } from '@visactor/vrender-core';
7
8
  import type { IScrollBarSpec } from './interface';
8
9
  import type { ILayoutType } from '../../../typings/layout';
10
+ import type { IModelSpecInfo } from '../../../model/interface';
9
11
  export declare class ScrollBar<T extends IScrollBarSpec = IScrollBarSpec> extends DataFilterBaseComponent<T> {
10
12
  static type: ComponentTypeEnum;
11
13
  type: ComponentTypeEnum;
12
14
  name: string;
15
+ static specKey: string;
16
+ specKey: string;
13
17
  layoutZIndex: number;
14
18
  layoutLevel: number;
15
19
  layoutType: ILayoutType;
16
20
  protected _component: ScrollBarComponent;
17
- static createComponent(spec: any, options: IComponentOption): ScrollBar<any> | ScrollBar<IScrollBarSpec>[];
21
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
18
22
  constructor(spec: T, options: IComponentOption);
19
23
  setAttrFromSpec(): void;
20
24
  onLayoutEnd(ctx: any): void;
@@ -1,6 +1,6 @@
1
- import type { IModelOption } from '../../model/interface';
2
1
  import { type IOrientType } from '../../typings';
3
2
  import type { ComponentTypeEnum } from '../interface';
3
+ import type { ITheme } from '../../theme';
4
4
  export interface IDataFilterWithNewDomainOption {
5
5
  getNewDomain: () => any[];
6
6
  isContinuous: () => boolean;
@@ -20,4 +20,4 @@ export interface IDataFilterComputeDomainOption {
20
20
  };
21
21
  }
22
22
  export declare const dataFilterComputeDomain: (data: Array<any>, op: IDataFilterComputeDomainOption) => any[];
23
- export declare const getDataFilterTheme: (orient: IOrientType, type: ComponentTypeEnum, option: Partial<IModelOption>) => any;
23
+ export declare const getDataFilterTheme: (orient: IOrientType, type: ComponentTypeEnum, chartTheme: ITheme) => any;
@@ -1,12 +1,12 @@
1
1
  import type { IPoint } from '../../typings/coordinate';
2
2
  import { Projection } from './projection';
3
- import type { IEffect, IModelLayoutOption, IModelRenderOption } from '../../model/interface';
4
- import type { IComponentOption } from '../interface';
3
+ import type { IEffect, IModelLayoutOption, IModelRenderOption, IModelSpecInfo } from '../../model/interface';
5
4
  import { ComponentTypeEnum } from '../interface/type';
6
5
  import { BaseComponent } from '../base/base-component';
7
6
  import type { IGeoRegionSpec, IRegion } from '../../region/interface';
8
7
  import type { IGeoCoordinate, IGeoCoordinateSpec, IProjectionSpec } from './interface';
9
- import type { IChartSpec, StringOrNumber } from '../../typings';
8
+ import type { StringOrNumber } from '../../typings';
9
+ import type { Maybe } from '@visactor/vutils';
10
10
  import type { IGraphic } from '@visactor/vrender-core';
11
11
  export declare function projectionName(key: string, id: number): string;
12
12
  export declare class GeoCoordinate extends BaseComponent<IGeoRegionSpec> implements IGeoCoordinate {
@@ -29,7 +29,7 @@ export declare class GeoCoordinate extends BaseComponent<IGeoRegionSpec> impleme
29
29
  }>;
30
30
  private _actualScale;
31
31
  getZoom(): number;
32
- static createComponent(spec: IChartSpec, options: IComponentOption): IGeoCoordinate[];
32
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
33
33
  effect: IEffect;
34
34
  setAttrFromSpec(): void;
35
35
  created(): void;
@@ -36,7 +36,7 @@ import type { ITooltipSpec, ITooltipTheme } from './tooltip';
36
36
  import { Tooltip, registerTooltip } from './tooltip';
37
37
  import type { ILabelSpec, ITotalLabelTheme } from './label';
38
38
  import { Label, registerLabel } from './label';
39
- import { TotalLabel, registerTotalLabel } from './label/totalLabel';
39
+ import { TotalLabel, registerTotalLabel } from './label/total-label';
40
40
  import { registerPoptip } from './poptip/index';
41
41
  import type { IComponentTheme } from './interface';
42
42
  import type { IAxisCommonTheme, IAxisItemTheme, IBandAxisTheme } from './axis/interface';
@@ -1,14 +1,16 @@
1
- import type { IComponentOption } from '../interface';
2
1
  import { ComponentTypeEnum } from '../interface/type';
3
2
  import { BaseComponent } from '../base/base-component';
4
3
  import type { IRegion } from '../../region/interface';
5
- import type { IIndicator, IIndicatorSpec, IIndicatorTheme } from './interface';
4
+ import type { IIndicator, IIndicatorSpec } from './interface';
6
5
  import type { Maybe } from '../../typings';
6
+ import type { IModelSpecInfo } from '../../model/interface';
7
7
  import type { IGraphic } from '@visactor/vrender-core';
8
8
  export declare class Indicator<T extends IIndicatorSpec> extends BaseComponent<T> implements IIndicator {
9
9
  static type: ComponentTypeEnum;
10
10
  type: ComponentTypeEnum;
11
11
  name: string;
12
+ static specKey: string;
13
+ specKey: string;
12
14
  layoutType: 'none';
13
15
  layoutZIndex: number;
14
16
  layoutLevel: number;
@@ -19,8 +21,7 @@ export declare class Indicator<T extends IIndicatorSpec> extends BaseComponent<T
19
21
  private _content;
20
22
  private _indicatorComponent;
21
23
  private _cacheAttrs;
22
- protected _theme: Maybe<IIndicatorTheme>;
23
- static createComponent(spec: any, options: IComponentOption): import("../interface").IComponent[];
24
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
24
25
  created(): void;
25
26
  setAttrFromSpec(): void;
26
27
  onRender(ctx: any): void;
@@ -1,10 +1,11 @@
1
1
  import type { ISeriesFilter } from '../../region/interface';
2
2
  import type { IAnimate } from '../../animation/interface';
3
- import type { ILayoutModel, IModelOption } from '../../model/interface';
3
+ import type { ILayoutModel, IModelConstructor, IModelOption, IModelSpecInfo } from '../../model/interface';
4
4
  import type { IRegion } from '../../region/interface';
5
5
  import type { ISeries } from '../../series/interface';
6
- import type { StringOrNumber } from '../../typings';
6
+ import type { Maybe, StringOrNumber } from '../../typings';
7
7
  import type { IGraphic } from '@visactor/vrender-core';
8
+ import type { IChartSpecInfo } from '../../chart/interface';
8
9
  export interface IComponentOption extends IModelOption {
9
10
  getAllRegions: () => IRegion[];
10
11
  getRegionsInIndex: (index?: number[]) => IRegion[];
@@ -28,9 +29,10 @@ export interface IComponent extends ILayoutModel {
28
29
  getVRenderComponents: () => IGraphic[];
29
30
  clear: () => void;
30
31
  }
31
- export interface IComponentConstructor {
32
+ export interface IComponentConstructor extends IModelConstructor {
32
33
  type: string;
33
34
  specKey?: string;
34
- createComponent: (spec: any, options: IComponentOption) => IComponent | IComponent[] | undefined;
35
+ getSpecInfo: (chartSpec: any, chartSpecInfo?: IChartSpecInfo) => Maybe<IModelSpecInfo[]>;
36
+ createComponent: (specInfo: IModelSpecInfo, options: IComponentOption) => IComponent;
35
37
  new (spec: any, options: IComponentOption): IComponent;
36
38
  }
@@ -33,3 +33,11 @@ export declare enum ComponentTypeEnum {
33
33
  poptip = "poptip",
34
34
  customMark = "customMark"
35
35
  }
36
+ export declare enum SimplifiedComponentTypeEnum {
37
+ axis = "axis",
38
+ legend = "legend",
39
+ crosshair = "crosshair"
40
+ }
41
+ export declare const axisComponentTypes: ComponentTypeEnum[];
42
+ export declare const legendComponentTypes: ComponentTypeEnum[];
43
+ export declare const crosshairComponentTypes: ComponentTypeEnum[];
@@ -5,7 +5,7 @@ import type { IRegion } from '../../region/interface';
5
5
  import type { IModelRenderOption } from '../../model/interface';
6
6
  import type { ILabelSpec } from './interface';
7
7
  import type { IGraphic } from '@visactor/vrender-core';
8
- export declare abstract class BaseLabelComponent<T extends ILabelSpec = ILabelSpec> extends BaseComponent<T> {
8
+ export declare abstract class BaseLabelComponent<T = any> extends BaseComponent<T> {
9
9
  static type: ComponentTypeEnum;
10
10
  type: ComponentTypeEnum;
11
11
  name: string;
@@ -25,7 +25,7 @@ export declare abstract class BaseLabelComponent<T extends ILabelSpec = ILabelSp
25
25
  hover: boolean;
26
26
  select: boolean;
27
27
  };
28
- _compareSpec(): {
28
+ _compareSpec(spec: T, prevSpec: T): {
29
29
  change: boolean;
30
30
  reMake: boolean;
31
31
  reRender: boolean;
@@ -1,2 +1,4 @@
1
1
  export * from './interface';
2
2
  export * from './label';
3
+ export * from './total-label';
4
+ export * from './label-transformer';
@@ -1,9 +1,9 @@
1
1
  import type { BaseLabelAttrs } from '@visactor/vrender-components';
2
2
  import type { ConvertToMarkStyleSpec, Datum, ITextMarkSpec } from '../../typings';
3
3
  import type { IComponentSpec } from '../base/interface';
4
- import type { ISeries } from '../..';
5
4
  import type { IRichTextCharacter } from '@visactor/vrender-core';
6
5
  import type { ILabelMark } from '../../mark/label';
6
+ import type { ISeries } from '../../series';
7
7
  export interface ILabelFormatMethodContext {
8
8
  series?: ISeries;
9
9
  }
@@ -38,6 +38,6 @@ export interface ITotalLabelTheme extends Pick<ILabelSpec, 'visible' | 'interact
38
38
  style?: ITextMarkSpec;
39
39
  }
40
40
  export type TransformedLabelSpec = ILabelSpec & {
41
- styleHandler: (mark?: ILabelMark) => void;
41
+ getStyleHandler: (series: ISeries) => (mark?: ILabelMark) => void;
42
42
  };
43
43
  export {};
@@ -0,0 +1,8 @@
1
+ import type { IChartSpec } from '../../typings';
2
+ import { BaseComponentSpecTransformer } from '../base';
3
+ export declare class LabelSpecTransformer<T extends IChartSpec = any, K = any> extends BaseComponentSpecTransformer<T, K> {
4
+ protected _initTheme(spec: T, chartSpec: any): {
5
+ spec: T;
6
+ theme: K;
7
+ };
8
+ }
@@ -1,15 +1,19 @@
1
1
  import type { IComponentOption } from '../interface';
2
2
  import { ComponentTypeEnum } from '../interface/type';
3
3
  import type { IRegion } from '../../region/interface';
4
- import type { IModelInitOption } from '../../model/interface';
4
+ import type { IModelInitOption, IModelSpecInfo } from '../../model/interface';
5
5
  import type { ISeries } from '../../series/interface';
6
6
  import type { ILabel, IMark as IVGrammarMark } from '@visactor/vgrammar-core';
7
7
  import { type IComponentMark } from '../../mark/component';
8
8
  import { BaseLabelComponent } from './base-label';
9
+ import type { Maybe } from '@visactor/vutils';
9
10
  import type { IGroup } from '@visactor/vrender-core';
10
- import type { ILabelSpec, TransformedLabelSpec } from './interface';
11
+ import type { TransformedLabelSpec } from './interface';
11
12
  import { type ILabelMark } from '../../mark/label';
12
13
  import type { ICompilableMark } from '../../compile/mark';
14
+ import type { IChartSpecInfo } from '../../chart/interface';
15
+ import type { IChartSpec } from '../../typings';
16
+ import { LabelSpecTransformer } from './label-transformer';
13
17
  export interface ILabelInfo {
14
18
  baseMark: ICompilableMark;
15
19
  labelMark: ILabelMark;
@@ -20,18 +24,22 @@ export interface ILabelComponentContext {
20
24
  region: IRegion;
21
25
  labelInfo: ILabelInfo[];
22
26
  }
23
- export declare class Label<T extends ILabelSpec = ILabelSpec> extends BaseLabelComponent<T> {
27
+ export declare class Label<T extends IChartSpec = any> extends BaseLabelComponent<T> {
24
28
  static type: ComponentTypeEnum;
25
29
  type: ComponentTypeEnum;
26
30
  name: string;
31
+ static specKey: string;
32
+ specKey: string;
33
+ static readonly transformerConstructor: any;
34
+ readonly transformerConstructor: typeof LabelSpecTransformer;
27
35
  layoutZIndex: number;
28
36
  protected _labelInfoMap: Map<IRegion, ILabelInfo[]>;
29
37
  protected _labelComponentMap: Map<IComponentMark, () => ILabelInfo | ILabelInfo[]>;
30
38
  protected _layoutRule: 'series' | 'region';
31
39
  constructor(spec: T, options: IComponentOption);
32
- static createComponent(spec: any, options: IComponentOption): Label<any>[];
40
+ static getSpecInfo(chartSpec: any, chartSpecInfo: IChartSpecInfo): Maybe<IModelSpecInfo[]>;
33
41
  init(option: IModelInitOption): void;
34
- reInit(theme?: any): void;
42
+ reInit(spec?: T): void;
35
43
  initEvent(): void;
36
44
  protected _delegateLabelEvent(component: IGroup): void;
37
45
  protected _initTextMark(): void;
@@ -0,0 +1,28 @@
1
+ import { ComponentTypeEnum } from '../interface/type';
2
+ import type { MarkType } from '../../mark/interface';
3
+ import type { ISeries } from '../../series/interface';
4
+ import { BaseLabelComponent } from './base-label';
5
+ import type { IModelInitOption, IModelSpecInfo } from '../../model/interface';
6
+ import type { Maybe } from '../../typings';
7
+ import type { IChartSpecInfo } from '../../chart/interface';
8
+ export declare class TotalLabel extends BaseLabelComponent {
9
+ static type: ComponentTypeEnum;
10
+ type: ComponentTypeEnum;
11
+ name: string;
12
+ static specKey: string;
13
+ specKey: string;
14
+ layoutZIndex: number;
15
+ private _textMark?;
16
+ private _baseMark?;
17
+ static getSpecInfo(chartSpec: any, chartSpecInfo?: IChartSpecInfo): Maybe<IModelSpecInfo[]>;
18
+ init(option: IModelInitOption): void;
19
+ protected _initTextMark(): void;
20
+ _initTextMarkStyle(): void;
21
+ protected _initLabelComponent(): void;
22
+ updateLayoutAttribute(): void;
23
+ compileMarks(): void;
24
+ getVRenderComponents(): any[];
25
+ protected _getSeries(): ISeries;
26
+ }
27
+ export declare function totalLabelPosition(series: ISeries, type: MarkType): string;
28
+ export declare const registerTotalLabel: () => void;
@@ -12,6 +12,7 @@ export declare const labelRuleMap: {
12
12
  line: typeof LineLabel;
13
13
  area: typeof LineLabel;
14
14
  rect3d: typeof barLabel;
15
+ arc3d: typeof pieLabel;
15
16
  };
16
17
  export declare function textAttribute(labelInfo: ILabelInfo, datum: Datum, formatMethod?: ILabelSpec['formatMethod'], formatter?: ILabelSpec['formatter']): any;
17
18
  export declare function symbolLabel(labelInfo: ILabelInfo): {
@@ -10,6 +10,8 @@ export declare abstract class BaseLegend<T extends ILegendCommonSpec> extends Ba
10
10
  layoutType: ILayoutType;
11
11
  layoutZIndex: number;
12
12
  layoutLevel: number;
13
+ static specKey: string;
14
+ specKey: string;
13
15
  protected _orient: IOrientType;
14
16
  get orient(): IOrientType;
15
17
  protected _visible: boolean;
@@ -31,7 +33,7 @@ export declare abstract class BaseLegend<T extends ILegendCommonSpec> extends Ba
31
33
  setAttrFromSpec(): void;
32
34
  created(): void;
33
35
  onRender(ctx: any): void;
34
- _compareSpec(): {
36
+ _compareSpec(spec: T, prevSpec: T): {
35
37
  change: boolean;
36
38
  reMake: boolean;
37
39
  reRender: boolean;
@@ -1,21 +1,19 @@
1
+ import type { Maybe } from '@visactor/vutils';
1
2
  import { DataView } from '@visactor/vdataset';
2
- import type { IModelInitOption } from '../../../model/interface';
3
+ import type { IModelInitOption, IModelSpecInfo } from '../../../model/interface';
3
4
  import type { IComponentOption } from '../../interface';
4
5
  import { ComponentTypeEnum } from '../../interface/type';
5
- import type { ILegend } from '../interface';
6
- import type { IColorLegendSpec, IColorLegendTheme, ISizeLegendSpec } from './interface';
6
+ import type { IColorLegendSpec, ISizeLegendSpec } from './interface';
7
7
  import { BaseLegend } from '../base-legend';
8
8
  import type { ILayoutRect } from '../../../typings/layout';
9
9
  export declare class ContinuousLegend<T extends IColorLegendSpec | ISizeLegendSpec = IColorLegendSpec | ISizeLegendSpec> extends BaseLegend<T> {
10
10
  static specKey: string;
11
- specKey: string;
12
11
  static type: ComponentTypeEnum;
13
12
  type: ComponentTypeEnum;
14
13
  name: string;
15
- protected _theme: IColorLegendTheme;
16
14
  private _field;
17
15
  private _legendType;
18
- static createComponent(spec: any, options: IComponentOption): ContinuousLegend<any> | ILegend[];
16
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
19
17
  constructor(spec: T, options: IComponentOption);
20
18
  setAttrFromSpec(): void;
21
19
  init(option: IModelInitOption): void;