@visactor/vchart-types 1.9.4 → 1.9.5
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/base/util.d.ts +1 -1
- package/types/component/axis/base-axis.d.ts +6 -5
- package/types/component/axis/cartesian/axis.d.ts +1 -5
- package/types/component/axis/polar/axis.d.ts +1 -5
- package/types/interaction/interaction.d.ts +5 -0
- package/types/interaction/interface.d.ts +4 -1
- package/types/series/base/base-series.d.ts +2 -0
- package/types/series/interface/common.d.ts +1 -1
- package/types/typings/spec/common.d.ts +2 -0
|
@@ -3,5 +3,5 @@ import type { IRegionSpec, IRegionSpecInfo } from '../../region/interface';
|
|
|
3
3
|
import type { IChartSpecInfo } from '../interface';
|
|
4
4
|
import type { ISeriesSpecInfo } from '../../series/interface';
|
|
5
5
|
import type { ISeriesSpec } from '../../typings';
|
|
6
|
-
export declare const getRelatedRegionInfo: (modelInfo: IModelSpecInfo, currentChartSpecInfo: IChartSpecInfo) => IRegionSpecInfo<IRegionSpec
|
|
6
|
+
export declare const getRelatedRegionInfo: (modelInfo: IModelSpecInfo, currentChartSpecInfo: IChartSpecInfo) => Array<IRegionSpecInfo<IRegionSpec>> | undefined;
|
|
7
7
|
export declare const getRelatedSeriesInfo: (modelInfo: IModelSpecInfo, currentChartSpecInfo: IChartSpecInfo) => Array<ISeriesSpecInfo<ISeriesSpec>> | undefined;
|
|
@@ -39,11 +39,7 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
39
39
|
protected abstract axisHelper(): any;
|
|
40
40
|
protected abstract getSeriesStatisticsField(s: ISeries): string[];
|
|
41
41
|
protected abstract updateSeriesScale(): void;
|
|
42
|
-
protected abstract
|
|
43
|
-
min: number;
|
|
44
|
-
max: number;
|
|
45
|
-
values: any[];
|
|
46
|
-
}[];
|
|
42
|
+
protected abstract collectSeriesField(depth: number, series: ISeries): string | string[];
|
|
47
43
|
abstract transformScaleDomain(): void;
|
|
48
44
|
protected _dataFieldText: string;
|
|
49
45
|
protected _axisMark: IComponentMark;
|
|
@@ -54,6 +50,11 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
54
50
|
getVRenderComponents(): any[];
|
|
55
51
|
created(): void;
|
|
56
52
|
protected _initData(): void;
|
|
53
|
+
protected collectData(depth: number, rawData?: boolean): {
|
|
54
|
+
min: number;
|
|
55
|
+
max: number;
|
|
56
|
+
values: any[];
|
|
57
|
+
}[];
|
|
57
58
|
protected isSeriesDataEnable(): boolean;
|
|
58
59
|
protected setSeriesAndRegionsFromSpec(): void;
|
|
59
60
|
getBindSeriesFilter(): {
|
|
@@ -86,11 +86,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
|
|
|
86
86
|
update(ctx: IComponentOption): void;
|
|
87
87
|
resize(ctx: IComponentOption): void;
|
|
88
88
|
protected collectScale(): IBaseScale[];
|
|
89
|
-
protected
|
|
90
|
-
min: number;
|
|
91
|
-
max: number;
|
|
92
|
-
values: any[];
|
|
93
|
-
}[];
|
|
89
|
+
protected collectSeriesField(depth: number, series: ICartesianSeries): string | string[];
|
|
94
90
|
protected updateSeriesScale(): void;
|
|
95
91
|
_transformLayoutPosition: (pos: Partial<IPoint>) => {
|
|
96
92
|
x: number;
|
|
@@ -44,11 +44,7 @@ export declare abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarA
|
|
|
44
44
|
protected _tickTransformOption(): IPolarTickDataOpt;
|
|
45
45
|
afterCompile(): void;
|
|
46
46
|
protected updateScaleRange(): boolean;
|
|
47
|
-
protected
|
|
48
|
-
min: number;
|
|
49
|
-
max: number;
|
|
50
|
-
values: any[];
|
|
51
|
-
}[];
|
|
47
|
+
protected collectSeriesField(depth: number, series: IPolarSeries): string | string[];
|
|
52
48
|
protected abstract computeDomain(data: {
|
|
53
49
|
min: number;
|
|
54
50
|
max: number;
|
|
@@ -3,9 +3,12 @@ import type { IElement } from '@visactor/vgrammar-core';
|
|
|
3
3
|
import type { BaseEventParams } from '../event/interface';
|
|
4
4
|
import type { IMark } from '../mark/interface';
|
|
5
5
|
import type { IInteraction } from './interface';
|
|
6
|
+
import type { IInteraction as IVGrammarInteraction } from '@visactor/vgrammar-core';
|
|
6
7
|
export declare class Interaction implements IInteraction {
|
|
7
8
|
private _stateMarks;
|
|
8
9
|
private _stateElements;
|
|
10
|
+
private _vgrammarInteractions;
|
|
11
|
+
addVgrammarInteraction(state: StateValue, i: IVGrammarInteraction): void;
|
|
9
12
|
static markStateEnable(mark: IMark, state: string): boolean;
|
|
10
13
|
private _disableTriggerEvent;
|
|
11
14
|
setDisableActiveEffect(disable: boolean): void;
|
|
@@ -19,4 +22,6 @@ export declare class Interaction implements IInteraction {
|
|
|
19
22
|
addEventElement(stateValue: StateValue, element: IElement): void;
|
|
20
23
|
clearEventElement(stateValue: StateValue, clearReverse: boolean): void;
|
|
21
24
|
reverseEventElement(stateValue: StateValue): void;
|
|
25
|
+
startInteraction(stateValue: StateValue, element: IElement): void;
|
|
26
|
+
resetInteraction(stateValue: StateValue, element: IElement): void;
|
|
22
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementActiveByLegendSpec, ElementActiveSpec, ElementHighlightByGroupSpec, ElementHighlightByKeySpec, ElementHighlightByLegendSpec, ElementHighlightByNameSpec, ElementHighlightSpec, ElementSelectSpec, IElement } from '@visactor/vgrammar-core';
|
|
1
|
+
import type { ElementActiveByLegendSpec, ElementActiveSpec, ElementHighlightByGroupSpec, ElementHighlightByKeySpec, ElementHighlightByLegendSpec, ElementHighlightByNameSpec, ElementHighlightSpec, ElementSelectSpec, IElement, IInteraction as IVGrammarInteraction } from '@visactor/vgrammar-core';
|
|
2
2
|
import type { IMark } from '../mark/interface';
|
|
3
3
|
import type { RenderMode } from '../typings/spec/common';
|
|
4
4
|
import type { BaseEventParams, IEventDispatcher, EventType } from '../event/interface';
|
|
@@ -17,6 +17,9 @@ export interface IInteraction {
|
|
|
17
17
|
clearEventElement: (stateValue: StateValue, clearReverse: boolean) => void;
|
|
18
18
|
reverseEventElement: (stateValue: StateValue) => void;
|
|
19
19
|
setDisableActiveEffect: (disable: boolean) => void;
|
|
20
|
+
addVgrammarInteraction: (state: StateValue, i: IVGrammarInteraction) => void;
|
|
21
|
+
startInteraction: (state: StateValue, element: IElement) => void;
|
|
22
|
+
resetInteraction: (state: StateValue, element: IElement) => void;
|
|
20
23
|
}
|
|
21
24
|
export interface ITrigger {
|
|
22
25
|
init: () => void;
|
|
@@ -130,6 +130,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
130
130
|
protected _updateExtensionMarkSpec(lastSpec?: any): void;
|
|
131
131
|
getStackData(): ISeriesStackData;
|
|
132
132
|
protected _parseDefaultInteractionConfig(mainMarks?: IMark[]): ({
|
|
133
|
+
vchartState: STATE_VALUE_ENUM;
|
|
133
134
|
seriesId: number;
|
|
134
135
|
regionId: number;
|
|
135
136
|
selector: string[];
|
|
@@ -142,6 +143,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
142
143
|
state?: undefined;
|
|
143
144
|
isMultiple?: undefined;
|
|
144
145
|
} | {
|
|
146
|
+
vchartState: STATE_VALUE_ENUM;
|
|
145
147
|
type: string;
|
|
146
148
|
seriesId: number;
|
|
147
149
|
regionId: number;
|
|
@@ -57,7 +57,7 @@ export interface ISeriesMarkInitOption {
|
|
|
57
57
|
parent?: IGroupMark | false;
|
|
58
58
|
isSeriesMark?: boolean;
|
|
59
59
|
depend?: IGrammarItem | IGrammarItem[];
|
|
60
|
-
key?: string;
|
|
60
|
+
key?: string | ((datum: any) => string);
|
|
61
61
|
groupKey?: string;
|
|
62
62
|
morph?: boolean;
|
|
63
63
|
defaultMorphElementKey?: string;
|
|
@@ -259,6 +259,7 @@ export type EnableMarkType = keyof IBuildinMarkSpec;
|
|
|
259
259
|
export interface ICustomMarkSpec<T extends EnableMarkType> extends IMarkSpec<IBuildinMarkSpec[T]> {
|
|
260
260
|
type: T;
|
|
261
261
|
dataIndex?: number;
|
|
262
|
+
dataKey?: string | ((datum: any) => string);
|
|
262
263
|
dataId?: StringOrNumber;
|
|
263
264
|
componentType?: string;
|
|
264
265
|
}
|
|
@@ -267,6 +268,7 @@ export interface ICustomMarkGroupSpec extends ICustomMarkSpec<MarkTypeEnum.group
|
|
|
267
268
|
}
|
|
268
269
|
export interface IExtensionMarkSpec<T extends Exclude<EnableMarkType, 'group'>> extends ICustomMarkSpec<T> {
|
|
269
270
|
dataIndex?: number;
|
|
271
|
+
dataKey?: string | ((datum: any) => string);
|
|
270
272
|
dataId?: StringOrNumber;
|
|
271
273
|
componentType?: string;
|
|
272
274
|
}
|