@visactor/vchart-types 2.1.3-alpha.5 → 2.1.4-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.
@@ -44,6 +44,8 @@ export declare class Compiler implements ICompiler {
44
44
  getCanvas(): HTMLCanvasElement | undefined;
45
45
  _gestureController?: Gesture;
46
46
  getStage(): IStage | undefined;
47
+ private _dedupeStagePlugin;
48
+ private _dedupePoptipPlugin;
47
49
  initView(): void;
48
50
  getLayoutState(): LayoutState;
49
51
  updateLayoutTag(): void;
@@ -57,6 +57,7 @@ export interface IRenderOption {
57
57
  disableDirtyBounds?: boolean;
58
58
  enableView3dTransform?: boolean;
59
59
  pluginList?: string[];
60
+ runtimePluginInstallers?: ((app?: IApp) => void)[];
60
61
  ticker?: ITicker;
61
62
  optimize?: IOptimizeType;
62
63
  enableHtmlAttribute?: boolean;
@@ -15,6 +15,14 @@ import type { ICartesianTickDataOpt } from '@visactor/vrender-components';
15
15
  import type { DataSet } from '@visactor/vdataset';
16
16
  import { AxisComponent } from '../base-axis';
17
17
  import type { IGraphic } from '@visactor/vrender-core';
18
+ type ContinuousBarBandwidthCache = {
19
+ scale: IBaseScale;
20
+ domainStart: number;
21
+ domainEnd: number;
22
+ rangeStart: number;
23
+ rangeEnd: number;
24
+ bandWidth: number;
25
+ };
18
26
  export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec = ICartesianAxisCommonSpec> extends AxisComponent<T> implements IAxis {
19
27
  static type: ComponentTypeEnum;
20
28
  type: ComponentTypeEnum;
@@ -28,6 +36,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
28
36
  layoutZIndex: number;
29
37
  layoutLevel: number;
30
38
  protected _dataSet: DataSet;
39
+ protected _continuousBarBandwidthCache?: ContinuousBarBandwidthCache;
31
40
  protected _orient: IOrientType;
32
41
  getOrient(): IOrientType;
33
42
  protected getDefaultInteractive(): boolean;
@@ -77,6 +86,8 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
77
86
  protected getSeriesStatisticsField(s: ICartesianSeries): string[];
78
87
  protected _tickTransformOption(): ICartesianTickDataOpt;
79
88
  protected axisHelper(): IAxisHelper;
89
+ protected _clearContinuousBarBandwidthCache: () => void;
90
+ protected _getContinuousBarBandwidth(depth?: number): number;
80
91
  afterCompile(): void;
81
92
  protected collectScale(): IBaseScale[];
82
93
  protected collectSeriesField(depth: number, series: ICartesianSeries): string | string[];
@@ -104,3 +115,4 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
104
115
  protected _getNeedClearVRenderComponents(): IGraphic[];
105
116
  private _getLabelOverflowLimit;
106
117
  }
118
+ export {};
@@ -31,7 +31,7 @@ export interface IAxisHelper {
31
31
  dataToPosition: (values: any[], cfg?: IAxisLocationCfg) => number;
32
32
  valueToPosition?: (value: any, cfg?: IAxisLocationCfg) => number;
33
33
  getScale?: (depth: number) => IBaseScale;
34
- getBandwidth?: (depth: number) => number;
34
+ getBandwidth?: (depth: number) => number | undefined;
35
35
  setExtendDomain?: (key: string, value: number | undefined) => void;
36
36
  getAxisType: () => string;
37
37
  getAxisId: () => number;
@@ -7,7 +7,7 @@ import type { IRegionConstructor } from '../region/interface';
7
7
  import type { ILayoutConstructor } from '../layout/interface';
8
8
  import type { IChartPluginConstructor } from '../plugin/chart/interface';
9
9
  import type { IComponentPluginConstructor } from '../plugin/components/interface';
10
- import type { IGraphic } from '@visactor/vrender-core';
10
+ import type { IApp, IGraphic } from '@visactor/vrender-core';
11
11
  import type { GrammarTransformOption, IStageEventPlugin, VRenderComponentOptions } from './interface';
12
12
  import type { MarkAnimationSpec } from '../animation/interface';
13
13
  import type { ITriggerConstructor } from '../interaction/interface/trigger';
@@ -64,6 +64,7 @@ export interface IFactoryRegistry {
64
64
  interactionTriggers: Record<string, ITriggerConstructor>;
65
65
  composedEventMap: Record<string, IComposedEventConstructor>;
66
66
  tooltipProcessors: Record<string, ITooltipProcessorConstructor>;
67
+ runtimePluginInstallers: Record<string, (app?: IApp) => void>;
67
68
  formatter?: (text: string | number | string[] | number[], datum: any, formatter: string | string[]) => any;
68
69
  }
69
70
  export declare const factoryRegistry: IFactoryRegistry;
@@ -8,7 +8,7 @@ import type { Transform, Parser } from '@visactor/vdataset';
8
8
  import type { ILayoutConstructor } from '../layout/interface';
9
9
  import type { IChartPluginConstructor } from '../plugin/chart/interface';
10
10
  import type { IComponentPluginConstructor } from '../plugin/components/interface';
11
- import type { IGraphic } from '@visactor/vrender-core';
11
+ import type { IApp, IGraphic } from '@visactor/vrender-core';
12
12
  import type { GrammarTransformOption, IStageEventPlugin, VRenderComponentOptions } from './interface';
13
13
  import type { MarkAnimationSpec } from '../animation/interface';
14
14
  import type { IBaseTriggerOptions, ITriggerConstructor } from '../interaction/interface/trigger';
@@ -98,4 +98,7 @@ export declare class Factory {
98
98
  private static _tooltipProcessors;
99
99
  static registerTooltipProcessor: (type: string, processor: ITooltipProcessorConstructor) => void;
100
100
  static createTooltipProcessor: (type: string, tooltip: ITooltip) => import("../component/tooltip/processor/interface").ITooltipProcessor<import("../component/tooltip/processor/interface").DimensionTooltipInfo> | import("../component/tooltip/processor/interface").ITooltipProcessor<import("../component/tooltip/processor/interface").MarkTooltipInfo<import("../index-harmony-simple").Datum>>;
101
+ private static _runtimePluginInstallers;
102
+ static registerRuntimePluginInstaller: (type: string, installer: (app?: IApp) => void) => void;
103
+ static getRuntimePluginInstaller: (type: string) => (app?: IApp) => void;
101
104
  }
@@ -9,6 +9,8 @@ export declare class Interaction implements IInteraction {
9
9
  addTrigger(trigger: ITrigger): void;
10
10
  setStatedGraphics(trigger: ITrigger, graphics: IMarkGraphic[]): void;
11
11
  getStatedGraphics(trigger: ITrigger): IMarkGraphic[];
12
+ private _getMarkById;
13
+ private _hasAnimationByGraphicState;
12
14
  updateStates(trigger: ITrigger, newStatedGraphics: IMarkGraphic[], prevStatedGraphics?: IMarkGraphic[], state?: string, reverseState?: string): IMarkGraphic[];
13
15
  protected toggleReverseStateOfGraphics(trigger: ITrigger, newStatedGraphics: IMarkGraphic[], prevStatedGraphics: IMarkGraphic[], reverseState: string): void;
14
16
  protected toggleStateOfGraphics(trigger: ITrigger, newStatedGraphics: IMarkGraphic[], prevStatedGraphics: IMarkGraphic[], state: string): void;
@@ -26,7 +26,7 @@ export declare abstract class GlyphMark<T extends ICommonSpec = ICommonSpec, Cfg
26
26
  private _getInheritedStyleAttrsMap;
27
27
  private _syncInheritedStyleAttrs;
28
28
  private _onGlyphAttributeUpdate;
29
- protected _setStateOfGraphic: (g: IMarkGraphic) => void;
29
+ protected _setStateOfGraphic: (g: IMarkGraphic, hasAnimation?: boolean) => void;
30
30
  protected _createGraphic(attrs?: IGlyphGraphicAttribute): IGraphic;
31
31
  protected _runProgressiveEncoder(graphics: IMarkGraphic[]): void;
32
32
  }
@@ -26,6 +26,10 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
26
26
  protected _barBackgroundMark: IRectMark;
27
27
  protected _barBackgroundViewData: ICompilableData;
28
28
  protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
29
+ getStatisticFields(): {
30
+ key: string;
31
+ operations: import("../../data/transforms/interface").StatisticOperations;
32
+ }[];
29
33
  initMark(): void;
30
34
  protected _initBarBackgroundMark(): void;
31
35
  initMarkStyle(): void;
@@ -1,4 +1,4 @@
1
- import type { Datum, IMarkSpec, IMarkTheme, ISeriesSpec, IOrientType, IPathMarkSpec, IPolygonMarkSpec, IRuleMarkSpec, ITextMarkSpec, IPercent, IComposedTextMarkSpec, IFormatMethod } from '../../typings';
1
+ import type { Datum, IMarkSpec, IMarkTheme, ISeriesSpec, IOrientType, IPathMarkSpec, IPolygonMarkSpec, IRuleMarkSpec, ISymbolMarkSpec, ITextMarkSpec, IPercent, IComposedTextMarkSpec, IFormatMethod } from '../../typings';
2
2
  import type { IAnimationSpec } from '../../animation/spec';
3
3
  import type { SeriesMarkNameEnum } from '../interface/type';
4
4
  import type { ILabelSpec } from '../../component/label/interface';
@@ -49,5 +49,10 @@ export interface IFunnelSeriesTheme {
49
49
  line?: Partial<IMarkTheme<IRuleMarkSpec>>;
50
50
  };
51
51
  [SeriesMarkNameEnum.transformLabel]?: Partial<IMarkTheme<ITextMarkSpec>>;
52
+ conversionArrow?: {
53
+ line?: Partial<IMarkTheme<IPolygonMarkSpec>>;
54
+ symbol?: Partial<IMarkTheme<ISymbolMarkSpec>>;
55
+ text?: Partial<IMarkTheme<ITextMarkSpec>>;
56
+ };
52
57
  }
53
58
  export {};
@@ -29,6 +29,9 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
29
29
  private _nodeList;
30
30
  private _needClear;
31
31
  get direction(): "horizontal" | "vertical";
32
+ private _hasStateAnimation;
33
+ private _hasLinkStateAnimation;
34
+ private _hasNodeStateAnimation;
32
35
  getCategoryField(): string;
33
36
  setCategoryField(f: string): string;
34
37
  protected _valueField: string;
@@ -31,7 +31,7 @@ export interface ITreemapSeriesSpec extends Omit<ISeriesSpec, 'data'>, IAnimatio
31
31
  padding?: TreemapOptions['labelPadding'];
32
32
  };
33
33
  }
