@visactor/vchart-types 1.6.2 → 1.7.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) 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-chart.d.ts +4 -4
  5. package/types/chart/interface/chart.d.ts +2 -2
  6. package/types/compile/mark/compilable-mark.d.ts +1 -2
  7. package/types/component/axis/base-axis.d.ts +1 -0
  8. package/types/component/axis/cartesian/axis.d.ts +12 -9
  9. package/types/component/axis/cartesian/interface/theme.d.ts +1 -1
  10. package/types/component/axis/polar/axis.d.ts +3 -4
  11. package/types/component/base/base-component.d.ts +12 -4
  12. package/types/component/brush/brush.d.ts +3 -4
  13. package/types/component/crosshair/base.d.ts +4 -5
  14. package/types/component/crosshair/cartesian.d.ts +2 -0
  15. package/types/component/crosshair/interface/spec.d.ts +1 -1
  16. package/types/component/crosshair/polar.d.ts +2 -0
  17. package/types/component/custom-mark/custom-mark.d.ts +3 -4
  18. package/types/component/data-zoom/data-filter-base-component.d.ts +6 -8
  19. package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
  20. package/types/component/data-zoom/data-zoom/interface.d.ts +1 -0
  21. package/types/component/data-zoom/scroll-bar/interface.d.ts +1 -1
  22. package/types/component/geo/geo-coordinate.d.ts +4 -3
  23. package/types/component/indicator/indicator.d.ts +2 -4
  24. package/types/component/indicator/interface.d.ts +1 -1
  25. package/types/component/interface/common.d.ts +3 -3
  26. package/types/component/label/base-label.d.ts +3 -4
  27. package/types/component/label/label.d.ts +3 -3
  28. package/types/component/label/totalLabel.d.ts +3 -3
  29. package/types/component/legend/base-legend.d.ts +6 -9
  30. package/types/component/legend/continuous/legend.d.ts +4 -1
  31. package/types/component/legend/discrete/legend.d.ts +4 -1
  32. package/types/component/legend/discrete/util.d.ts +1 -1
  33. package/types/component/legend/util.d.ts +1 -1
  34. package/types/component/map-label/component.d.ts +2 -4
  35. package/types/component/marker/base-marker.d.ts +2 -3
  36. package/types/component/marker/interface.d.ts +1 -1
  37. package/types/component/marker/mark-area/mark-area.d.ts +1 -3
  38. package/types/component/marker/mark-line/mark-line.d.ts +1 -3
  39. package/types/component/marker/mark-point/mark-point.d.ts +1 -3
  40. package/types/component/player/interface/theme.d.ts +1 -1
  41. package/types/component/player/player.d.ts +6 -7
  42. package/types/component/title/interface/theme.d.ts +1 -1
  43. package/types/component/title/title.d.ts +6 -9
  44. package/types/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
  45. package/types/component/tooltip/tooltip.d.ts +4 -3
  46. package/types/constant/layout.d.ts +1 -0
  47. package/types/core/factory.d.ts +5 -2
  48. package/types/core/vchart.d.ts +1 -0
  49. package/types/event/events/base.d.ts +16 -0
  50. package/types/event/events/dimension/util/cartesian.d.ts +1 -1
  51. package/types/event/events/dimension/util/common.d.ts +1 -2
  52. package/types/event/events/dimension/util/polar.d.ts +1 -1
  53. package/types/event/interface.d.ts +1 -1
  54. package/types/interaction/zoom/zoomable.d.ts +1 -0
  55. package/types/layout/base-layout.d.ts +3 -5
  56. package/types/layout/grid-layout/grid-layout.d.ts +1 -2
  57. package/types/layout/interface.d.ts +74 -6
  58. package/types/layout/layout-item.d.ts +71 -0
  59. package/types/layout/layout3d/index.d.ts +2 -4
  60. package/types/layout/util.d.ts +1 -1
  61. package/types/mark/base/base-mark.d.ts +3 -3
  62. package/types/model/base-model.d.ts +10 -6
  63. package/types/model/interface.d.ts +20 -82
  64. package/types/model/layout-model.d.ts +39 -0
  65. package/types/region/interface.d.ts +3 -2
  66. package/types/region/region.d.ts +12 -7
  67. package/types/series/base/base-series.d.ts +10 -4
  68. package/types/series/funnel/interface.d.ts +1 -2
  69. package/types/series/interface/series.d.ts +3 -2
  70. package/types/series/mixin/line-mixin.d.ts +2 -1
  71. package/types/series/sankey/sankey.d.ts +2 -1
  72. package/types/theme/builtin/common-mobile/component/axis/band-axis.d.ts +2 -0
  73. package/types/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +3 -0
  74. package/types/theme/builtin/common-mobile/component/axis/common-axis.d.ts +2 -0
  75. package/types/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +2 -0
  76. package/types/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +3 -0
  77. package/types/theme/builtin/common-mobile/component/crosshair.d.ts +2 -0
  78. package/types/theme/builtin/common-mobile/component/data-zoom.d.ts +2 -0
  79. package/types/theme/builtin/common-mobile/component/index.d.ts +2 -0
  80. package/types/theme/builtin/common-mobile/component/indicator.d.ts +2 -0
  81. package/types/theme/builtin/common-mobile/component/legend/color-legend.d.ts +2 -0
  82. package/types/theme/builtin/common-mobile/component/legend/continuous.d.ts +2 -0
  83. package/types/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +2 -0
  84. package/types/theme/builtin/common-mobile/component/legend/size-legend.d.ts +2 -0
  85. package/types/theme/builtin/common-mobile/component/map-label.d.ts +2 -0
  86. package/types/theme/builtin/common-mobile/component/mark-area.d.ts +2 -0
  87. package/types/theme/builtin/common-mobile/component/mark-line.d.ts +2 -0
  88. package/types/theme/builtin/common-mobile/component/mark-point.d.ts +2 -0
  89. package/types/theme/builtin/common-mobile/component/player.d.ts +2 -0
  90. package/types/theme/builtin/common-mobile/component/poptip.d.ts +2 -0
  91. package/types/theme/builtin/common-mobile/component/title.d.ts +2 -0
  92. package/types/theme/builtin/common-mobile/component/tooltip.d.ts +2 -0
  93. package/types/theme/builtin/common-mobile/component/total-label.d.ts +2 -0
  94. package/types/theme/builtin/common-mobile/constants.d.ts +2 -0
  95. package/types/theme/builtin/common-mobile/mark.d.ts +3 -0
  96. package/types/theme/builtin/dark-mobile/index.d.ts +2 -0
  97. package/types/theme/builtin/light-mobile/index.d.ts +2 -0
  98. package/types/theme/interface.d.ts +1 -2
  99. package/types/typings/index.d.ts +1 -0
  100. package/types/typings/layout.d.ts +23 -0
  101. package/types/typings/spec/common.d.ts +1 -2
  102. package/types/util/space.d.ts +1 -1
