@visactor/vchart-types 1.8.3 → 1.8.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 +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/animation/utils.d.ts +1 -1
- package/types/component/interface/theme.d.ts +1 -0
- package/types/component/marker/interface.d.ts +3 -4
- package/types/interaction/trigger.d.ts +1 -0
- package/types/plugin/chart/media-query/interface/common.d.ts +0 -4
- package/types/plugin/chart/media-query/interface/index.d.ts +1 -1
- package/types/series/base/base-series.d.ts +3 -1
- package/types/theme/builtin/common/component/axis/cartesian-axis.d.ts +1 -0
- package/types/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +1 -0
- package/types/typings/spec/common.d.ts +2 -0
- package/types/typings/spec/index.d.ts +1 -0
- package/types/typings/spec/media-query.d.ts +28 -0
|
@@ -10,7 +10,7 @@ export declare function animationConfig<Preset extends string>(defaultConfig?: M
|
|
|
10
10
|
dataIndex: (datum: any) => number;
|
|
11
11
|
dataCount: () => number;
|
|
12
12
|
}): MarkAnimationSpec;
|
|
13
|
-
export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: ISeriesMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig |
|
|
13
|
+
export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: ISeriesMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
|
|
14
14
|
export declare function shouldMarkDoMorph(spec: ISeriesSpec & IAnimationSpec<string, string>, markName: string): boolean;
|
|
15
15
|
export declare function isTimeLineAnimation(animationConfig: IAnimationConfig): boolean;
|
|
16
16
|
export declare function isChannelAnimation(animationConfig: IAnimationConfig): boolean;
|
|
@@ -21,6 +21,7 @@ export interface IComponentTheme {
|
|
|
21
21
|
axisLinear?: IAxisCommonTheme;
|
|
22
22
|
axisX?: ICartesianAxisCommonTheme;
|
|
23
23
|
axisY?: ICartesianAxisCommonTheme;
|
|
24
|
+
axisZ?: ICartesianAxisCommonTheme;
|
|
24
25
|
axisRadius?: IPolarAxisCommonTheme;
|
|
25
26
|
axisAngle?: IPolarAxisCommonTheme;
|
|
26
27
|
[ComponentTypeEnum.discreteLegend]?: IDiscreteLegendTheme;
|
|
@@ -12,9 +12,8 @@ export type OffsetPoint = {
|
|
|
12
12
|
export type IAggrType = 'sum' | 'average' | 'min' | 'max' | 'variance' | 'standardDeviation' | 'median';
|
|
13
13
|
export type IDataPos = StringOrNumber | IAggrType;
|
|
14
14
|
export type IDataPosCallback = (relativeSeriesData: Datum[], startRelativeSeriesData: Datum[], endRelativeSeriesData: Datum[], relativeSeries: ICartesianSeries, startRelativeSeries: ICartesianSeries, endRelativeSeries: ICartesianSeries) => StringOrNumber;
|
|
15
|
-
export type IDataPointCallback = (relativeSeriesData: Datum[], relativeSeries: ICartesianSeries) => StringOrNumber;
|
|
16
15
|
export type IDataPointSpec = {
|
|
17
|
-
[key: string]: IDataPos |
|
|
16
|
+
[key: string]: IDataPos | IDataPosCallback;
|
|
18
17
|
refRelativeSeriesIndex?: number;
|
|
19
18
|
refRelativeSeriesId?: StringOrNumber;
|
|
20
19
|
xFieldIndex?: number;
|
|
@@ -27,8 +26,8 @@ export type MarkerPositionPoint = {
|
|
|
27
26
|
y: StringOrNumber;
|
|
28
27
|
};
|
|
29
28
|
export type ICoordinateOption = {
|
|
30
|
-
x?: IOptionAggrField | (
|
|
31
|
-
y?: IOptionAggrField | (
|
|
29
|
+
x?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
|
|
30
|
+
y?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
|
|
32
31
|
getRefRelativeSeries?: () => ICartesianSeries;
|
|
33
32
|
} & IOptionSeries;
|
|
34
33
|
export type IMarkerPositionsSpec = {
|
|
@@ -14,6 +14,7 @@ export declare class Trigger implements ITrigger {
|
|
|
14
14
|
protected _fields: string[] | null;
|
|
15
15
|
protected _marks: MarkSet;
|
|
16
16
|
protected _markReverse: MarkSet;
|
|
17
|
+
private _isHovered?;
|
|
17
18
|
constructor(spec: ITriggerSpec, option: ITriggerOption);
|
|
18
19
|
setStateKeys(fields: string[]): void;
|
|
19
20
|
registerMark(mark: IMark): void;
|
|
@@ -3,10 +3,6 @@ import type { IVChart } from '../../../../core';
|
|
|
3
3
|
import type { IModelSpecInfo } from '../../../../model/interface';
|
|
4
4
|
import type { SeriesTypeEnum } from '../../../../series';
|
|
5
5
|
import type { IChartSpec } from '../../../../typings';
|
|
6
|
-
export interface IMediaInfo {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
10
6
|
export interface IMediaQueryActionFilterResult<T extends Record<string, unknown> = any> {
|
|
11
7
|
isChart?: boolean;
|
|
12
8
|
modelType?: 'series' | 'region' | 'component';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../../../../typings/spec/media-query';
|
|
2
2
|
export * from './common';
|
|
@@ -123,7 +123,9 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
123
123
|
setValueFieldToStackOffsetSilhouette(): void;
|
|
124
124
|
abstract getActiveMarks(): IMark[];
|
|
125
125
|
initRootMark(): void;
|
|
126
|
-
protected _initExtensionMark(
|
|
126
|
+
protected _initExtensionMark(options: {
|
|
127
|
+
hasAnimation: boolean;
|
|
128
|
+
}): void;
|
|
127
129
|
private _createExtensionMark;
|
|
128
130
|
protected _updateExtensionMarkSpec(lastSpec?: any): void;
|
|
129
131
|
getStackData(): ISeriesStackData;
|
|
@@ -25,6 +25,7 @@ import type { ILegendSpec } from '../../component/legend';
|
|
|
25
25
|
import type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';
|
|
26
26
|
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
27
27
|
import type { ICommonAxisSpec } from '../../component/axis';
|
|
28
|
+
import type { IMediaQuerySpec } from '..';
|
|
28
29
|
export type IChartPadding = ILayoutOrientPadding | number;
|
|
29
30
|
export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
30
31
|
dom?: string | HTMLElement;
|
|
@@ -80,6 +81,7 @@ export interface IChartSpec {
|
|
|
80
81
|
theme?: Omit<ITheme, 'name'> | string;
|
|
81
82
|
background?: IBackgroundSpec;
|
|
82
83
|
stackInverse?: boolean;
|
|
84
|
+
media?: IMediaQuerySpec;
|
|
83
85
|
}
|
|
84
86
|
export type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {
|
|
85
87
|
image?: IRectMarkSpec['background'];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentTypeEnum } from '../../component/interface';
|
|
2
|
+
import type { IChartSpec, IVChart } from '../../core';
|
|
3
|
+
import type { IModelSpecInfo } from '../../model/interface';
|
|
4
|
+
import type { SeriesTypeEnum } from '../../series';
|
|
5
|
+
export interface IMediaInfo {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export type IMediaQuerySpec = IMediaQueryItem[];
|
|
10
|
+
export interface IMediaQueryItem {
|
|
11
|
+
query: IMediaQueryCondition;
|
|
12
|
+
action: IMediaQueryAction | IMediaQueryAction[];
|
|
13
|
+
}
|
|
14
|
+
export interface IMediaQueryCondition {
|
|
15
|
+
minWidth?: number;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
minHeight?: number;
|
|
18
|
+
maxHeight?: number;
|
|
19
|
+
onResize?: (info: IMediaInfo, vchart: IVChart) => boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface IMediaQueryAction<T extends Record<string, unknown> = any> {
|
|
22
|
+
spec: Partial<T> | ((filteredModelInfo: IModelSpecInfo<T>[], action: IMediaQueryAction<T>, query: IMediaQueryCondition) => Partial<T>);
|
|
23
|
+
filterType?: MediaQueryActionFilterType;
|
|
24
|
+
filter?: MediaQueryActionFilter<T> | Array<MediaQueryActionFilter<T>>;
|
|
25
|
+
forceAppend?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export type MediaQueryActionFilterType = 'region' | 'series' | 'chart' | `${SeriesTypeEnum}` | `${ComponentTypeEnum}` | keyof IChartSpec;
|
|
28
|
+
export type MediaQueryActionFilter<T extends Record<string, unknown> = any> = Partial<T> | ((modelInfo: IModelSpecInfo<T>, action: IMediaQueryAction<T>, query: IMediaQueryCondition) => boolean);
|