@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.
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/animation/utils.d.ts +2 -2
- package/types/chart/base-chart.d.ts +4 -4
- package/types/chart/interface/chart.d.ts +2 -2
- package/types/compile/mark/compilable-mark.d.ts +1 -2
- package/types/component/axis/base-axis.d.ts +1 -0
- package/types/component/axis/cartesian/axis.d.ts +12 -9
- package/types/component/axis/cartesian/interface/theme.d.ts +1 -1
- package/types/component/axis/polar/axis.d.ts +3 -4
- package/types/component/base/base-component.d.ts +12 -4
- package/types/component/brush/brush.d.ts +3 -4
- package/types/component/crosshair/base.d.ts +4 -5
- package/types/component/crosshair/cartesian.d.ts +2 -0
- package/types/component/crosshair/interface/spec.d.ts +1 -1
- package/types/component/crosshair/polar.d.ts +2 -0
- package/types/component/custom-mark/custom-mark.d.ts +3 -4
- package/types/component/data-zoom/data-filter-base-component.d.ts +6 -8
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/types/component/data-zoom/data-zoom/interface.d.ts +1 -0
- package/types/component/data-zoom/scroll-bar/interface.d.ts +1 -1
- package/types/component/geo/geo-coordinate.d.ts +4 -3
- package/types/component/indicator/indicator.d.ts +2 -4
- package/types/component/indicator/interface.d.ts +1 -1
- package/types/component/interface/common.d.ts +3 -3
- package/types/component/label/base-label.d.ts +3 -4
- package/types/component/label/label.d.ts +3 -3
- package/types/component/label/totalLabel.d.ts +3 -3
- package/types/component/legend/base-legend.d.ts +6 -9
- package/types/component/legend/continuous/legend.d.ts +4 -1
- package/types/component/legend/discrete/legend.d.ts +4 -1
- package/types/component/legend/discrete/util.d.ts +1 -1
- package/types/component/legend/util.d.ts +1 -1
- package/types/component/map-label/component.d.ts +2 -4
- package/types/component/marker/base-marker.d.ts +2 -3
- package/types/component/marker/interface.d.ts +1 -1
- package/types/component/marker/mark-area/mark-area.d.ts +1 -3
- package/types/component/marker/mark-line/mark-line.d.ts +1 -3
- package/types/component/marker/mark-point/mark-point.d.ts +1 -3
- package/types/component/player/interface/theme.d.ts +1 -1
- package/types/component/player/player.d.ts +6 -7
- package/types/component/title/interface/theme.d.ts +1 -1
- package/types/component/title/title.d.ts +6 -9
- package/types/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
- package/types/component/tooltip/tooltip.d.ts +4 -3
- package/types/constant/layout.d.ts +1 -0
- package/types/core/factory.d.ts +5 -2
- package/types/core/vchart.d.ts +1 -0
- package/types/event/events/base.d.ts +16 -0
- package/types/event/events/dimension/util/cartesian.d.ts +1 -1
- package/types/event/events/dimension/util/common.d.ts +1 -2
- package/types/event/events/dimension/util/polar.d.ts +1 -1
- package/types/event/interface.d.ts +1 -1
- package/types/interaction/zoom/zoomable.d.ts +1 -0
- package/types/layout/base-layout.d.ts +3 -5
- package/types/layout/grid-layout/grid-layout.d.ts +1 -2
- package/types/layout/interface.d.ts +74 -6
- package/types/layout/layout-item.d.ts +71 -0
- package/types/layout/layout3d/index.d.ts +2 -4
- package/types/layout/util.d.ts +1 -1
- package/types/mark/base/base-mark.d.ts +3 -3
- package/types/model/base-model.d.ts +10 -6
- package/types/model/interface.d.ts +20 -82
- package/types/model/layout-model.d.ts +39 -0
- package/types/region/interface.d.ts +3 -2
- package/types/region/region.d.ts +12 -7
- package/types/series/base/base-series.d.ts +10 -4
- package/types/series/funnel/interface.d.ts +1 -2
- package/types/series/interface/series.d.ts +3 -2
- package/types/series/mixin/line-mixin.d.ts +2 -1
- package/types/series/sankey/sankey.d.ts +2 -1
- package/types/theme/builtin/common-mobile/component/axis/band-axis.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +3 -0
- package/types/theme/builtin/common-mobile/component/axis/common-axis.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +3 -0
- package/types/theme/builtin/common-mobile/component/crosshair.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/data-zoom.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/index.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/indicator.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/legend/color-legend.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/legend/continuous.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/legend/size-legend.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/map-label.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/mark-area.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/mark-line.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/mark-point.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/player.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/poptip.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/title.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/tooltip.d.ts +2 -0
- package/types/theme/builtin/common-mobile/component/total-label.d.ts +2 -0
- package/types/theme/builtin/common-mobile/constants.d.ts +2 -0
- package/types/theme/builtin/common-mobile/mark.d.ts +3 -0
- package/types/theme/builtin/dark-mobile/index.d.ts +2 -0
- package/types/theme/builtin/light-mobile/index.d.ts +2 -0
- package/types/theme/interface.d.ts +1 -2
- package/types/typings/index.d.ts +1 -0
- package/types/typings/layout.d.ts +23 -0
- package/types/typings/spec/common.d.ts +1 -2
- package/types/util/space.d.ts +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { IEvent } from '../event/interface';
|
|
2
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
18
|
-
|
|
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
|
|
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 {
|
|
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
|
-
|
|
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;
|
package/types/region/region.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
50
|
+
_setNodeOrdinalColorScale(): void;
|
|
50
51
|
getNodeList(): any;
|
|
51
52
|
_getNodeNameFromData(datum: Datum): any;
|
|
52
53
|
extractNamesFromTree(tree: any, categoryName: string): Set<unknown>;
|
|
@@ -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';
|
package/types/typings/index.d.ts
CHANGED
|
@@ -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;
|
package/types/util/space.d.ts
CHANGED
|
@@ -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;
|