@visactor/vchart-types 1.10.2-alpha.3 → 1.10.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.
@@ -4,15 +4,15 @@ import type { IStateAnimateSpec, IAnimationSpec } from './spec';
4
4
  import type { SeriesMarkNameEnum } from '../series/interface/type';
5
5
  import type { ISeries } from '../series';
6
6
  import type { ISeriesSpec } from '../typings';
7
- import type { ISeriesMarkAttributeContext } from '../compile/mark';
7
+ import type { IModelMarkAttributeContext } from '../compile/mark';
8
8
  export declare const AnimationStates: string[];
9
9
  export declare function animationConfig<Preset extends string>(defaultConfig?: MarkAnimationSpec, userConfig?: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, params?: {
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 | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
13
+ export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: IModelMarkAttributeContext): 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;
17
- export declare function uniformAnimationConfig<Preset extends string>(config: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, ctx: ISeriesMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
17
+ export declare function uniformAnimationConfig<Preset extends string>(config: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, ctx: IModelMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "exit" | "update" | "appear" | "enter" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<Preset>>>;
18
18
  export declare function isAnimationEnabledForSeries(series: ISeries): boolean;
@@ -5,6 +5,7 @@ import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
5
5
  import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec } from '../../typings';
6
6
  import type { Maybe } from '@visactor/vutils';
7
7
  import type { IGraphic } from '@visactor/vrender-core';
8
+ import type { IModelMarkAttributeContext } from '../../compile/mark/interface';
8
9
  export declare class CustomMark<T = any> extends BaseComponent<any> {
9
10
  static type: ComponentTypeEnum;
10
11
  type: ComponentTypeEnum;
@@ -16,6 +17,9 @@ export declare class CustomMark<T = any> extends BaseComponent<any> {
16
17
  protected _spec: (ICustomMarkSpec<Exclude<EnableMarkType, 'group'>> | ICustomMarkGroupSpec)[];
17
18
  static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
18
19
  created(): void;
20
+ protected _markAttributeContext: IModelMarkAttributeContext;
21
+ getMarkAttributeContext(): IModelMarkAttributeContext;
22
+ protected _buildMarkAttributeContext(): void;
19
23
  protected initMarks(): void;
20
24
  private _createExtensionMark;
21
25
  initEvent(): void;
@@ -19,10 +19,12 @@ export declare class EventDispatcher implements IEventDispatcher {
19
19
  private _filter;
20
20
  private _prepareParams;
21
21
  private _onDelegate;
22
+ private _onDelegateInteractionEvent;
22
23
  private _invoke;
23
24
  private _getQueryLevel;
24
25
  private _parseQuery;
25
26
  private getEventBubble;
26
27
  private getEventListeners;
27
28
  private _isValidEvent;
29
+ private _isInteractionEvent;
28
30
  }
@@ -81,6 +81,10 @@ export type ZoomEventParam = ExtendEventParam & {
81
81
  scale: number;
82
82
  scaleCenter: IPoint;
83
83
  };
84
+ export type InteractionEventParam = {
85
+ items?: IElement[];
86
+ datums?: Datum[];
87
+ } & Partial<BaseEventParams>;
84
88
  export type EventParamsDefinition = {
85
89
  pointerdown: BaseEventParams;
86
90
  pointerup: BaseEventParams;
@@ -134,6 +138,10 @@ export type EventParamsDefinition = {
134
138
  tooltipHide: TooltipEventParams;
135
139
  tooltipRelease: TooltipEventParams;
136
140
  afterLayout: LayoutEventParam;
141
+ 'element-select:start': InteractionEventParam;
142
+ 'element-select:reset': InteractionEventParam;
143
+ 'element-highlight:start': InteractionEventParam;
144
+ 'element-highlight:reset': InteractionEventParam;
137
145
  [key: string]: ExtendEventParam;
138
146
  };
139
147
  export interface IEventDispatcher {
@@ -35,26 +35,26 @@ export interface ITriggerOption {
35
35
  eventDispatcher: IEventDispatcher;
36
36
  model: IModel;
37
37
  }
38
+ export interface IBaseInteractionSpec {
39
+ markIds?: StringOrNumber[];
40
+ markNames?: StringOrNumber[];
41
+ }
38
42
  type Trigger = EventType | EventType[];
39
- export type IHoverSpec = {
43
+ export interface IHoverSpec extends IBaseInteractionSpec {
40
44
  enable?: boolean;
41
45
  trigger?: Trigger;
42
46
  triggerOff?: Trigger;
43
- };
44
- export type ISelectSpec = {
47
+ }
48
+ export interface ISelectSpec extends IBaseInteractionSpec {
45
49
  enable?: boolean;
46
50
  mode?: 'single' | 'multiple';
47
51
  trigger?: Trigger;
48
52
  triggerOff?: Trigger | number;
49
- };
53
+ }
50
54
  export interface ITriggerSpec {
51
55
  hover?: IHoverSpec | boolean;
52
56
  select?: ISelectSpec | boolean;
53
57
  }
54
- interface IBaseInteractionSpec {
55
- markIds?: StringOrNumber[];
56
- markNames?: StringOrNumber[];
57
- }
58
58
  export type IElementActiveSpec = IBaseInteractionSpec & Pick<ElementActiveSpec, 'type' | 'trigger' | 'triggerOff' | 'state'>;
59
59
  export type IElementSelectSpec = IBaseInteractionSpec & Pick<ElementSelectSpec, 'type' | 'trigger' | 'triggerOff' | 'state' | 'isMultiple' | 'reverseState'>;
60
60
  export type IElementHighlightSpec = IBaseInteractionSpec & Pick<ElementHighlightSpec, 'type' | 'blurState' | 'highlightState' | 'triggerOff' | 'trigger'>;
@@ -7,6 +7,7 @@ import { BaseModel } from '../../model/base-model';
7
7
  import type { ISeriesOption, ISeries, ISeriesMarkInitOption, ISeriesStackData, ISeriesTooltipHelper, SeriesMarkMap, ISeriesMarkInfo, ISeriesSpecInfo, ISeriesStackDataLeaf, ISeriesStackDataMeta } from '../interface';
8
8
  import type { IModelEvaluateOption, IModelRenderOption } from '../../model/interface';
9
9
  import type { AddVChartPropertyContext } from '../../data/transforms/add-property';
10
+ import type { IBaseInteractionSpec } from '../../interaction/interface';
10
11
  import type { StatisticOperations } from '../../data/transforms/dimension-statistics';
11
12
  import { SeriesData } from './series-data';
12
13
  import type { IGroupMark } from '../../mark/group';
@@ -125,8 +126,8 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
125
126
  private _createExtensionMark;
126
127
  protected _updateExtensionMarkSpec(lastSpec?: any): void;
127
128
  getStackData(): ISeriesStackData;
129
+ protected _parseSelectorOfInteraction(interactionSpec: IBaseInteractionSpec, marks: IMark[]): string[];
128
130
  protected _parseDefaultInteractionConfig(mainMarks?: IMark[]): ({
129
- vchartState: STATE_VALUE_ENUM;
130
131
  seriesId: number;
131
132
  regionId: number;
132
133
  selector: string[];
@@ -139,7 +140,6 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
139
140
  state?: undefined;
140
141
  isMultiple?: undefined;
141
142
  } | {
142
- vchartState: STATE_VALUE_ENUM;
143
143
  type: string;
144
144
  seriesId: number;
145
145
  regionId: number;