@visactor/vchart-types 2.0.0-alpha.4 → 2.0.1-alpha.0

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.
@@ -58,6 +58,7 @@ export interface CommonAnimationConfigItem {
58
58
  loop?: boolean | number;
59
59
  options?: GraphicFunctionValueType<any>;
60
60
  controlOptions?: IAnimationControlOptions;
61
+ selfOnly?: boolean;
61
62
  }
62
63
  export interface TypeAnimationConfig extends CommonAnimationConfigItem {
63
64
  type: string;
@@ -83,6 +83,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
83
83
  onLayoutStart(): void;
84
84
  onLayoutEnd(): void;
85
85
  onEvaluateEnd(option: IChartEvaluateOption): void;
86
+ onBeforeRender(): void;
86
87
  getLayoutElements(): ILayoutItem[];
87
88
  getRegionsInIndex: (index?: number[]) => IRegion[];
88
89
  getAllRegions: () => IRegion[];
@@ -55,6 +55,7 @@ export interface IChart extends ICompilable {
55
55
  onEvaluateEnd: (ctx: IChartEvaluateOption) => void;
56
56
  onResize: (width: number, height: number, reRender: boolean) => void;
57
57
  onLayout: () => void;
58
+ onBeforeRender: () => void;
58
59
  reInit: () => void;
59
60
  getAllSeries: () => ISeries[];
60
61
  getRegionsInIndex: (index?: number[]) => IRegion[];
@@ -41,7 +41,6 @@ export declare class Brush<T extends IBrushSpec = IBrushSpec> extends BaseCompon
41
41
  [elementKey: string]: IMarkGraphic;
42
42
  };
43
43
  private _cacheInteractiveRangeAttrs;
44
- private _needDisablePickable;
45
44
  private _releatedAxes;
46
45
  private _regionAxisMap;
47
46
  private _axisDataZoomMap;
@@ -84,6 +83,7 @@ export declare class Brush<T extends IBrushSpec = IBrushSpec> extends BaseCompon
84
83
  private _isBrushContainItem;
85
84
  protected _initItemMap(itemMap: Record<string, IMark[]>, elementMap: Record<string, IMarkGraphic>, stateName: string): void;
86
85
  protected _initMarkBrushState(componentIndex: number, stateName: string): void;
86
+ private _setRegionMarkPickable;
87
87
  private _stateClamp;
88
88
  private _setAxisAndDataZoom;
89
89
  protected _getNeedClearVRenderComponents(): IGraphic[];
@@ -33,6 +33,7 @@ export interface IBrushTheme {
33
33
  export interface IBrushSpec extends IBrushTheme, IBrushDataBindSpec {
34
34
  id?: string;
35
35
  visible?: boolean;
36
+ updateElementsState?: boolean;
36
37
  }
37
38
  export type IBrushType = 'x' | 'y' | 'rect' | 'polygon';
38
39
  export type IBrushMode = 'single' | 'multiple';
@@ -51,7 +51,7 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
51
51
  protected _initEvent(): void;
52
52
  private _registerEvent;
53
53
  private _eventOff;
54
- updateLayoutAttribute(): void;
54
+ onBeforeRender(): void;
55
55
  protected calculateTriggerPoint(params: any): {
56
56
  x: number;
57
57
  y: number;
@@ -2,7 +2,7 @@ import type { Dict } from '@visactor/vutils';
2
2
  import type { IPadding, StringOrNumber } from '../../../typings';
3
3
  import type { IAxis } from '../../axis/interface';
4
4
  import type { LineCrosshair, RectCrosshair, Tag } from '@visactor/vrender-components';
5
- import type { IGroup, IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
5
+ import type { IGroup, IRichTextGraphicAttribute, IText, ITextGraphicAttribute } from '@visactor/vrender-core';
6
6
  export type AxisCurrentValueMap = Map<number, {
7
7
  datum: StringOrNumber;
8
8
  axis: IAxis;
@@ -31,6 +31,7 @@ export interface IHair {
31
31
  padding?: IPadding | number | number[];
32
32
  panel?: Dict<any>;
33
33
  zIndex?: number;
34
+ syncAxisLabelAngle?: boolean;
34
35
  };
35
36
  smooth?: boolean;
36
37
  }
@@ -56,6 +57,7 @@ export interface ICrosshairInfo {
56
57
  visible: boolean;
57
58
  _isCache?: boolean;
58
59
  axis: IAxis;
60
+ axisLabel?: IText;
59
61
  sides?: number;
60
62
  }
61
63
  export interface CrossHairStateItem {
@@ -65,6 +65,7 @@ export interface ICrosshairLabelSpec {
65
65
  formatter?: string | string[];
66
66
  style?: Partial<ITextMarkSpec>;
67
67
  labelBackground?: ICrosshairLabelBackgroundSpec;
68
+ syncAxisLabelAngle?: boolean;
68
69
  }
69
70
  export interface ICrosshairLabelBackgroundSpec {
70
71
  visible?: boolean;
@@ -6,4 +6,6 @@ export interface ICrosshairTheme extends ICommonCrosshairSpec {
6
6
  yField?: Partial<ICartesianCrosshairSpec['yField']>;
7
7
  categoryField?: Partial<IPolarCrosshairSpec['categoryField']>;
8
8
  valueField?: Partial<IPolarCrosshairSpec['valueField']>;
9
+ trigger?: ICommonCrosshairSpec['trigger'];
10
+ triggerOff?: ICommonCrosshairSpec['triggerOff'];
9
11
  }
@@ -2,6 +2,7 @@ import type { ITextAttribute } from '@visactor/vrender-core';
2
2
  import type { ILayoutNumber, ITooltipShapePattern, StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
3
3
  import type { Padding } from '@visactor/vrender-components';
4
4
  import type { ITokenKey } from '../../../theme/token/interface';
5
+ import type { ITooltipSpec } from './spec';
5
6
  export interface ITooltipTextTheme<ColorType = string> {
6
7
  fontFamily?: string;
7
8
  fontSize?: number | ITokenKey;
@@ -49,4 +50,6 @@ export interface ITooltipTheme<ColorType = string> {
49
50
  };
50
51
  transitionDuration?: number;
51
52
  align?: 'left' | 'right';
53
+ trigger?: ITooltipSpec['trigger'];
54
+ triggerOff?: ITooltipSpec['triggerOff'];
52
55
  }
@@ -138,6 +138,7 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
138
138
  protected createAnimationStateList(type: string, animationConfig: Partial<MarkAnimationSpec>): any;
139
139
  protected tryRunMorphing(graphics: IMarkGraphic[]): boolean;
140
140
  protected _runStateAnimation(graphics: IMarkGraphic[]): void;
141
+ protected _setAnimationState(g: IMarkGraphic): void;
141
142
  protected _runJoin(data: Datum[]): void;
142
143
  _runEncoderOfGraphic(styles: Record<string, (datum: Datum) => any>, g: IMarkGraphic, attrs?: any): any;
143
144
  _runGroupEncoder(groupStyles: Record<string, (datum: Datum) => any>): any;
@@ -179,8 +180,9 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
179
180
  protected _runProgressiveApplyGraphic(graphics: IMarkGraphic[]): void;
180
181
  protected _runProgressiveStep(): void;
181
182
  renderProgressive(): void;
183
+ protected _aniamtionStateCallback: (g: IMarkGraphic) => AnimationStateValues;
182
184
  updateAnimationState(callback: (graphic: IMarkGraphic) => AnimationStateValues): void;
183
- hasAnimationByState(state: keyof MarkAnimationSpec): boolean;
185
+ hasAnimationByState(state: AnimationStateValues): boolean;
184
186
  hasAnimation(): boolean;
185
187
  runAnimation(): void;
186
188
  }
@@ -1,7 +1,7 @@
1
1
  import type { Maybe } from '../typings';
2
2
  import type { IGroupMarkSpec } from '../typings/visual';
3
3
  import { BaseMark } from './base/base-mark';
4
- import type { AnimationStateValues, IGroupMark, IMark, IMarkGraphic, MarkType } from './interface';
4
+ import { type AnimationStateValues, type IGroupMark, type IMark, type IMarkGraphic, type MarkType } from './interface';
5
5
  import { MarkTypeEnum } from './interface/type';
6
6
  import { type IMarkCompileOption } from '../compile/mark';
7
7
  import type { IGroup, IGroupGraphicAttribute } from '@visactor/vrender-core';
@@ -35,7 +35,7 @@ export type IMarkStyle<T extends ICommonSpec> = {
35
35
  [key in keyof T]: MarkInputStyle<T[key]>;
36
36
  };
37
37
  export type DiffStateValues = 'update' | 'enter' | 'exit';
38
- export type AnimationStateValues = 'appear' | 'enter' | 'update' | 'exit' | 'disappear';
38
+ export type AnimationStateValues = 'appear' | 'enter' | 'update' | 'exit' | 'disappear' | 'none' | 'state';
39
39
  export interface IGraphicContext {
40
40
  markType: MarkTypeEnum;
41
41
  markId: number;
@@ -45,6 +45,7 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
45
45
  onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect): void;
46
46
  onLayoutEnd(): void;
47
47
  onEvaluateEnd(ctx: IModelEvaluateOption): void;
48
+ onBeforeRender(): void;
48
49
  onDataUpdate(): void;
49
50
  beforeRelease(): void;
50
51
  clear(): void;
@@ -76,6 +76,7 @@ export interface IModel extends ICompilable {
76
76
  beforeRelease: () => void;
77
77
  onEvaluateEnd: (ctx: IModelEvaluateOption) => void;
78
78
  onDataUpdate: () => void;
79
+ onBeforeRender: () => void;
79
80
  updateSpec: (spec: any, totalSpec?: any) => IUpdateSpecResult;
80
81
  getSpec?: () => any;
81
82
  getSpecIndex: () => number;
@@ -38,10 +38,13 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
38
38
  protected _dataToPosX1(datum: Datum): number;
39
39
  protected _dataToPosY(datum: Datum): number;
40
40
  protected _dataToPosY1(datum: Datum): number;
41
+ protected _getLinearBarRange: (start: number, end: number) => number[];
41
42
  protected _getBarXStart: (datum: Datum, scale: IBaseScale, useWholeRange?: boolean) => any;
42
43
  protected _getBarXEnd: (datum: Datum, scale: IBaseScale, useWholeRange?: boolean) => any;
44
+ protected _getLinearBarXRange: (datum: Datum, scale: IBaseScale, useWholeRange?: boolean) => number[];
43
45
  protected _getBarYStart: (datum: Datum, scale: IBaseScale) => any;
44
46
  protected _getBarYEnd: (datum: Datum, scale: IBaseScale) => any;
47
+ protected _getLinearBarYRange: (datum: Datum, scale: IBaseScale, useWholeRange?: boolean) => number[];
45
48
  initBandRectMarkStyle(): void;
46
49
  protected _initStackBarMarkStyle(): void;
47
50
  initLinearRectMarkStyle(): void;
@@ -33,6 +33,7 @@ export interface IBarSeriesSpec extends ICartesianSeriesSpec, IAnimationSpec<Bar
33
33
  barGapInGroup?: number | string | (number | string)[];
34
34
  barMinHeight?: number;
35
35
  stackCornerRadius?: number | number[] | IStackCornerRadiusCallback;
36
+ barGap?: number;
36
37
  }
37
38
  export interface IBarBackgroundSpec {
38
39
  fieldLevel?: number;
@@ -3,3 +3,4 @@ import type { IMarkGraphic } from '../mark/interface/common';
3
3
  export declare const isCollectionMark: (type: string) => boolean;
4
4
  export declare const getDatumOfGraphic: (g: IMarkGraphic) => import("..").Datum;
5
5
  export declare const findMarkGraphic: (rootGroup: IGraphic, target: IGraphic) => IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
6
+ export declare const getDiffAttributesOfGraphic: (g: IMarkGraphic, newAttrs: any) => Record<string, any>;