34
- export interface ITreemapSeriesTheme extends ICartesianSeriesTheme {
34
+ export interface ITreemapSeriesTheme extends Omit<ICartesianSeriesTheme, 'label'> {
35
35
  gapWidth?: TreemapOptions['padding'];
36
36
  nodePadding?: TreemapOptions['padding'];
37
37
  [SeriesMarkNameEnum.leaf]?: Partial<IMarkTheme<IRectMarkSpec>>;
@@ -221,10 +221,11 @@ export interface IMarkStateTheme<T> extends Record<string, T> {
221
221
  selected?: T;
222
222
  selected_reverse?: T;
223
223
  }
224
+ type ConvertToThemeMarkStyleSpec<T> = T extends Record<string, any> ? Partial<ConvertToMarkStyleSpec<T>> : never;
224
225
  export type IMarkTheme<T> = {
225
226
  visible?: boolean;
226
- style?: T;
227
- state?: IMarkStateTheme<T>;
227
+ style?: ConvertToThemeMarkStyleSpec<T>;
228
+ state?: IMarkStateTheme<ConvertToThemeMarkStyleSpec<T>>;
228
229
  interactive?: boolean;
229
230
  };
230
231
  export interface IPerformanceHook {
@@ -310,3 +311,4 @@ export type IRichTextFormatMethod<T extends any[]> = (...args: T) => {
310
311
  text: IRichTextCharacter[];
311
312
  } | IRichTextCharacter[];
312
313
  export type IFormatMethod<T extends any[]> = (...args: T) => ReturnType<ITextFormatMethod<T>> | ReturnType<IRichTextFormatMethod<T>>;
314
+ export {};
@@ -1,6 +1,9 @@
1
- import type { ISeriesSpec } from '../../typings';
1
+ interface IFunctionTransformRegistry {
2
+ getFunction: (key: string) => unknown;
3
+ }
2
4
  export declare function specTransform(spec: unknown, special?: {
3
5
  [key: string]: (v: unknown) => unknown;
4
6
  }): unknown;
5
- export declare function functionTransform(spec: ISeriesSpec, VChart: any): any;
7
+ export declare function functionTransform(value: unknown, registry: IFunctionTransformRegistry): any;
6
8
  export declare function transformFunctionAttribute(att: unknown, ...args: unknown[]): any;
9
+ export {};