@visactor/vchart-types 1.7.0-alpha.1 → 1.7.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/chart/util.d.ts +8 -0
- package/types/compile/mark/compilable-mark.d.ts +5 -0
- package/types/compile/mark/interface.d.ts +2 -0
- package/types/component/axis/interface/spec.d.ts +1 -0
- package/types/component/data-zoom/data-filter-base-component.d.ts +4 -1
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/types/component/label/interface.d.ts +1 -0
- package/types/component/label/util.d.ts +1 -1
- package/types/series/interface/common.d.ts +2 -0
- package/types/typings/spec/common.d.ts +2 -0
- package/types/typings/visual.d.ts +0 -1
package/types/chart/util.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IChartSpec } from '../typings';
|
|
1
2
|
import type { ICartesianChartSpec } from './cartesian/interface';
|
|
2
3
|
import type { IChartOption } from './interface/common';
|
|
3
4
|
import type { IUpdateSpecResult } from '../model/interface';
|
|
@@ -10,3 +11,10 @@ export declare function calculateChartSize(spec: {
|
|
|
10
11
|
height: number;
|
|
11
12
|
};
|
|
12
13
|
export declare function mergeUpdateResult(resultA: IUpdateSpecResult, resultB: IUpdateSpecResult): IUpdateSpecResult;
|
|
14
|
+
export declare function getTrimPaddingConfig(chartType: string, spec: IChartSpec): {
|
|
15
|
+
paddingInner: number;
|
|
16
|
+
paddingOuter: number;
|
|
17
|
+
} | {
|
|
18
|
+
paddingOuter: number;
|
|
19
|
+
paddingInner?: undefined;
|
|
20
|
+
};
|
|
@@ -10,6 +10,7 @@ import { MarkData } from './mark-data';
|
|
|
10
10
|
import { GrammarType } from '../interface/compilable-item';
|
|
11
11
|
import type { IEvent } from '../../event/interface';
|
|
12
12
|
import type { TransformedLabelSpec } from '../../component/label';
|
|
13
|
+
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
13
14
|
export declare abstract class CompilableMark extends GrammarItem implements ICompilableMark {
|
|
14
15
|
readonly grammarType = GrammarType.mark;
|
|
15
16
|
readonly type: MarkType;
|
|
@@ -75,6 +76,10 @@ export declare abstract class CompilableMark extends GrammarItem implements ICom
|
|
|
75
76
|
protected _progressiveConfig: IMarkProgressiveConfig;
|
|
76
77
|
getProgressiveConfig(): IMarkProgressiveConfig;
|
|
77
78
|
setProgressiveConfig(config: IMarkProgressiveConfig): void;
|
|
79
|
+
protected _setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
|
|
80
|
+
setCustomizedShapeCallback(callback: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D): void;
|
|
81
|
+
protected _enableSegments: boolean;
|
|
82
|
+
setEnableSegments(enable: boolean): void;
|
|
78
83
|
protected _option: ICompilableMarkOption;
|
|
79
84
|
constructor(option: ICompilableMarkOption, name: string, model: IModel);
|
|
80
85
|
protected _product: Maybe<IMark>;
|
|
@@ -9,6 +9,7 @@ import type { Maybe, Datum, StringOrNumber } from '../../typings';
|
|
|
9
9
|
import type { MarkData } from './mark-data';
|
|
10
10
|
import type { TransformedLabelSpec } from '../../component/label';
|
|
11
11
|
import type { IRegion } from '../../region/interface';
|
|
12
|
+
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
12
13
|
export interface ICompilableMarkOption extends GrammarItemInitOption {
|
|
13
14
|
key?: string | ((datum: Datum) => string);
|
|
14
15
|
groupKey?: string;
|
|
@@ -69,6 +70,7 @@ export interface ICompilableMark extends IGrammarItem {
|
|
|
69
70
|
getMarks: () => ICompilableMark[];
|
|
70
71
|
setSkipBeforeLayouted: (skip: boolean) => void;
|
|
71
72
|
getSkipBeforeLayouted: () => boolean;
|
|
73
|
+
setCustomizedShapeCallback: (callback: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D) => void;
|
|
72
74
|
runAnimationByState: (animationState?: string) => IAnimateArranger;
|
|
73
75
|
stopAnimationByState: (animationState?: string) => IAnimate;
|
|
74
76
|
pauseAnimationByState: (animationState: string) => IAnimate;
|
|
@@ -31,6 +31,7 @@ export interface ILinearAxisSpec {
|
|
|
31
31
|
tooltipFilterRange?: number | [number, number];
|
|
32
32
|
}
|
|
33
33
|
export interface IBandAxisSpec {
|
|
34
|
+
trimPadding?: boolean;
|
|
34
35
|
bandPadding?: number | number[];
|
|
35
36
|
paddingInner?: number | number[];
|
|
36
37
|
paddingOuter?: number | number[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from '../base/base-component';
|
|
2
2
|
import type { IEffect, IModelInitOption } from '../../model/interface';
|
|
3
3
|
import type { IComponent, IComponentOption } from '../interface';
|
|
4
|
-
import type { AdaptiveSpec, ILayoutRect, ILayoutType, IOrientType, StringOrNumber } from '../../typings';
|
|
4
|
+
import type { AdaptiveSpec, ILayoutRect, ILayoutType, IOrientType, IRect, StringOrNumber } from '../../typings';
|
|
5
5
|
import type { IBaseScale } from '@visactor/vscale';
|
|
6
6
|
import type { ICartesianBandAxisSpec } from '../axis/cartesian';
|
|
7
7
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
@@ -61,6 +61,8 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
61
61
|
protected abstract _computeHeight(): number;
|
|
62
62
|
protected abstract _handleDataCollectionChange(): void;
|
|
63
63
|
protected _handleChange(start: number, end: number, updateComponent?: boolean): void;
|
|
64
|
+
protected _isReverse(): boolean;
|
|
65
|
+
protected _updateRangeFactor(tag?: string, label?: string): void;
|
|
64
66
|
effect: IEffect;
|
|
65
67
|
protected _visible: boolean;
|
|
66
68
|
get visible(): boolean;
|
|
@@ -109,6 +111,7 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
109
111
|
protected _handleChartMove: (value: number, rate: number) => void;
|
|
110
112
|
protected _initCommonEvent(): void;
|
|
111
113
|
updateLayoutAttribute(): void;
|
|
114
|
+
onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void;
|
|
112
115
|
getBoundsInRect(rect: ILayoutRect): IBoundsLike;
|
|
113
116
|
hide(): void;
|
|
114
117
|
show(): void;
|
|
@@ -27,7 +27,7 @@ export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends D
|
|
|
27
27
|
onLayoutEnd(ctx: any): void;
|
|
28
28
|
protected _initValueScale(): void;
|
|
29
29
|
protected _updateScaleRange(): void;
|
|
30
|
-
protected _computeDomainOfValueScale():
|
|
30
|
+
protected _computeDomainOfValueScale(): unknown[];
|
|
31
31
|
protected _computeMiddleHandlerSize(): number;
|
|
32
32
|
protected _computeWidth(): number;
|
|
33
33
|
protected _computeHeight(): number;
|
|
@@ -10,6 +10,7 @@ export interface ILabelSpec extends IComponentSpec {
|
|
|
10
10
|
visible?: boolean;
|
|
11
11
|
interactive?: boolean;
|
|
12
12
|
formatMethod?: (text: string | string[], datum?: Datum, ctx?: ILabelFormatMethodContext) => string | string[];
|
|
13
|
+
formatter?: string;
|
|
13
14
|
offset?: number;
|
|
14
15
|
position?: string;
|
|
15
16
|
style?: ConvertToMarkStyleSpec<ITextMarkSpec>;
|
|
@@ -20,7 +20,7 @@ export declare enum LabelRule {
|
|
|
20
20
|
stackLabel = "stackLabel",
|
|
21
21
|
line = "line"
|
|
22
22
|
}
|
|
23
|
-
export declare function textAttribute(labelInfo: ILabelInfo, datum: Datum, formatMethod?: ILabelSpec['formatMethod']): any;
|
|
23
|
+
export declare function textAttribute(labelInfo: ILabelInfo, datum: Datum, formatMethod?: ILabelSpec['formatMethod'], formatter?: ILabelSpec['formatter']): any;
|
|
24
24
|
export declare function symbolLabel(labelInfo: ILabelInfo): {
|
|
25
25
|
position: string | ((datum: Datum) => any);
|
|
26
26
|
overlap: boolean | {
|
|
@@ -9,6 +9,7 @@ import type { IMarkProgressiveConfig } from '../../mark/interface';
|
|
|
9
9
|
import type { StringOrNumber } from '../../typings';
|
|
10
10
|
import type { TransformedLabelSpec } from '../../component/label';
|
|
11
11
|
import type { SeriesMarkNameEnum } from './type';
|
|
12
|
+
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
12
13
|
export interface ISeriesSeriesInfo {
|
|
13
14
|
key: string;
|
|
14
15
|
index?: number;
|
|
@@ -66,6 +67,7 @@ export interface ISeriesMarkInitOption {
|
|
|
66
67
|
progressive?: IMarkProgressiveConfig;
|
|
67
68
|
label?: TransformedLabelSpec;
|
|
68
69
|
support3d?: boolean;
|
|
70
|
+
customShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
|
|
69
71
|
}
|
|
70
72
|
export interface ISeriesMarkInfo extends IModelMarkInfo {
|
|
71
73
|
name: SeriesMarkNameEnum | string;
|
|
@@ -23,6 +23,7 @@ import type { IBrushSpec } from '../../component/brush';
|
|
|
23
23
|
import type { ITotalLabelSpec } from '../../component/label';
|
|
24
24
|
import type { ILegendSpec } from '../../component/legend';
|
|
25
25
|
import type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';
|
|
26
|
+
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
26
27
|
export type IChartPadding = ILayoutOrientPadding | number;
|
|
27
28
|
export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
28
29
|
dom?: string | HTMLElement;
|
|
@@ -169,6 +170,7 @@ export type IMarkSpec<T extends ICommonSpec = ICommonSpec> = {
|
|
|
169
170
|
style?: ConvertToMarkStyleSpec<T>;
|
|
170
171
|
state?: Record<StateValue, IMarkStateSpec<T> | IMarkStateStyleSpec<T>>;
|
|
171
172
|
support3d?: boolean;
|
|
173
|
+
customShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
|
|
172
174
|
} & IMarkProgressiveConfig;
|
|
173
175
|
export type IMarkStateFilter = {
|
|
174
176
|
fields: {
|
|
@@ -98,7 +98,6 @@ export interface ISymbolMarkSpec extends IFillMarkSpec {
|
|
|
98
98
|
export interface ILineLikeMarkSpec extends IFillMarkSpec {
|
|
99
99
|
curveType?: InterpolateType;
|
|
100
100
|
defined?: boolean;
|
|
101
|
-
enableSegments?: boolean;
|
|
102
101
|
}
|
|
103
102
|
export interface IAreaMarkSpec extends ILineLikeMarkSpec {
|
|
104
103
|
x1?: number;
|