@@ -1,13 +1,16 @@
1
1
  import type { IEvent } from '../event/interface';
2
- import { LayoutItem } from './layout-item';
3
- import type { IEffect, IModel, IModelInitOption, IModelOption, IModelRenderOption, IModelEvaluateOption, IModelSpec, ILayoutRect, IModelMarkInfo } from './interface';
2
+ import type { IEffect, IModel, IModelInitOption, IModelOption, IModelRenderOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo } from './interface';
4
3
  import type { CoordinateType } from '../typings/coordinate';
5
4
  import type { IMark, IMarkOption, IMarkRaw, IMarkStyle } from '../mark/interface';
6
- import type { Datum, StateValueType, ConvertToMarkStyleSpec, ICommonSpec, StringOrNumber, IRect } from '../typings';
5
+ import type { Datum, StateValueType, ConvertToMarkStyleSpec, ICommonSpec, StringOrNumber, IRect, ILayoutRect } from '../typings';
7
6
  import type { CompilableData } from '../compile/data/compilable-data';
8
7
  import type { IGroupMark } from '@visactor/vgrammar-core';
9
8
  import { MarkSet } from '../mark/mark-set';
10
- export declare abstract class BaseModel<T extends IModelSpec> extends LayoutItem<T> implements IModel {
9
+ import type { ILayoutItem } from '../layout/interface';
10
+ import { CompilableBase } from '../compile/compilable-base';
11
+ export declare abstract class BaseModel<T extends IModelSpec> extends CompilableBase implements IModel {
12
+ protected _spec: T;
13
+ getSpec(): T;
11
14
  readonly type: string;
12
15
  readonly modelType: string;
13
16
  readonly id: number;
@@ -16,6 +19,8 @@ export declare abstract class BaseModel<T extends IModelSpec> extends LayoutItem
16
19
  readonly effect: IEffect;
17
20
  protected _data: CompilableData;
18
21
  getData(): CompilableData;
22
+ protected _layout?: ILayoutItem;
23
+ get layout(): ILayoutItem;
19
24
  protected _specIndex: number;
20
25
  getSpecIndex(): number;
21
26
  readonly specKey: string;
@@ -30,16 +35,15 @@ export declare abstract class BaseModel<T extends IModelSpec> extends LayoutItem
30
35
  getChart(): import("../chart/interface").IChart;
31
36
  protected _theme?: any;
32
37
  protected _lastLayoutRect: ILayoutRect;
33
- protected _isLayout: boolean;
34
38
  constructor(spec: T, option: IModelOption);
35
39
  coordinate?: CoordinateType;
36
40
  protected _releaseEvent(): void;
37
41
  created(): void;
38
42
  init(option: IModelInitOption): void;
39
43
  afterInit(): void;
44
+ getVisible(): boolean;
40
45
  onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void;
41
46
  onLayoutEnd(ctx: any): void;
42
- protected _forceLayout(): void;
43
47
  onEvaluateEnd(ctx: IModelEvaluateOption): void;
44
48
  abstract onRender(ctx: IModelRenderOption): void;
45
49
  onDataUpdate(): void;
@@ -5,7 +5,10 @@ import type { IMark, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interfac
5
5
  import type { RenderMode } from '../typings/spec/common';
6
6
  import type { VChart } from '../vchart-all';
7
7
  import type { IData } from '@visactor/vgrammar-core';
8
- import type { IOrientType, IPoint, IGroupMarkSpec, ConvertToMarkStyleSpec, CoordinateType, ICommonSpec, IRect, StringOrNumber } from '../typings';
8
+ import type { StringOrNumber } from '../typings/common';
9
+ import type { IGroupMarkSpec, ConvertToMarkStyleSpec, ICommonSpec } from '../typings/visual';
10
+ import type { IRect } from '../typings/space';
11
+ import type { IPoint, CoordinateType } from '../typings/coordinate';
9
12
  import type { ITheme } from '../theme';
10
13
  import type { StateValueType } from '../typings/spec';
11
14
  import type { ICompilable, ICompilableInitOption } from '../compile/interface';
@@ -14,83 +17,8 @@ import type { IGlobalScale } from '../scale/interface';
14
17
  import type { IChart } from '../chart/interface';
15
18
  import type { IChartLevelTheme } from '../core/interface';
16
19
  import type { IThemeColorScheme } from '../theme/color-scheme/interface';
17
- export type ILayoutNumber = number | IPercent | ((layoutRect: ILayoutRect) => number) | IPercentOffset;
18
- export interface ILayoutPoint {
19
- x: number;
20
- y: number;
21
- }
22
- export interface ILayoutRectLevel {
23
- width: number;
24
- height: number;
25
- }
26
- export interface ILayoutRect {
27
- width: number;
28
- height: number;
29
- }
30
- export type IPercent = `${number}%`;
31
- export type IPercentOffset = {
32
- percent?: number;
33
- offset?: number;
34
- };
35
- export type ILayoutPercent = IPercent | number;
36
- type ILayoutType = 'region-relative' | 'region' | 'normal' | 'absolute' | 'normal-inline';
37
- export type ILayoutOrientPadding = {
38
- left?: ILayoutNumber;
39
- right?: ILayoutNumber;
40
- top?: ILayoutNumber;
41
- bottom?: ILayoutNumber;
42
- };
43
- export type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[];
44
- export interface ILayoutItem {
45
- directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';
46
- layoutClip: boolean;
47
- layoutType: ILayoutType;
48
- layoutBindRegionID: number | number[];
49
- layoutOrient: IOrientType;
50
- layoutPaddingLeft: number;
51
- layoutPaddingTop: number;
52
- layoutPaddingRight: number;
53
- layoutPaddingBottom: number;
54
- layoutOffsetX: number;
55
- layoutOffsetY: number;
56
- layoutLevel: number;
57
- layoutZIndex: number;
58
- chartLayoutRect: ILayoutRect;
59
- getVisible: () => boolean;
60
- getSpec?: () => any;
61
- getAutoIndent: () => boolean;
62
- getLayoutStartPoint: () => ILayoutPoint;
63
- getLayoutRect: () => ILayoutRect;
64
- getLastComputeOutBounds: () => IBoundsLike;
65
- getGraphicBounds: () => IBoundsLike;
66
- setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRectLevel>) => void;
67
- computeBoundsInRect: (rect: ILayoutRect) => ILayoutRect;
68
- setLayoutStartPosition: (pos: Partial<IPoint>) => void;
69
- absoluteLayoutInRect: (rect: IRect) => void;
70
- updateLayoutAttribute: () => void;
71
- }
72
- export interface ILayoutItemSpec {
73
- layoutType?: ILayoutType;
74
- layoutLevel?: number;
75
- orient?: IOrientType;
76
- padding?: ILayoutPaddingSpec;
77
- noOuterPadding?: boolean;
78
- width?: ILayoutNumber;
79
- maxWidth?: ILayoutNumber;
80
- minWidth?: ILayoutNumber;
81
- height?: ILayoutNumber;
82
- maxHeight?: ILayoutNumber;
83
- minHeight?: ILayoutNumber;
84
- offsetX?: ILayoutNumber;
85
- offsetY?: ILayoutNumber;
86
- zIndex?: number;
87
- clip?: boolean;
88
- left?: ILayoutNumber;
89
- right?: ILayoutNumber;
90
- top?: ILayoutNumber;
91
- bottom?: ILayoutNumber;
92
- center?: boolean;
93
- }
20
+ import type { ILayoutItem, ILayoutItemSpec } from '../layout/interface';
21
+ import type { ILayoutPoint, ILayoutRect } from '../typings/layout';
94
22
  export interface IModelInitOption {
95
23
  }
96
24
  export interface IModelLayoutOption {
@@ -118,7 +46,7 @@ export interface IUpdateSpecResult {
118
46
  export interface IModelProduct {
119
47
  srData: IData;
120
48
  }
121
- export interface IModel extends ICompilable, ILayoutItem {
49
+ export interface IModel extends ICompilable {
122
50
  readonly modelType: string;
123
51
  readonly type: string;
124
52
  readonly specKey: string;
@@ -127,6 +55,8 @@ export interface IModel extends ICompilable, ILayoutItem {
127
55
  readonly event: IEvent;
128
56
  readonly effect: IEffect;
129
57
  coordinate?: CoordinateType;
58
+ layout?: ILayoutItem;
59
+ getVisible: () => boolean;
130
60
  getOption: () => IModelOption;
131
61
  getMarks: () => IMark[];
132
62
  getMarkNameMap: () => Record<string, IMark>;
@@ -137,8 +67,6 @@ export interface IModel extends ICompilable, ILayoutItem {
137
67
  init: (option: IModelInitOption) => void;
138
68
  reInit: (theme?: any, lastSpec?: any) => void;
139
69
  beforeRelease: () => void;
140
- onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: IModelLayoutOption) => void;
141
- onLayoutEnd: (ctx: IModelLayoutOption) => void;
142
70
  onEvaluateEnd: (ctx: IModelEvaluateOption) => void;
143
71
  onRender: (ctx: IModelRenderOption) => void;
144
72
  onDataUpdate: () => void;
@@ -150,6 +78,17 @@ export interface IModel extends ICompilable, ILayoutItem {
150
78
  setMarkStyle: <T extends ICommonSpec>(mark?: IMarkRaw<T>, style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>, state?: StateValueType, level?: number) => void;
151
79
  initMarkStyleWithSpec: (mark?: IMark, spec?: any, key?: string) => void;
152
80
  }
81
+ export interface ILayoutModel extends IModel {
82
+ getLayoutStartPoint: () => IPoint;
83
+ setLayoutStartPosition: (pos: Partial<IPoint>) => void;
84
+ getLayoutRect: () => ILayoutRect;
85
+ setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;
86
+ getLastComputeOutBounds: () => IBoundsLike;
87
+ getBoundsInRect: (rect: ILayoutRect, fullRect: ILayoutRect) => IBoundsLike;
88
+ onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: IModelLayoutOption) => void;
89
+ afterSetLayoutStartPoint: (pos: ILayoutPoint) => void;
90
+ onLayoutEnd: (ctx: IModelLayoutOption) => void;
91
+ }
153
92
  export interface IModelOption extends ICompilableInitOption {
154
93
  eventDispatcher: IEventDispatcher;
155
94
  dataSet: DataSet;
@@ -185,4 +124,3 @@ export interface IModelMarkInfo {
185
124
  type: MarkTypeEnum | string | (MarkTypeEnum | string)[];
186
125
  name: string;
187
126
  }
188
- export {};
@@ -0,0 +1,39 @@
1
+ import type { IBoundsLike } from '@visactor/vutils';
2
+ import type { ILayoutItem } from '../layout/interface';
3
+ import type { IOrientType, IPolarOrientType, IRect } from '../typings/space';
4
+ import { BaseModel } from './base-model';
5
+ import type { IModelSpec } from './interface';
6
+ import type { IPoint } from '../typings/coordinate';
7
+ import type { ILayoutType, ILayoutPoint, ILayoutRect } from '../typings/layout';
8
+ export declare abstract class LayoutModel<T extends IModelSpec> extends BaseModel<T> {
9
+ protected layoutType: ILayoutType;
10
+ protected layoutLevel?: number;
11
+ protected layoutZIndex: number;
12
+ layoutClip: boolean;
13
+ get layoutOrient(): IOrientType;
14
+ set layoutOrient(v: IOrientType);
15
+ protected _forceLayoutTag: boolean;
16
+ protected _layout: ILayoutItem;
17
+ protected _orient?: IPolarOrientType | IOrientType;
18
+ protected _isLayout: boolean;
19
+ initLayout(): void;
20
+ onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void;
21
+ onLayoutEnd(ctx: any): void;
22
+ afterSetLayoutStartPoint(_pos: ILayoutPoint): void;
23
+ protected _forceLayout(): void;
24
+ getLayoutStartPoint(): ILayoutPoint;
25
+ setLayoutStartPosition(pos: Partial<IPoint>): void;
26
+ getLayoutRect(): ILayoutRect;
27
+ setLayoutRect(rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>): void;
28
+ getLastComputeOutBounds(): IBoundsLike;
29
+ getGraphicBounds: () => {
30
+ x1: number;
31
+ y1: number;
32
+ x2: number;
33
+ y2: number;
34
+ };
35
+ setAttrFromSpec(): void;
36
+ abstract getBoundsInRect(rect: ILayoutRect, fullRect: ILayoutRect): IBoundsLike;
37
+ protected _transformLayoutRect: (rect: ILayoutRect) => ILayoutRect;
38
+ protected _transformLayoutPosition: (rect: Partial<IPoint>) => Partial<IPoint>;
39
+ }
@@ -1,5 +1,5 @@
1
1
  import type { IMark } from '../mark/interface';
2
- import type { IModel, IModelOption, ILayoutItem, ILayoutItemSpec } from '../model/interface';
2
+ import type { ILayoutModel, IModelOption } from '../model/interface';
3
3
  import type { ISeries, SeriesType } from '../series/interface';
4
4
  import type { CoordinateType } from '../typings/coordinate';
5
5
  import type { IInteraction } from '../interaction/interface';
@@ -8,7 +8,8 @@ import type { ConvertToMarkStyleSpec, IRectMarkSpec } from '../typings/visual';
8
8
  import type { IAnimate } from '../animation/interface';
9
9
  import type { IGroupMark } from '../mark/group';
10
10
  import type { StringOrNumber } from '../typings';
11
- export interface IRegion extends IModel, ILayoutItem {
11
+ import type { ILayoutItemSpec } from '../layout/interface';
12
+ export interface IRegion extends ILayoutModel {
12
13
  animate?: IAnimate;
13
14
  interaction: IInteraction;
14
15
  getStackInverse: () => boolean;
@@ -1,27 +1,25 @@
1
1
  import type { IGroupMark as IVGrammarGroupMark } from '@visactor/vgrammar-core';
2
- import { BaseModel } from '../model/base-model';
3
2
  import type { ISeries } from '../series/interface';
4
- import type { IModelOption, ILayoutItem } from '../model/interface';
3
+ import type { IModelOption } from '../model/interface';
5
4
  import type { CoordinateType } from '../typings/coordinate';
6
5
  import type { IRegion, IRegionSpec } from './interface';
7
6
  import type { IGroupMark } from '../mark/group';
8
7
  import type { IInteraction, ITrigger } from '../interaction/interface';
9
8
  import type { IRectMark } from '../mark/rect';
10
9
  import type { IAnimate } from '../animation/interface';
11
- import type { StringOrNumber } from '../typings';
12
- export declare class Region<T extends IRegionSpec = IRegionSpec> extends BaseModel<T> implements IRegion {
10
+ import type { ILayoutType, StringOrNumber } from '../typings';
11
+ import { LayoutModel } from '../model/layout-model';
12
+ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutModel<T> implements IRegion {
13
13
  static type: string;
14
14
  readonly modelType: string;
15
15
  type: string;
16
16
  protected _series: ISeries[];
17
- layoutType: ILayoutItem['layoutType'];
17
+ layoutType: ILayoutType;
18
18
  layoutZIndex: number;
19
19
  animate?: IAnimate;
20
20
  interaction: IInteraction;
21
- protected _maxRegionWidth?: number;
22
21
  getMaxWidth(): number;
23
22
  setMaxWidth(value: number): void;
24
- protected _maxRegionHeight?: number;
25
23
  getMaxHeight(): number;
26
24
  setMaxHeight(value: number): void;
27
25
  protected _groupMark: IGroupMark;
@@ -72,4 +70,11 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends BaseMod
72
70
  initInteraction(): void;
73
71
  compileMarks(group?: string | IVGrammarGroupMark): void;
74
72
  compile(): void;
73
+ getBoundsInRect: () => {
74
+ x1: number;
75
+ y1: number;
76
+ x2: number;
77
+ y2: number;
78
+ };
79
+ onLayoutEnd(ctx: any): void;
75
80
  }
@@ -2,20 +2,20 @@ import { DataView } from '@visactor/vdataset';
2
2
  import type { DataSet, ITransformOptions } from '@visactor/vdataset';
3
3
  import type { IRegion } from '../../region/interface';
4
4
  import type { IMark } from '../../mark/interface';
5
- import type { CoordinateType, IInvalidType, IPoint, DataKeyType, Datum, Maybe, ISeriesSpec, IGroup } from '../../typings';
5
+ import type { CoordinateType, IInvalidType, IPoint, DataKeyType, Datum, Maybe, ISeriesSpec, IGroup, ILayoutType, ILayoutPoint, ILayoutRect } from '../../typings';
6
6
  import { BaseModel } from '../../model/base-model';
7
7
  import type { ISeriesOption, ISeries, ISeriesMarkInitOption, ISeriesStackData, ISeriesTooltipHelper, SeriesMarkMap, ISeriesMarkInfo } from '../interface';
8
8
  import type { IModelEvaluateOption, IModelRenderOption } from '../../model/interface';
9
9
  import type { AddVChartPropertyContext } from '../../data/transforms/add-property';
10
10
  import type { ITrigger } from '../../interaction/interface';
11
- import type { LayoutItem } from '../../model/layout-item';
12
11
  import type { StatisticOperations } from '../../data/transforms/dimension-statistics';
13
12
  import { SeriesData } from './series-data';
14
13
  import type { IGroupMark } from '../../mark/group';
15
14
  import type { ISeriesMarkAttributeContext } from '../../compile/mark';
16
15
  export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> implements ISeries {
16
+ readonly specKey: string;
17
17
  readonly type: string;
18
- layoutType: LayoutItem['layoutType'];
18
+ layoutType: ILayoutType;
19
19
  readonly modelType: string;
20
20
  readonly name: string | undefined;
21
21
  static readonly mark: SeriesMarkMap;
@@ -25,6 +25,10 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
25
25
  readonly coordinate: CoordinateType;
26
26
  protected _region: IRegion;
27
27
  getRegion(): IRegion;
28
+ private _layoutStartPoint;
29
+ getLayoutStartPoint(): ILayoutPoint;
30
+ private _layoutRect;
31
+ getLayoutRect: () => ILayoutRect;
28
32
  protected _rootMark: IGroupMark;
29
33
  getRootMark(): IGroupMark;
30
34
  protected _seriesMark: Maybe<IMark>;
@@ -63,6 +67,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
63
67
  protected _dataSet: DataSet;
64
68
  protected _tooltipHelper: ISeriesTooltipHelper | undefined;
65
69
  get tooltipHelper(): ISeriesTooltipHelper;
70
+ layoutZIndex: number;
66
71
  protected _invalidType: IInvalidType;
67
72
  getInvalidType(): IInvalidType;
68
73
  setInvalidType(t: IInvalidType): void;
@@ -143,7 +148,8 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
143
148
  onEvaluateEnd(ctx: IModelEvaluateOption): void;
144
149
  onRender(ctx: IModelRenderOption): void;
145
150
  release(): void;
146
- onLayoutEnd(ctx: any): void;
151
+ setLayoutStartPosition(pos: Partial<IPoint>): void;
152
+ setLayoutRect({ width, height }: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>): void;
147
153
  getSeriesKeys(): string[];
148
154
  getSeriesStyle(datum: Datum): (attribute: string) => unknown;
149
155
  protected _getSeriesInfo(field: string, keys: string[]): {
@@ -1,5 +1,4 @@
1
- import type { Datum, IMarkSpec, IMarkTheme, ISeriesSpec, IOrientType, IPathMarkSpec, IPolygonMarkSpec, IRuleMarkSpec, ITextMarkSpec, IPyramid3dMarkSpec } from '../../typings';
2
- import type { IPercent } from '../../model/interface';
1
+ import type { Datum, IMarkSpec, IMarkTheme, ISeriesSpec, IOrientType, IPathMarkSpec, IPolygonMarkSpec, IRuleMarkSpec, ITextMarkSpec, IPyramid3dMarkSpec, IPercent } from '../../typings';
3
2
  import type { IAnimationSpec } from '../../animation/spec';
4
3
  import type { SeriesMarkNameEnum } from '../interface/type';
5
4
  type FunnelMarks = 'funnel';
@@ -1,6 +1,6 @@
1
1
  import type { ITrigger } from '../../interaction/interface';
2
2
  import type { PanEventParam, ZoomEventParam } from '../../event/interface';
3
- import type { IModel, ILayoutItem } from '../../model/interface';
3
+ import type { IModel } from '../../model/interface';
4
4
  import type { DataSet, DataView, ITransformOptions } from '@visactor/vdataset';
5
5
  import type { IMark } from '../../mark/interface';
6
6
  import type { CoordinateType, IPoint, IPolarPoint } from '../../typings/coordinate';
@@ -17,12 +17,13 @@ import type { IGroupMark } from '../../mark/group';
17
17
  import type { IArcLabelSpec } from '../pie/interface';
18
18
  import type { IGeoCoordinateHelper } from '../../component/geo/interface';
19
19
  import type { ILabelMark } from '../../mark/label';
20
- export interface ISeries extends IModel, ILayoutItem {
20
+ export interface ISeries extends IModel {
21
21
  readonly type: string;
22
22
  readonly name?: string;
23
23
  tooltipHelper: ISeriesTooltipHelper;
24
24
  getSpec: () => any;
25
25
  readonly coordinate: CoordinateType;
26
+ onLayoutEnd: (ctx: any) => void;
26
27
  getRawData: () => DataView | undefined;
27
28
  getViewDataFilter: () => DataView | undefined;
28
29
  getViewData: () => DataView | undefined;
@@ -5,7 +5,7 @@ import type { IMark, IMarkProgressiveConfig } from '../../mark/interface';
5
5
  import type { ILineMark } from '../../mark/line';
6
6
  import type { ISymbolMark } from '../../mark/symbol';
7
7
  import type { ITextMark } from '../../mark/text';
8
- import type { DirectionType, IInvalidType, InterpolateType, ILineMarkSpec, ISymbolMarkSpec, Maybe, Datum, IMarkTheme } from '../../typings';
8
+ import type { DirectionType, IInvalidType, InterpolateType, ILineMarkSpec, ISymbolMarkSpec, Maybe, Datum, IMarkTheme, ILayoutRect } from '../../typings';
9
9
  import type { ISeriesMarkInfo, ISeriesMarkInitOption, ISeriesTooltipHelper } from '../interface';
10
10
  import type { ILabelSpec } from '../../component/label';
11
11
  import { type DimensionEventParams } from '../../event/events/dimension';
@@ -44,6 +44,7 @@ export interface LineLikeSeriesMixin extends ISeries {
44
44
  _createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption) => IMark;
45
45
  _getInvalidDefined: () => boolean;
46
46
  _getInvalidConnectType: () => IInvalidType;
47
+ getLayoutRect: () => ILayoutRect;
47
48
  }
48
49
  export declare class LineLikeSeriesMixin {
49
50
  addSamplingCompile(): void;
@@ -21,6 +21,7 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
21
21
  protected _linksSeriesData?: SeriesData;
22
22
  private _viewBox;
23
23
  protected _categoryField: string;
24
+ private _colorScale;
24
25
  getCategoryField(): string;
25
26
  setCategoryField(f: string): string;
26
27
  protected _valueField: string;
@@ -46,7 +47,7 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
46
47
  protected _handleNodeRelatedClick: (element: IElement) => void;
47
48
  protected _handleLinkRelatedClick: (element: IGlyphElement) => void;
48
49
  protected initTooltip(): void;
49
- getNodeOrdinalColorScale(item: string): any;
50
+ _setNodeOrdinalColorScale(): void;
50
51
  getNodeList(): any;
51
52
  _getNodeNameFromData(datum: Datum): any;
52
53
  extractNamesFromTree(tree: any, categoryName: string): Set<unknown>;
@@ -0,0 +1,2 @@
1
+ import type { IBandAxisTheme } from '../../../../../component/axis';
2
+ export declare const axisBand: IBandAxisTheme;
@@ -0,0 +1,3 @@
1
+ import type { ICartesianAxisCommonTheme } from '../../../../../component/axis/cartesian/interface';
2
+ export declare const axisX: ICartesianAxisCommonTheme;
3
+ export declare const axisY: ICartesianAxisCommonTheme;
@@ -0,0 +1,2 @@
1
+ import type { IAxisCommonTheme } from '../../../../../component/axis';
2
+ export declare const commonAxis: IAxisCommonTheme;
@@ -0,0 +1,2 @@
1
+ import type { IAxisCommonTheme } from '../../../../../component/axis';
2
+ export declare const axisLinear: IAxisCommonTheme;
@@ -0,0 +1,3 @@
1
+ import type { IPolarAxisCommonTheme } from '../../../../../component/axis/polar/interface/theme';
2
+ export declare const axisRadius: IPolarAxisCommonTheme;
3
+ export declare const axisAngle: IPolarAxisCommonTheme;
@@ -0,0 +1,2 @@
1
+ import type { ICrosshairTheme } from '../../../../component/crosshair/interface';
2
+ export declare const crosshair: ICrosshairTheme;
@@ -0,0 +1,2 @@
1
+ import type { IDataZoomTheme } from '../../../../component/data-zoom';
2
+ export declare const dataZoom: IDataZoomTheme;
@@ -0,0 +1,2 @@
1
+ import type { IComponentTheme } from '../../../../component/interface';
2
+ export declare const component: IComponentTheme;
@@ -0,0 +1,2 @@
1
+ import type { IIndicatorTheme } from '../../../../component/indicator/interface';
2
+ export declare const indicator: IIndicatorTheme;
@@ -0,0 +1,2 @@
1
+ import type { IColorLegendTheme } from '../../../../../component/legend';
2
+ export declare const colorLegend: IColorLegendTheme;
@@ -0,0 +1,2 @@
1
+ import type { IContinuousLegendTheme } from '../../../../../component/legend';
2
+ export declare const DEFAULT_CONTINUOUS_LEGEND_THEME: IContinuousLegendTheme;
@@ -0,0 +1,2 @@
1
+ import type { IDiscreteLegendTheme } from '../../../../../component/legend';
2
+ export declare const discreteLegend: IDiscreteLegendTheme;
@@ -0,0 +1,2 @@
1
+ import type { ISizeLegendTheme } from '../../../../../component/legend';
2
+ export declare const sizeLegend: ISizeLegendTheme;
@@ -0,0 +1,2 @@
1
+ import type { IMapLabelTheme } from '../../../../component/map-label';
2
+ export declare const mapLabel: IMapLabelTheme;
@@ -0,0 +1,2 @@
1
+ import type { IMarkAreaTheme } from '../../../../component/marker/mark-area/interface';
2
+ export declare const markArea: IMarkAreaTheme;
@@ -0,0 +1,2 @@
1
+ import type { IMarkLineTheme } from '../../../../component/marker/mark-line/interface';
2
+ export declare const markLine: IMarkLineTheme;
@@ -0,0 +1,2 @@
1
+ import type { IMarkPointTheme } from '../../../../component/marker/mark-point/interface';
2
+ export declare const markPoint: IMarkPointTheme;
@@ -0,0 +1,2 @@
1
+ import type { IPlayerTheme } from '../../../../component/player';
2
+ export declare const player: IPlayerTheme;
@@ -0,0 +1,2 @@
1
+ import type { IPoptipTheme } from '../../../../component/poptip/interface';
2
+ export declare const poptip: IPoptipTheme;
@@ -0,0 +1,2 @@
1
+ import type { ITitleTheme } from '../../../../component/title/interface';
2
+ export declare const title: ITitleTheme;
@@ -0,0 +1,2 @@
1
+ import type { ITooltipTheme } from '../../../../component/tooltip/interface';
2
+ export declare const tooltip: ITooltipTheme;
@@ -0,0 +1,2 @@
1
+ import type { ITotalLabelTheme } from '../../../../component/label';
2
+ export declare const totalLabel: ITotalLabelTheme;
@@ -0,0 +1,2 @@
1
+ import type { IThemeConstants } from '../../interface';
2
+ export declare const THEME_CONSTANTS: IThemeConstants;
@@ -0,0 +1,3 @@
1
+ import type { IGlobalMarkThemeByName, IGlobalMarkThemeByType } from '../../interface';
2
+ export declare const markByType: IGlobalMarkThemeByType;
3
+ export declare const markByName: IGlobalMarkThemeByName;
@@ -0,0 +1,2 @@
1
+ import type { ITheme } from '../../interface';
2
+ export declare const darkMobileTheme: ITheme;
@@ -0,0 +1,2 @@
1
+ import type { ITheme } from '../../interface';
2
+ export declare const lightMobileTheme: ITheme;
@@ -1,7 +1,6 @@
1
- import type { ILayoutPaddingSpec } from '../model/interface';
2
1
  import type { ISeriesTheme } from '../series/interface';
3
2
  import type { IMarkTheme } from '../typings/spec';
4
- import type { IArcMarkSpec, IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, IPathMarkSpec } from '../typings';
3
+ import type { IArcMarkSpec, IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, IPathMarkSpec, ILayoutPaddingSpec } from '../typings';
5
4
  import type { MarkTypeEnum } from '../mark/interface';
6
5
  import type { IColorKey, IThemeColorScheme } from './color-scheme/interface';
7
6
  import type { IGradientColor } from '@visactor/vrender-core';
@@ -12,3 +12,4 @@ export * from './visual';
12
12
  export * from './common';
13
13
  export * from './spec';
14
14
  export * from './group';
15
+ export * from './layout';
@@ -0,0 +1,23 @@
1
+ export type ILayoutNumber = number | IPercent | ((layoutRect: ILayoutRect) => number) | IPercentOffset;
2
+ export interface ILayoutPoint {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export interface ILayoutRect {
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export type IPercent = `${number}%`;
11
+ export type IPercentOffset = {
12
+ percent?: number;
13
+ offset?: number;
14
+ };
15
+ export type ILayoutPercent = IPercent | number;
16
+ export type ILayoutType = 'region-relative' | 'region' | 'normal' | 'absolute' | 'normal-inline';
17
+ export type ILayoutOrientPadding = {
18
+ left?: ILayoutNumber;
19
+ right?: ILayoutNumber;
20
+ top?: ILayoutNumber;
21
+ bottom?: ILayoutNumber;
22
+ };
23
+ export type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[];
@@ -1,5 +1,4 @@
1
1
  import type { IFillMarkSpec, IImageMarkSpec } from '../visual';
2
- import type { ILayoutPaddingSpec } from '../../model/interface';
3
2
  import type { LayoutCallBack } from '../../layout/interface';
4
3
  import type { IElement, srIOption3DType } from '@visactor/vgrammar-core';
5
4
  import type { DataSet, DataView, ISimplifyOptions, IFieldsOptions, IFilterOptions, IFoldOptions, IDsvParserOptions } from '@visactor/vdataset';
@@ -11,7 +10,6 @@ import type { ILayoutSpec } from '../../layout/interface';
11
10
  import type { ConvertToMarkStyleSpec, IArc3dMarkSpec, IArcMarkSpec, IAreaMarkSpec, IBoxPlotMarkSpec, ICommonSpec, IGroupMarkSpec, ILineMarkSpec, ILinkPathMarkSpec, IPathMarkSpec, IPolygonMarkSpec, IProgressArcMarkSpec, IPyramid3dMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IRuleMarkSpec, ISymbolMarkSpec, IRippleMarkSpec, ITextMarkSpec, IVisualSpecScale } from '../visual';
12
11
  import type { StateValue } from '../../compile/mark';
13
12
  import type { ISeriesStyle, SeriesType } from '../../series/interface';
14
- import type { ILayoutOrientPadding } from '../../model/interface';
15
13
  import type { Datum, StringOrNumber } from '../common';
16
14
  import type { IInvalidType } from '../data';
17
15
  import type { IMorphSeriesSpec } from '../../animation/spec';
@@ -25,6 +23,7 @@ import type { IBrushSpec } from '../../component/brush';
25
23
  import type { ITotalLabelSpec } from '../../component/label';
26
24
  import type { ILegendSpec } from '../../component/legend';
27
25
  import type { IColorKey } from '../../theme/color-scheme/interface';
26
+ import type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';
28
27
  export type IChartPadding = ILayoutOrientPadding | number;
29
28
  export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
30
29
  dom?: string | HTMLElement;
@@ -1,7 +1,7 @@
1
1
  import { type IBoundsLike } from '@visactor/vutils';
2
- import type { ILayoutPaddingSpec, IPercentOffset, ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
3
2
  import type { IPadding, IRect } from '../typings/space';
4
3
  import type { IPoint } from '../typings/coordinate';
4
+ import type { ILayoutNumber, ILayoutRect, IPercent, IPercentOffset, ILayoutPaddingSpec, ILayoutOrientPadding } from '../typings/layout';
5
5
  export declare function isValidOrient(orient: string): boolean;
6
6
  export declare function isPointInRect(point: IPoint, rect: IRect): boolean;
7
7
  export declare function isPercent(v: any): v is IPercent;