@visactor/vchart-types 1.12.9 → 1.12.10-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.
@@ -12,8 +12,22 @@ export type IOptimizeType = {
12
12
  skipRenderWithOutRange?: boolean;
13
13
  disableCheckGraphicWidthOutRange?: boolean;
14
14
  };
15
+ export interface GestureConfig {
16
+ press?: {
17
+ time?: number;
18
+ threshold?: number;
19
+ };
20
+ swipe?: {
21
+ threshold?: number;
22
+ velocity?: number;
23
+ };
24
+ tap?: {
25
+ interval?: number;
26
+ };
27
+ }
15
28
  export interface IRenderOption {
16
29
  mode?: RenderMode;
30
+ gestureConfig?: GestureConfig;
17
31
  modeParams?: {
18
32
  tooltipCanvasId?: StringOrNumber;
19
33
  [key: string]: any;
@@ -1,32 +1,22 @@
1
- import type { IElement, IGroupMark, IMark, MarkAnimationSpec, MarkFunctionCallback, Nil, TransformSpec } from '@visactor/vgrammar-core';
1
+ import type { IElement, IGroupMark, IMark, IMarkConfig, MarkAnimationSpec, MarkFunctionCallback, Nil, TransformSpec } from '@visactor/vgrammar-core';
2
2
  import type { DataView } from '@visactor/vdataset';
3
3
  import { GrammarItem } from '../grammar-item';
4
4
  import type { Maybe, Datum, StringOrNumber } from '../../typings';
5
- import type { IMarkProgressiveConfig, IMarkStateStyle, MarkType } from '../../mark/interface';
5
+ import type { IMarkStateStyle, MarkType } from '../../mark/interface';
6
6
  import type { IModel } from '../../model/interface';
7
7
  import { MarkStateManager } from './mark-state-manager';
8
- import type { ICompilableMark, IMarkDataInitOption, ICompilableMarkOption, StateValueType, IMarkCompileOption, IAttributeOpt, MarkClip } from './interface';
8
+ import type { ICompilableMark, IMarkDataInitOption, ICompilableMarkOption, StateValueType, IMarkCompileOption, IAttributeOpt } from './interface';
9
9
  import { MarkData } from './mark-data';
10
10
  import { GrammarType } from '../interface/compilable-item';
11
11
  import type { IEvent } from '../../event/interface';
12
- import type { ICustomPath2D } from '@visactor/vrender-core';
13
12
  export declare abstract class CompilableMark extends GrammarItem implements ICompilableMark {
14
13
  readonly grammarType = GrammarType.mark;
15
14
  readonly type: MarkType;
16
15
  readonly name: string;
17
16
  readonly key: ICompilableMark['key'];
18
- protected _skipTheme?: boolean;
19
- getSkipTheme(): boolean;
20
- setSkipTheme(skipTheme: boolean): void;
21
- protected _support3d?: boolean;
22
- getSupport3d(): boolean;
23
- setSupport3d(support3d: boolean): void;
24
- protected _interactive: boolean;
25
- getInteractive(): boolean;
26
- setInteractive(interactive: boolean): void;
27
- protected _zIndex: number;
28
- getZIndex(): number;
29
- setZIndex(zIndex: number): void;
17
+ protected _markConfig: IMarkConfig;
18
+ getMarkConfig(): IMarkConfig;
19
+ setMarkConfig(config: IMarkConfig): void;
30
20
  protected _visible: boolean;
31
21
  getVisible(): boolean;
32
22
  setVisible(visible: boolean): void;
@@ -53,28 +43,9 @@ export declare abstract class CompilableMark extends GrammarItem implements ICom
53
43
  private _skipBeforeLayouted;
54
44
  setSkipBeforeLayouted(skip: boolean): void;
55
45
  getSkipBeforeLayouted(): boolean;
56
- protected _morph: boolean;
57
- getMorph(): boolean;
58
- setMorph(morph: boolean): void;
59
- protected _morphKey?: string;
60
- getMorphKey(): string;
61
- setMorphKey(morphKey: string): void;
62
- protected _morphElementKey?: string;
63
- getMorphElementKey(): string;
64
- setMorphElementKey(key: string): void;
65
46
  protected _groupKey?: string;
66
47
  getGroupKey(): string;
67
48
  setGroupKey(groupKey: string): void;
68
- protected _progressiveConfig: IMarkProgressiveConfig;
69
- getProgressiveConfig(): IMarkProgressiveConfig;
70
- setProgressiveConfig(config: IMarkProgressiveConfig): void;
71
- protected _setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
72
- setCustomizedShapeCallback(callback: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D): void;
73
- protected _enableSegments: boolean;
74
- setEnableSegments(enable: boolean): void;
75
- protected _clip: MarkClip;
76
- getClip(): MarkClip;
77
- setClip(clip: MarkClip): void;
78
49
  protected _stateSort?: (stateA: string, stateB: string) => number;
79
50
  setStateSortCallback(stateSort: (stateA: string, stateB: string) => number): void;
80
51
  protected _option: ICompilableMarkOption;
@@ -1,21 +1,18 @@
1
- import type { IMarkProgressiveConfig, IMarkStateStyle, MarkType } from '../../mark/interface';
1
+ import type { IMarkStateStyle, MarkType } from '../../mark/interface';
2
2
  import type { IModel } from '../../model/interface';
3
3
  import type { GrammarItemCompileOption, GrammarItemInitOption } from '../interface';
4
4
  import type { IGrammarItem } from '../interface';
5
5
  import type { MarkStateManager } from './mark-state-manager';
6
6
  import type { DataView } from '@visactor/vdataset';
7
- import type { IAnimate, IAnimateArranger, IElement, IGroupMark, IMark, MarkAnimationSpec, Nil, TransformSpec } from '@visactor/vgrammar-core';
7
+ import type { IAnimate, IAnimateArranger, IElement, IGroupMark, IMark, IMarkConfig, MarkAnimationSpec, Nil, TransformSpec } from '@visactor/vgrammar-core';
8
8
  import type { Maybe, Datum, StringOrNumber } from '../../typings';
9
9
  import type { MarkData } from './mark-data';
10
10
  import type { IRegion } from '../../region/interface';
11
- import type { ICustomPath2D, IGraphic } from '@visactor/vrender-core';
12
11
  export interface ICompilableMarkOption extends GrammarItemInitOption {
13
12
  key?: string | ((datum: Datum) => string);
14
13
  groupKey?: string;
15
14
  skipBeforeLayouted?: boolean;
16
- support3d?: boolean;
17
15
  mode?: '2d' | '3d';
18
- skipTheme?: boolean;
19
16
  noSeparateStyle?: boolean;
20
17
  }
21
18
  export interface ICompilableMark extends IGrammarItem {
@@ -38,38 +35,23 @@ export interface ICompilableMark extends IGrammarItem {
38
35
  updateLayoutState: (noRender?: boolean, recursion?: boolean) => void;
39
36
  updateMarkState: (key: string) => void;
40
37
  setTransform: (transform: TransformSpec[] | Nil) => void;
41
- getInteractive: () => boolean;
42
- setInteractive: (interactive: boolean) => void;
43
38
  setAnimationConfig: (config: Partial<MarkAnimationSpec>) => void;
44
39
  getAnimationConfig: () => Partial<MarkAnimationSpec>;
45
- getZIndex: () => number;
46
- setZIndex: (zIndex: number) => void;
47
40
  getVisible: () => boolean;
48
41
  setVisible: (visible: boolean) => void;
49
- getMorph: () => boolean;
50
- setMorph: (morph: boolean) => void;
51
- getProgressiveConfig: () => IMarkProgressiveConfig;
52
- setProgressiveConfig: (config: IMarkProgressiveConfig) => void;
53
- getMorphKey: () => string | undefined;
54
- setMorphKey: (morphKey: string) => void;
55
- getMorphElementKey: () => string | undefined;
56
- setMorphElementKey: (morphKey: string) => void;
57
42
  getGroupKey: () => string | undefined;
58
43
  setGroupKey: (groupKey: string) => void;
59
44
  getUserId: () => StringOrNumber | undefined;
60
45
  setUserId: (id: StringOrNumber) => void;
61
- getSupport3d: () => boolean | undefined;
62
- setSupport3d: (support3d: boolean) => void;
63
- getClip: () => MarkClip | undefined;
64
- setClip: (clip: MarkClip) => void;
65
46
  compile: (option?: IMarkCompileOption) => void;
66
47
  getProduct: () => Maybe<IMark>;
67
48
  getProductElements: () => Maybe<IMark['elements']>;
68
49
  getMarks: () => ICompilableMark[];
69
50
  setSkipBeforeLayouted: (skip: boolean) => void;
70
51
  getSkipBeforeLayouted: () => boolean;
71
- setCustomizedShapeCallback: (callback: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D) => void;
72
52
  setStateSortCallback: (stateSort: (stateA: string, stateB: string) => number) => void;
53
+ getMarkConfig: () => IMarkConfig;
54
+ setMarkConfig: (config: IMarkConfig) => void;
73
55
  runAnimationByState: (animationState?: string) => IAnimateArranger;
74
56
  stopAnimationByState: (animationState?: string) => IAnimate;
75
57
  pauseAnimationByState: (animationState: string) => IAnimate;
@@ -149,4 +131,3 @@ export interface ISeriesMarkAttributeContext extends IModelMarkAttributeContext
149
131
  seriesColor: (seriesValue?: string | number) => string;
150
132
  getRegion: () => IRegion;
151
133
  }
152
- export type MarkClip = false | IGraphic[] | ((elements: IElement[]) => IGraphic[]);
@@ -56,6 +56,13 @@ export declare class GeoCoordinate extends BaseComponent<IGeoRegionSpec> impleme
56
56
  invert(point: [number, number]): any;
57
57
  private evaluateProjection;
58
58
  protected _initCenterCache(): void;
59
+ _compareSpec(spec: IGeoRegionSpec, prevSpec: IGeoRegionSpec): {
60
+ change: boolean;
61
+ reMake: boolean;
62
+ reRender: boolean;
63
+ reSize: boolean;
64
+ reCompile: boolean;
65
+ };
59
66
  release(): void;
60
67
  }
61
68
  export declare const registerGeoCoordinate: () => void;
@@ -12,7 +12,7 @@ export interface ITitleTextTheme {
12
12
  fontWeight?: StringOrNumber;
13
13
  textAlign?: TextAlign;
14
14
  textBaseline?: TextBaseLine;
15
- lineHeight?: number;
15
+ lineHeight?: number | ITokenKey;
16
16
  }
17
17
  export interface ITitleTheme extends ILayoutItemSpec {
18
18
  textStyle?: ITitleTextTheme;
@@ -1,3 +1,4 @@
1
+ import type { EventSourceType, EventType } from '../../../event/interface';
1
2
  import type { IGroupTooltipPattern, ITooltipActual, ITooltipPattern, Maybe, MaybeArray, TooltipActiveType, TooltipData } from '../../../typings';
2
3
  import type { ITooltipActiveTypeAsKeys, TooltipHandlerParams, TooltipResult } from './common';
3
4
  import type { ITooltipTheme } from './theme';
@@ -6,8 +7,17 @@ export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipP
6
7
  }, ITooltipPattern, IGroupTooltipPattern>> {
7
8
  visible?: boolean;
8
9
  activeType?: TooltipActiveType | TooltipActiveType[];
9
- trigger?: MaybeArray<'hover' | 'click'> | 'none';
10
- triggerOff?: MaybeArray<'hover' | 'click'> | 'none';
10
+ trigger?: MaybeArray<'hover' | 'click' | {
11
+ eventType: EventType;
12
+ source?: EventSourceType;
13
+ consume?: boolean;
14
+ }> | 'none';
15
+ triggerOff?: MaybeArray<'hover' | 'click' | {
16
+ eventType: EventType;
17
+ source?: EventSourceType;
18
+ consume?: boolean;
19
+ checkOutside?: boolean;
20
+ }> | 'none';
11
21
  showDelay?: number;
12
22
  hideTimer?: number;
13
23
  lockAfterClick?: boolean;
@@ -5,6 +5,8 @@ import type { IBaseScale } from '@visactor/vscale';
5
5
  import type { MarkType } from './type';
6
6
  import type { ICompilableMark, ICompilableMarkOption, IModelMarkAttributeContext, StateValueType } from '../../compile/mark';
7
7
  import type { StringOrNumber } from '../../typings';
8
+ import type { IMarkConfig } from '@visactor/vgrammar-core';
9
+ import type { ICustomPath2D } from '@visactor/vrender-core';
8
10
  export interface VisualScaleType {
9
11
  scale: IBaseScale;
10
12
  field: StringOrNumber;
@@ -42,6 +44,14 @@ export interface IMarkRaw<T extends ICommonSpec> extends ICompilableMark {
42
44
  setPostProcess: <U extends keyof T, A>(key: U, postProcessFunc: IAttrConfig<A, T>['postProcess'], state?: StateValueType) => void;
43
45
  }
44
46
  export type IMark = IMarkRaw<ICommonSpec>;
47
+ export interface ICompileMarkConfig extends IMarkConfig {
48
+ morph?: boolean;
49
+ morphElementKey?: string;
50
+ support3d?: boolean;
51
+ setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
52
+ clip?: boolean;
53
+ skipTheme?: boolean;
54
+ }
45
55
  export interface IMarkOption extends ICompilableMarkOption {
46
56
  model: IModel;
47
57
  map: Map<StringOrNumber, IModel | IMark>;
@@ -1,7 +1,7 @@
1
1
  import type { IEvent } from '../event/interface';
2
2
  import type { IEffect, IModel, IModelInitOption, IModelOption, IModelRenderOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo, IModelSpecInfo } from './interface';
3
3
  import type { CoordinateType } from '../typings/coordinate';
4
- import type { IMark, IMarkOption, IMarkRaw, IMarkStyle } from '../mark/interface';
4
+ import type { ICompileMarkConfig, IMark, IMarkOption, IMarkRaw, IMarkStyle } from '../mark/interface';
5
5
  import type { Datum, StateValueType, ConvertToMarkStyleSpec, ICommonSpec, StringOrNumber, IRect, ILayoutRect } from '../typings';
6
6
  import type { CompilableData } from '../compile/data/compilable-data';
7
7
  import type { IGroupMark } from '@visactor/vgrammar-core';
@@ -72,7 +72,7 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
72
72
  protected stateKeyToSignalName(key: string, opt?: string): string;
73
73
  compileData(): void;
74
74
  compileMarks(group?: string | IGroupMark): void;
75
- protected _createMark<T extends IMark>(markInfo: IModelMarkInfo, option?: Partial<IMarkOption>): T;
75
+ protected _createMark<T extends IMark>(markInfo: IModelMarkInfo, option?: Partial<IMarkOption>, config?: ICompileMarkConfig): T;
76
76
  protected _getDataIdKey(): string | ((datum: Datum) => string) | undefined;
77
77
  getColorScheme(): import("..").IThemeColorScheme;
78
78
  getSpecInfo(): IModelSpecInfo<any>;
@@ -1,6 +1,6 @@
1
1
  import type { IBaseScale } from '@visactor/vscale';
2
2
  import { CartesianSeries } from '../cartesian/cartesian';
3
- import type { IMark, IMarkProgressiveConfig } from '../../mark/interface';
3
+ import type { IMark } from '../../mark/interface';
4
4
  import { MarkTypeEnum } from '../../mark/interface/type';
5
5
  import type { Datum, DirectionType } from '../../typings';
6
6
  import type { IBarSeriesSpec } from './interface';
@@ -27,7 +27,7 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
27
27
  protected _barBackgroundMark: IRectMark;
28
28
  protected _barBackgroundViewData: SeriesData;
29
29
  initMark(): void;
30
- protected _initBarBackgroundMark(progressive?: IMarkProgressiveConfig): void;
30
+ protected _initBarBackgroundMark(): void;
31
31
  initMarkStyle(): void;
32
32
  initLabelMarkStyle(textMark: ITextMark): void;
33
33
  protected initTooltip(): void;
@@ -1,7 +1,7 @@
1
1
  import { DataView } from '@visactor/vdataset';
2
2
  import type { DataSet, ITransformOptions } from '@visactor/vdataset';
3
3
  import type { IRegion } from '../../region/interface';
4
- import type { IMark } from '../../mark/interface';
4
+ import type { ICompileMarkConfig, IMark } from '../../mark/interface';
5
5
  import type { CoordinateType, IInvalidType, IPoint, DataKeyType, Datum, Maybe, ISeriesSpec, IExtensionMarkSpec, IExtensionGroupMarkSpec, EnableMarkType, 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, ISeriesSpecInfo, ISeriesStackDataLeaf, ISeriesStackDataMeta, ISeriesSeriesInfo } from '../interface';
@@ -202,7 +202,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
202
202
  getMeasureField(): string[];
203
203
  protected onMarkPositionUpdate(): void;
204
204
  protected onMarkTreePositionUpdate(marks: IMark[]): void;
205
- protected _createMark<M extends IMark>(markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption): NonNullable<M>;
205
+ protected _createMark<M extends IMark>(markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption, config?: ICompileMarkConfig): NonNullable<M>;
206
206
  protected _getDataIdKey(): string | ((datum: Datum) => string);
207
207
  protected _getSeriesDataKey(datum: Datum): string;
208
208
  addViewDataFilter(option: ITransformOptions): void;
@@ -5,12 +5,10 @@ import type { IBaseModelSpecTransformerResult, IModelConstructor, IModelMarkInfo
5
5
  import type { IRegion } from '../../region/interface';
6
6
  import type { RenderMode } from '../../typings/spec/common';
7
7
  import type { ISeries } from './series';
8
- import type { IMarkOption, IMarkProgressiveConfig } from '../../mark/interface';
8
+ import type { IMarkOption } from '../../mark/interface';
9
9
  import type { ISeriesSpec, StringOrNumber } from '../../typings';
10
10
  import type { TransformedLabelSpec } from '../../component/label';
11
11
  import type { SeriesMarkNameEnum, SeriesTypeEnum } from './type';
12
- import type { ICustomPath2D } from '@visactor/vrender-core';
13
- import type { MarkClip } from '../../compile/mark';
14
12
  export interface ISeriesSeriesInfo {
15
13
  key: string;
16
14
  originalKey: any;
@@ -63,17 +61,11 @@ export interface ISeriesMarkInitOption extends Partial<IMarkOption> {
63
61
  depend?: IGrammarItem | IGrammarItem[];
64
62
  key?: string | ((datum: any) => string);
65
63
  groupKey?: string;
66
- morph?: boolean;
67
- defaultMorphElementKey?: string;
68
64
  dataView?: DataView | false;
69
65
  dataProductId?: string;
70
66
  seriesId?: number;
71
- progressive?: IMarkProgressiveConfig;
72
- support3d?: boolean;
73
- customShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
74
67
  stateSort?: (stateA: string, stateB: string) => number;
75
68
  componentType?: string;
76
- clip?: MarkClip;
77
69
  }
78
70
  export interface ISeriesMarkInfo extends IModelMarkInfo {
79
71
  name: SeriesMarkNameEnum | string;
@@ -1,6 +1,6 @@
1
1
  import type { ISeriesOption } from '../interface/common';
2
2
  import type { ISeries } from '../interface/series';
3
- import type { IMark, IMarkProgressiveConfig } from '../../mark/interface';
3
+ import type { ICompileMarkConfig, IMark, IMarkProgressiveConfig } from '../../mark/interface';
4
4
  import type { ILineMark } from '../../mark/line';
5
5
  import type { ISymbolMark } from '../../mark/symbol';
6
6
  import type { ITextMark } from '../../mark/text';
@@ -39,7 +39,7 @@ export interface LineLikeSeriesMixin extends ISeries {
39
39
  _fieldX?: string[];
40
40
  _fieldY?: string[];
41
41
  _fieldZ?: string[];
42
- _createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption) => IMark;
42
+ _createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption, config?: ICompileMarkConfig) => IMark;
43
43
  _getInvalidDefined: () => boolean;
44
44
  _getInvalidConnectType: () => IInvalidType;
45
45
  getLayoutRect: () => ILayoutRect;