@visactor/vchart-types 2.1.0-alpha.0 → 2.1.0-alpha.10

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.
Files changed (68) hide show
  1. package/package.json +3 -3
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/chart/base/base-chart-transformer.d.ts +3 -0
  4. package/types/chart/base/base-chart.d.ts +25 -9
  5. package/types/chart/interface/chart.d.ts +1 -0
  6. package/types/chart/util.d.ts +4 -1
  7. package/types/compile/data/compilable-data.d.ts +1 -1
  8. package/types/compile/grammar-item.d.ts +1 -1
  9. package/types/compile/interface/compilable-item.d.ts +1 -1
  10. package/types/component/axis/base-axis.d.ts +2 -7
  11. package/types/component/axis/cartesian/band-axis.d.ts +1 -7
  12. package/types/component/axis/polar/band-axis.d.ts +2 -0
  13. package/types/component/base/base-component.d.ts +7 -7
  14. package/types/component/base/release-vrender-component.d.ts +10 -0
  15. package/types/component/brush/brush.d.ts +3 -7
  16. package/types/component/crosshair/base.d.ts +4 -7
  17. package/types/component/custom-mark/custom-mark.d.ts +4 -7
  18. package/types/component/data-zoom/data-filter-base-component.d.ts +3 -7
  19. package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -0
  20. package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +1 -0
  21. package/types/component/geo/geo-coordinate.d.ts +1 -7
  22. package/types/component/indicator/indicator.d.ts +1 -0
  23. package/types/component/indicator/util.d.ts +4 -3
  24. package/types/component/label/base-label.d.ts +1 -7
  25. package/types/component/legend/base-legend.d.ts +2 -7
  26. package/types/component/marker/base-marker.d.ts +14 -7
  27. package/types/component/marker/utils.d.ts +4 -4
  28. package/types/component/player/player.d.ts +1 -0
  29. package/types/component/title/title.d.ts +1 -7
  30. package/types/component/tooltip/tooltip.d.ts +1 -0
  31. package/types/core/vchart.d.ts +5 -1
  32. package/types/data/data-view-utils.d.ts +5 -0
  33. package/types/data/transforms/box-plot.d.ts +4 -1
  34. package/types/data/transforms/correlation-center.d.ts +10 -4
  35. package/types/data/transforms/correlation.d.ts +18 -15
  36. package/types/data/transforms/funnel.d.ts +10 -8
  37. package/types/data/transforms/lookup.d.ts +3 -3
  38. package/types/data/transforms/map.d.ts +8 -2
  39. package/types/data/transforms/sankey.d.ts +12 -4
  40. package/types/data/transforms/stack-split.d.ts +2 -1
  41. package/types/data/transforms/treemap.d.ts +5 -3
  42. package/types/data/transforms/venn.d.ts +4 -2
  43. package/types/data/transforms/waterfall.d.ts +4 -2
  44. package/types/event/event.d.ts +4 -0
  45. package/types/mark/base/base-mark.d.ts +12 -2
  46. package/types/mark/component.d.ts +9 -0
  47. package/types/mark/interface/mark.d.ts +2 -0
  48. package/types/model/base-model.d.ts +3 -15
  49. package/types/model/interface.d.ts +13 -0
  50. package/types/region/region.d.ts +1 -7
  51. package/types/scale/color-ordinal-scale.d.ts +1 -0
  52. package/types/series/area/area.d.ts +2 -0
  53. package/types/series/bar/bar.d.ts +3 -0
  54. package/types/series/base/base-series.d.ts +10 -7
  55. package/types/series/base/constant.d.ts +3 -0
  56. package/types/series/box-plot/box-plot.d.ts +2 -0
  57. package/types/series/dot/dot.d.ts +12 -0
  58. package/types/series/heatmap/heatmap.d.ts +2 -0
  59. package/types/series/line/line.d.ts +2 -0
  60. package/types/series/mixin/line-mixin.d.ts +1 -0
  61. package/types/series/pie/pie.d.ts +3 -7
  62. package/types/series/polar/progress-like/progress-like.d.ts +2 -0
  63. package/types/series/polar/rose-like/rose-like.d.ts +2 -0
  64. package/types/series/progress/circular/circular.d.ts +2 -0
  65. package/types/series/progress/linear/linear.d.ts +2 -0
  66. package/types/series/scatter/scatter.d.ts +2 -0
  67. package/types/series/waterfall/waterfall.d.ts +2 -0
  68. package/types/util/graphic-state.d.ts +1 -0
@@ -1,6 +1,7 @@
1
1
  import type { DataView } from '@visactor/vdataset';
2
+ type FunnelOptionValue<T> = T | (() => T);
2
3
  export interface IFunnelOpt {
3
- valueField: string;
4
+ valueField: FunnelOptionValue<string>;
4
5
  asTransformRatio: string;
5
6
  asReachRatio: string;
6
7
  asHeightRatio: string;
@@ -10,12 +11,12 @@ export interface IFunnelOpt {
10
11
  asCurrentValue: string;
11
12
  asLastValue: string;
12
13
  asNextValue: string;
13
- isCone?: boolean;
14
- heightVisual?: boolean;
15
- range?: {
16
- min: number;
17
- max: number;
18
- };
14
+ isCone?: FunnelOptionValue<boolean | undefined>;
15
+ heightVisual?: FunnelOptionValue<boolean | undefined>;
16
+ range?: FunnelOptionValue<{
17
+ min?: number;
18
+ max?: number;
19
+ } | undefined>;
19
20
  }
20
21
  export declare const funnel: (originData: Array<DataView>, op: IFunnelOpt) => {
21
22
  dataSet: import("@visactor/vdataset").DataSet;
@@ -43,4 +44,5 @@ export declare const funnel: (originData: Array<DataView>, op: IFunnelOpt) => {
43
44
  export interface IFunnelTransformOpt {
44
45
  asIsTransformLevel: string;
45
46
  }
46
- export declare const funnelTransform: (originData: Array<DataView>, op: IFunnelTransformOpt) => any;
47
+ export declare const funnelTransform: (originData: Array<DataView>, op: IFunnelTransformOpt) => Record<string, unknown>[];
48
+ export {};
@@ -3,10 +3,10 @@ import type { Datum } from '../../typings';
3
3
  export interface ILookUpOpt {
4
4
  from: () => object[];
5
5
  key: string;
6
- fields: string;
6
+ fields: string | (() => string);
7
7
  values?: string[];
8
8
  as?: string[];
9
- default?: any;
10
- set?: (A: Datum, B: Datum) => void;
9
+ default?: unknown;
10
+ set?: (A: Datum, B?: Datum) => void;
11
11
  }
12
12
  export declare const lookup: (data: Array<DataView>, opt: ILookUpOpt) => DataView[];
@@ -1,6 +1,12 @@
1
1
  import type { GeoSourceType } from '../../typings/geo';
2
2
  export interface IMapOpt {
3
- nameMap: Record<string, string>;
3
+ nameMap: Record<string, unknown>;
4
4
  nameProperty: string;
5
5
  }
6
- export declare const map: (data: GeoSourceType, opt: IMapOpt) => any;
6
+ type MapFeature = {
7
+ properties?: Record<string, unknown>;
8
+ [key: string]: unknown;
9
+ };
10
+ type MapOption = IMapOpt | (() => IMapOpt);
11
+ export declare const map: (data: GeoSourceType, opt: MapOption) => MapFeature[];
12
+ export {};
@@ -1,4 +1,4 @@
1
- import type { SankeyOptions, SankeyData } from '@visactor/vlayouts';
1
+ import { type SankeyOptions, type SankeyData } from '@visactor/vlayouts';
2
2
  export interface ISankeyOpt extends SankeyOptions {
3
3
  targetField: string;
4
4
  sourceField: string;
@@ -10,10 +10,18 @@ export interface ISankeyOpt extends SankeyOptions {
10
10
  y1: number;
11
11
  };
12
12
  }
13
- export declare const collectHierarchyField: (set: Set<any>, data: any[], field: string) => void;
14
- export declare const sankeyFormat: (data: any[]) => SankeyData[];
15
- export declare const sankeyLayout: (data: SankeyData[], op: ISankeyOpt) => {
13
+ type SankeyLayoutOption = ISankeyOpt | (() => ISankeyOpt);
14
+ type SankeyFormatDatum = Record<string, unknown> & {
15
+ id?: 'links' | 'nodes';
16
+ values?: unknown;
17
+ latestData?: SankeyData[];
18
+ children?: SankeyFormatDatum[];
19
+ };
20
+ export declare const collectHierarchyField: <T>(set: Set<T>, data: SankeyFormatDatum[], field: string) => void;
21
+ export declare const sankeyFormat: (data: SankeyFormatDatum[]) => SankeyData[];
22
+ export declare const sankeyLayout: (data: SankeyData[], op: SankeyLayoutOption) => {
16
23
  nodes: import("@visactor/vlayouts").SankeyNodeElement[];
17
24
  links: import("@visactor/vlayouts").SankeyLinkElement[];
18
25
  columns: import("@visactor/vlayouts").SankeyNodeElement[][];
19
26
  }[];
27
+ export {};
@@ -3,4 +3,5 @@ import type { DataView } from '@visactor/vdataset';
3
3
  export interface IStackOption {
4
4
  fields: string[];
5
5
  }
6
- export declare const stackSplit: (data: Array<DataView>, op: IStackOption) => ISeriesStackDataNode;
6
+ export type StackOption = IStackOption | (() => IStackOption);
7
+ export declare const stackSplit: (data: Array<DataView>, op: StackOption) => ISeriesStackDataNode;
@@ -1,5 +1,5 @@
1
- import type { TreemapNodeElement, TreemapOptions } from '@visactor/vlayouts';
2
- export declare const treemapLayout: (data: Array<any>, op: TreemapOptions & {
1
+ import { type TreemapNodeElement, type TreemapOptions } from '@visactor/vlayouts';
2
+ interface ITreemapLayoutOptions extends TreemapOptions {
3
3
  getViewBox: () => {
4
4
  x0: number;
5
5
  x1: number;
@@ -7,4 +7,6 @@ export declare const treemapLayout: (data: Array<any>, op: TreemapOptions & {
7
7
  y1: number;
8
8
  };
9
9
  nameField: string;
10
- }) => TreemapNodeElement[];
10
+ }
11
+ export declare const treemapLayout: (data: Array<Record<string, unknown>>, op: ITreemapLayoutOptions | (() => ITreemapLayoutOptions)) => TreemapNodeElement[];
12
+ export {};
@@ -1,4 +1,4 @@
1
- export declare const vennLayout: (data: Array<any>, op: {
1
+ interface IVennLayoutOptions {
2
2
  setField: string;
3
3
  valueField: string;
4
4
  getViewBox: () => {
@@ -7,4 +7,6 @@ export declare const vennLayout: (data: Array<any>, op: {
7
7
  y0: number;
8
8
  y1: number;
9
9
  };
10
- }) => (import("@visactor/vlayouts").IVennCircleDatum<any> | import("@visactor/vlayouts").IVennOverlapDatum<any>)[];
10
+ }
11
+ export declare const vennLayout: (data: Array<Record<string, unknown>>, op: IVennLayoutOptions | (() => IVennLayoutOptions)) => (import("@visactor/vlayouts").IVennCircleDatum<any> | import("@visactor/vlayouts").IVennOverlapDatum<any>)[];
12
+ export {};
@@ -17,7 +17,8 @@ export interface IWaterfallOpt {
17
17
  stackInverse: boolean;
18
18
  groupData: () => DataView;
19
19
  }
20
- export declare const waterfall: (lastData: Array<Datum>, op: IWaterfallOpt) => Datum[];
20
+ export type WaterfallOption = IWaterfallOpt | (() => IWaterfallOpt);
21
+ export declare const waterfall: (lastData: Array<Datum>, op: WaterfallOption) => Datum[];
21
22
  export interface IWaterfallFillEndOpt {
22
23
  indexField: string;
23
24
  valueField: string;
@@ -25,4 +26,5 @@ export interface IWaterfallFillEndOpt {
25
26
  total: IWaterfallSeriesSpec['total'];
26
27
  calculationMode: IWaterfallSeriesSpec['calculationMode'];
27
28
  }
28
- export declare const waterfallFillTotal: (data: Array<Datum>, op: IWaterfallFillEndOpt) => Datum[];
29
+ export type WaterfallFillEndOption = IWaterfallFillEndOpt | (() => IWaterfallFillEndOpt);
30
+ export declare const waterfallFillTotal: (data: Array<Datum>, op: WaterfallFillEndOption) => Datum[];
@@ -4,6 +4,7 @@ export declare class Event implements IEvent {
4
4
  private _eventDispatcher;
5
5
  private _mode;
6
6
  private _composedEventMap;
7
+ private _eventHandlerMap;
7
8
  getComposedEventMap(): Map<EventCallback<EventParams>, {
8
9
  eventType: string;
9
10
  event: IComposedEvent;
@@ -20,4 +21,7 @@ export declare class Event implements IEvent {
20
21
  }): this;
21
22
  allow<Evt extends EventType>(eType: Evt): this;
22
23
  release(): void;
24
+ private _addEventHandler;
25
+ private _getEventHandler;
26
+ private _removeEventHandler;
23
27
  }
@@ -5,7 +5,7 @@ import { MarkTypeEnum } from '../interface';
5
5
  import type { IMarkRaw, IMarkStateStyle, IMarkStyle, IMark, IMarkOption, StyleConvert, MarkInputStyle, GroupedData, IAttrs, IMarkGraphic, ProgressiveContext, IProgressiveTransformResult, MarkType, AnimationStateValues } from '../interface';
6
6
  import type { ICompilableMark, IMarkCompileOption, IMarkConfig, IMarkStateManager, StateValueType } from '../../compile/mark/interface';
7
7
  import type { ICompilableInitOption } from '../../compile/interface';
8
- import type { IGroupGraphicAttribute, IGroup, IGraphic } from '@visactor/vrender-core';
8
+ import type { IGroupGraphicAttribute, IGroup, IGraphic, StateDefinitionsInput } from '@visactor/vrender-core';
9
9
  import { GrammarItem } from '../../compile/grammar-item';
10
10
  import type { IModel } from '../../model/interface';
11
11
  import type { ICompilableData } from '../../compile/data/interface';
@@ -74,7 +74,7 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
74
74
  stopAnimationByState(state?: string): void;
75
75
  pauseAnimationByState(state?: string): void;
76
76
  resumeAnimationByState(state?: string): void;
77
- removeProduct(): void;
77
+ removeProduct(releaseDetach?: boolean): void;
78
78
  release(): void;
79
79
  protected _simpleStyle: T;
80
80
  setSimpleStyle(s: T): void;
@@ -82,6 +82,11 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
82
82
  protected _option: IMarkOption;
83
83
  protected _attributeContext: IModelMarkAttributeContext;
84
84
  protected _encoderOfState: Record<string, Record<string, (datum: Datum) => any>>;
85
+ protected _sharedStateDefinitionsCacheKey?: string;
86
+ protected _sharedStateDefinitionsCache?: StateDefinitionsInput<Record<string, unknown>>;
87
+ protected _sharedStateDefinitionRefIds: WeakMap<object, number>;
88
+ protected _sharedStateDefinitionRefId: number;
89
+ protected _dynamicSharedStateNames: Set<string>;
85
90
  _extensionChannel: {
86
91
  [key: string | number | symbol]: string[];
87
92
  };
@@ -155,9 +160,14 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
155
160
  protected _getEncoderOfStyle: (stateName: string, style: Partial<IAttrs<T>>) => Record<string, (datum: Datum) => any>;
156
161
  protected _setGraphicFromMarkConfig: (g: IMarkGraphic) => void;
157
162
  protected _setStateOfGraphic: (g: IMarkGraphic, hasAnimation?: boolean) => void;
163
+ protected _getSharedStateDefinitionRefId(value: unknown): string;
164
+ protected _getSharedStateDefinitionValueKey(value: unknown): string;
165
+ protected _isStaticSharedStateAttribute(stateName: string, key: string): boolean;
158
166
  protected _applySharedStateDefinitions(): void;
159
167
  protected _addProgressiveGraphic(parent: IGroup, g: IMarkGraphic): void;
160
168
  protected _runEncoder(graphics: IMarkGraphic[], noGroupEncode?: boolean): void;
169
+ protected _excludeStateControlledDiffAttrs(g: IMarkGraphic, diffAttrs: Record<string, any>): Record<string, any>;
170
+ protected _hasDiffAttrs(g: IMarkGraphic): boolean;
161
171
  protected _runApplyGraphic(graphics: IMarkGraphic[]): void;
162
172
  protected _updateEncoderByState(): void;
163
173
  protected _runState(graphics: IMarkGraphic[]): void;
@@ -8,11 +8,20 @@ export declare class ComponentMark extends BaseMark<ICommonSpec> implements ICom
8
8
  type: string;
9
9
  private _componentType;
10
10
  private _component;
11
+ private _exitingComponent?;
12
+ private _exitingProduct?;
11
13
  private _mode;
12
14
  constructor(name: string, option: IMarkOption);
13
15
  protected _getDefaultStyle(): IMarkStyle<ICommonSpec>;
14
16
  getComponent(): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
17
+ private _clearExitingComponent;
18
+ private _removeProductAfterExit;
19
+ private _registerExitingComponent;
20
+ private _unregisterExitingComponent;
21
+ private _releaseComponentWithExitAnimation;
15
22
  clearComponent(): void;
23
+ releaseWithExitAnimation(): boolean;
24
+ forceReleaseExitAnimation(): void;
16
25
  protected _getAttrsFromConfig(attrs?: IGroupGraphicAttribute): IGroupGraphicAttribute;
17
26
  protected _attributesTransform: (attrs: any) => any;
18
27
  setAttributeTransform(t: (attrs: any) => any): void;
@@ -6,6 +6,8 @@ import type { MarkType } from './type';
6
6
  export interface IComponentMark extends IMarkRaw<ICommonSpec> {
7
7
  getComponent: () => IGraphic;
8
8
  clearComponent: () => void;
9
+ releaseWithExitAnimation: () => boolean;
10
+ forceReleaseExitAnimation: () => void;
9
11
  setAttributeTransform: (t: (attrs: any) => any) => any;
10
12
  }
11
13
  export interface IGlyphMark<T extends ICommonSpec = ICommonSpec, C = any> extends IMarkRaw<T> {
@@ -1,5 +1,5 @@
1
1
  import type { IEvent } from '../event/interface';
2
- import type { IEffect, IModel, IModelInitOption, IModelOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo, IModelSpecInfo } from './interface';
2
+ import type { IEffect, IModel, IModelInitOption, IModelOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo, IModelSpecInfo, IUpdateSpecResult } from './interface';
3
3
  import type { CoordinateType } from '../typings/coordinate';
4
4
  import type { AnimationStateValues, ICompileMarkConfig, IMark, IMarkGraphic, IMarkOption, IMarkRaw, IMarkStyle } from '../mark/interface';
5
5
  import type { Datum, StateValueType, ConvertToMarkStyleSpec, ICommonSpec, StringOrNumber, IRect, ILayoutRect } from '../typings';
@@ -50,20 +50,8 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
50
50
  beforeRelease(): void;
51
51
  clear(): void;
52
52
  release(): void;
53
- updateSpec(spec: T): {
54
- change: boolean;
55
- reMake: boolean;
56
- reRender: boolean;
57
- reSize: boolean;
58
- reCompile: boolean;
59
- };
60
- protected _compareSpec(spec: T, prevSpec: T): {
61
- change: boolean;
62
- reMake: boolean;
63
- reRender: boolean;
64
- reSize: boolean;
65
- reCompile: boolean;
66
- };
53
+ updateSpec(spec: T): IUpdateSpecResult;
54
+ protected _compareSpec(spec: T, prevSpec: T): IUpdateSpecResult;
67
55
  reInit(spec?: T): void;
68
56
  updateLayoutAttribute(): void;
69
57
  setAttrFromSpec(): void;
@@ -33,6 +33,18 @@ export interface IModelRenderOption {
33
33
  export interface IEffect {
34
34
  [key: string]: (e?: any) => any;
35
35
  }
36
+ export interface IUpdateSpecEffects {
37
+ remake?: boolean;
38
+ compile?: boolean;
39
+ render?: boolean;
40
+ layout?: boolean;
41
+ data?: boolean;
42
+ scaleDomain?: boolean;
43
+ series?: boolean;
44
+ component?: boolean;
45
+ animation?: boolean;
46
+ localOnly?: boolean;
47
+ }
36
48
  export interface IMarkTreeGroup extends Partial<IMarkStyle<IGroupMarkSpec>> {
37
49
  type: 'group';
38
50
  name: string;
@@ -46,6 +58,7 @@ export interface IUpdateSpecResult {
46
58
  reSize?: boolean;
47
59
  reCompile?: boolean;
48
60
  reTransformSpec?: boolean;
61
+ effects?: IUpdateSpecEffects;
49
62
  reAnimate?: boolean;
50
63
  changeTheme?: boolean;
51
64
  changeBackground?: boolean;
@@ -39,13 +39,7 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutM
39
39
  initMark(): void;
40
40
  protected _initBackgroundMarkStyle(): void;
41
41
  protected _initForegroundMarkStyle(): void;
42
- _compareSpec(spec: T, prevSpec: T): {
43
- change: boolean;
44
- reMake: boolean;
45
- reRender: boolean;
46
- reSize: boolean;
47
- reCompile: boolean;
48
- };
42
+ _compareSpec(spec: T, prevSpec: T): import("../model/interface").IUpdateSpecResult;
49
43
  reInit(spec?: T): void;
50
44
  addSeries(s: ISeries): void;
51
45
  removeSeries(s: ISeries): void;
@@ -2,6 +2,7 @@ import { OrdinalScale } from '@visactor/vscale';
2
2
  import type { ColorSchemeItem, ProgressiveDataScheme } from '../theme/color-scheme/interface';
3
3
  export declare class ColorOrdinalScale extends OrdinalScale {
4
4
  protected _range: Array<ColorSchemeItem> | ProgressiveDataScheme<ColorSchemeItem>;
5
+ setSpecified(value?: Record<string, unknown>): this;
5
6
  range(value?: Array<ColorSchemeItem> | ProgressiveDataScheme<ColorSchemeItem>): this | any;
6
7
  domain(value?: any[]): this | any;
7
8
  protected _resetRange(): void;
@@ -7,6 +7,7 @@ import { SeriesTypeEnum } from '../interface/type';
7
7
  import type { IAreaSeriesSpec, IAreaSeriesTheme } from './interface';
8
8
  import type { IMark, IAreaMark } from '../../mark/interface';
9
9
  import { AreaSeriesSpecTransformer } from './area-transformer';
10
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
10
11
  export interface AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends Pick<LineLikeSeriesMixin, 'initLineMark' | 'initSymbolMark' | 'initLabelMarkStyle' | 'initLineMarkStyle' | 'initSymbolMarkStyle' | 'encodeDefined' | '_lineMark' | '_symbolMark' | 'addSamplingCompile' | 'addOverlapCompile' | 'reCompileSampling' | 'initLineLabelMarkStyle'>, CartesianSeries<T> {
11
12
  }
12
13
  export declare class AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends CartesianSeries<T> {
@@ -18,6 +19,7 @@ export declare class AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> ext
18
19
  readonly transformerConstructor: typeof AreaSeriesSpecTransformer;
19
20
  protected _areaMark: IAreaMark;
20
21
  protected _sortDataByAxis: boolean;
22
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
21
23
  initMark(): void;
22
24
  initMarkStyle(): void;
23
25
  initAreaMarkStyle(): void;
@@ -1,5 +1,6 @@
1
1
  import type { IBaseScale } from '@visactor/vscale';
2
2
  import { CartesianSeries } from '../cartesian/cartesian';
3
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
3
4
  import type { IMark, IRectMark, ITextMark } from '../../mark/interface';
4
5
  import type { Datum, DirectionType } from '../../typings';
5
6
  import type { IBarSeriesSpec, IBarSeriesTheme } from './interface';
@@ -24,9 +25,11 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
24
25
  protected _barMark: IRectMark;
25
26
  protected _barBackgroundMark: IRectMark;
26
27
  protected _barBackgroundViewData: ICompilableData;
28
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
27
29
  initMark(): void;
28
30
  protected _initBarBackgroundMark(): void;
29
31
  initMarkStyle(): void;
32
+ protected initRectMarkStyle(): void;
30
33
  initLabelMarkStyle(textMark: ITextMark): void;
31
34
  protected initTooltip(): void;
32
35
  protected _statisticViewData(): void;
@@ -16,6 +16,14 @@ import type { StatisticOperations } from '../../data/transforms/interface';
16
16
  import type { GraphicEventType } from '@visactor/vrender-core';
17
17
  import type { ICompilableData } from '../../compile/data';
18
18
  import type { IBaseTriggerOptions } from '../../interaction/interface/trigger';
19
+ export interface ISeriesSpecUpdatePolicy {
20
+ compileOnlyKeys?: Record<string, true>;
21
+ dataRelatedKeys?: Record<string, true>;
22
+ compileOnlySubKeys?: Record<string, Record<string, true>>;
23
+ seriesOnlyKeys?: Record<string, true>;
24
+ }
25
+ export declare function markSeriesCompileEffect(compareResult: IUpdateSpecResult, dataRelated?: boolean): void;
26
+ export declare function markSeriesOnlyEffect(compareResult: IUpdateSpecResult): void;
19
27
  export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> implements ISeries {
20
28
  readonly specKey: string;
21
29
  readonly type: string;
@@ -170,13 +178,8 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
170
178
  protected initTooltip(): void;
171
179
  _compareExtensionMarksSpec(newMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], prevMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], compareResult: IUpdateSpecResult): void;
172
180
  _compareLabelSpec(newLabels: ILabelSpec[], prevLabels: ILabelSpec[], compareResult: IUpdateSpecResult): void;
173
- _compareSpec(spec: T, prevSpec: T, ignoreCheckKeys?: Record<string, boolean>): {
174
- change: boolean;
175
- reMake: boolean;
176
- reRender: boolean;
177
- reSize: boolean;
178
- reCompile: boolean;
179
- };
181
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
182
+ _compareSpec(spec: T, prevSpec: T, ignoreCheckKeys?: Record<string, boolean>): IUpdateSpecResult;
180
183
  _updateSpecData(): void;
181
184
  reInit(spec?: T): void;
182
185
  onEvaluateEnd(ctx: IModelEvaluateOption): void;
@@ -10,3 +10,6 @@ export declare const defaultSeriesIgnoreCheckKeys: {
10
10
  export declare const defaultSeriesCompileCheckKeys: {
11
11
  [key: string]: true;
12
12
  };
13
+ export declare const defaultSeriesCompileOnlyCheckKeys: {
14
+ [key: string]: true;
15
+ };
@@ -8,6 +8,7 @@ import { DataView } from '@visactor/vdataset';
8
8
  import type { IMark, ITextMark } from '../../mark/interface';
9
9
  import type { ICompilableData } from '../../compile/data';
10
10
  import { BoxPlotSeriesSpecTransformer } from './box-plot-transformer';
11
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
11
12
  export declare const DEFAULT_FILL_COLOR = "#FFF";
12
13
  export declare const DEFAULT_STROKE_COLOR = "#000";
13
14
  export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> extends CartesianSeries<T> {
@@ -46,6 +47,7 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
46
47
  getOutliersStyle(): IOutlierMarkSpec;
47
48
  protected _outlierData: ICompilableData;
48
49
  private _autoBoxWidth;
50
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
49
51
  setAttrFromSpec(): void;
50
52
  private _boxPlotMark?;
51
53
  private _outlierMark?;
@@ -31,6 +31,18 @@ export declare class DotSeries<T extends IDotSeriesSpec = IDotSeriesSpec> extend
31
31
  setHighLightSeriesGroup(field: string): void;
32
32
  protected _gridBackground?: IFillMarkSpec;
33
33
  setGridBackground(gridBackground: IFillMarkSpec): void;
34
+ protected _getSpecUpdatePolicy(): {
35
+ compileOnlyKeys: {
36
+ highLightSeriesGroup: true;
37
+ titleField: true;
38
+ subTitleField: true;
39
+ };
40
+ compileOnlySubKeys: {
41
+ grid: Record<"background", true>;
42
+ };
43
+ dataRelatedKeys?: Record<string, true>;
44
+ seriesOnlyKeys?: Record<string, true>;
45
+ };
34
46
  initData(): void;
35
47
  getStatisticFields(): {
36
48
  key: string;
@@ -5,6 +5,7 @@ import type { SeriesMarkMap } from '../interface';
5
5
  import { SeriesTypeEnum } from '../interface/type';
6
6
  import type { ICellMark, IMark, ITextMark } from '../../mark/interface';
7
7
  import { HeatmapSeriesSpecTransformer } from './heatmap-transformer';
8
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
8
9
  export declare const DefaultBandWidth = 6;
9
10
  export declare class HeatmapSeries<T extends IHeatmapSeriesSpec = IHeatmapSeriesSpec> extends CartesianSeries<T> {
10
11
  static readonly type: string;
@@ -20,6 +21,7 @@ export declare class HeatmapSeries<T extends IHeatmapSeriesSpec = IHeatmapSeries
20
21
  protected _fieldValue: string[];
21
22
  getFieldValue(): string[];
22
23
  setFieldValue(f: string | string[]): void;
24
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
23
25
  setAttrFromSpec(): void;
24
26
  initMark(): void;
25
27
  initMarkStyle(): void;
@@ -6,6 +6,7 @@ import type { Datum } from '../../typings';
6
6
  import type { ILineSeriesSpec } from './interface';
7
7
  import type { IMark } from '../../mark/interface';
8
8
  import { LineLikeSeriesSpecTransformer } from '../mixin/line-mixin-transformer';
9
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
9
10
  export interface LineSeries<T extends ILineSeriesSpec = ILineSeriesSpec> extends Pick<LineLikeSeriesMixin, 'initLineMark' | 'initSymbolMark' | 'initLabelMarkStyle' | 'initLineMarkStyle' | 'initSymbolMarkStyle' | '_lineMark' | '_symbolMark' | 'addSamplingCompile' | 'addOverlapCompile' | 'reCompileSampling'>, CartesianSeries<T> {
10
11
  }
11
12
  export declare class LineSeries<T extends ILineSeriesSpec = ILineSeriesSpec> extends CartesianSeries<T> {
@@ -18,6 +19,7 @@ export declare class LineSeries<T extends ILineSeriesSpec = ILineSeriesSpec> ext
18
19
  static readonly transformerConstructor: typeof LineLikeSeriesSpecTransformer;
19
20
  readonly transformerConstructor: typeof LineLikeSeriesSpecTransformer;
20
21
  protected _sortDataByAxis: boolean;
22
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
21
23
  compile(): void;
22
24
  initMark(): void;
23
25
  protected initTooltip(): void;
@@ -7,6 +7,7 @@ import type { DimensionEventParams } from '../../event/events/dimension';
7
7
  import type { IRegion } from '../../region/interface';
8
8
  import type { ILineLikeSeriesTheme } from './interface';
9
9
  import type { ICompilableData } from '../../compile/data';
10
+ export declare const LINE_LIKE_SERIES_DATA_RELATED_KEYS: Record<string, true>;
10
11
  export interface LineLikeSeriesMixin extends ISeries {
11
12
  _spec: any;
12
13
  _option: ISeriesOption;
@@ -1,5 +1,6 @@
1
1
  import type { IPoint, Datum, StateValueType } from '../../typings';
2
2
  import { PolarSeries } from '../polar/polar';
3
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
3
4
  import type { IArcMark, IMark, IPathMark, ITextMark } from '../../mark/interface';
4
5
  import type { IArcSeries, SeriesMarkMap } from '../interface';
5
6
  import { SeriesTypeEnum } from '../interface/type';
@@ -56,15 +57,10 @@ export declare class BasePieSeries<T extends IBasePieSeriesSpec> extends PolarSe
56
57
  getInnerRadius(state?: StateValueType): number;
57
58
  computeRadius(r: number, k?: number): number;
58
59
  computeDatumRadius(datum: Datum, state?: string): number;
60
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
59
61
  _compareSpec(spec: T, prevSpec: T, ignoreCheckKeys?: {
60
62
  [key: string]: true;
61
- }): {
62
- change: boolean;
63
- reMake: boolean;
64
- reRender: boolean;
65
- reSize: boolean;
66
- reCompile: boolean;
67
- };
63
+ }): import("../..").IUpdateSpecResult;
68
64
  computeDatumInnerRadius(datum: Datum, state?: string): number;
69
65
  dataToPosition(datum: Datum, checkInViewData?: boolean): IPoint | null;
70
66
  dataToCentralPosition: (datum: Datum) => IPoint | null;
@@ -4,11 +4,13 @@ import { PolarSeries } from '../polar';
4
4
  import type { IContinuousTickData, IProgressLikeSeriesSpec } from './interface';
5
5
  import type { IPolarAxis } from '../../../component/axis';
6
6
  import type { SeriesMarkMap } from '../../interface';
7
+ import type { ISeriesSpecUpdatePolicy } from '../../base/base-series';
7
8
  export declare abstract class ProgressLikeSeries<T extends IProgressLikeSeriesSpec> extends PolarSeries<T> {
8
9
  static readonly mark: SeriesMarkMap;
9
10
  protected _startAngle: number;
10
11
  protected _endAngle: number;
11
12
  protected _arcGroupMark: IGroupMark | null;
13
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
12
14
  setAttrFromSpec(): void;
13
15
  getStackGroupFields(): string[];
14
16
  getStackValueField(): string;
@@ -1,6 +1,8 @@
1
1
  import { PolarSeries } from '../polar';
2
2
  import type { IRoseLikeSeriesSpec } from './interface';
3
+ import type { ISeriesSpecUpdatePolicy } from '../../base/base-series';
3
4
  export declare abstract class RoseLikeSeries<T extends IRoseLikeSeriesSpec> extends PolarSeries<T> {
5
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
4
6
  getStackGroupFields(): string[];
5
7
  getStackValueField(): string;
6
8
  getGroupFields(): string[];
@@ -1,6 +1,7 @@
1
1
  import type { Datum } from '../../../typings';
2
2
  import type { SeriesMarkMap } from '../../interface';
3
3
  import { SeriesTypeEnum } from '../../interface/type';
4
+ import type { ISeriesSpecUpdatePolicy } from '../../base/base-series';
4
5
  import type { ICircularProgressSeriesSpec } from './interface';
5
6
  import { ProgressLikeSeries } from '../../polar/progress-like/progress-like';
6
7
  import type { IMark } from '../../../mark/interface';
@@ -16,6 +17,7 @@ export declare class CircularProgressSeries<T extends ICircularProgressSeriesSpe
16
17
  readonly transformerConstructor: typeof CircularProgressSeriesSpecTransformer;
17
18
  private _progressMark;
18
19
  private _trackMark;
20
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
19
21
  getStackGroupFields(): string[];
20
22
  getGroupFields(): string[];
21
23
  initMark(): void;
@@ -3,6 +3,7 @@ import type { SeriesMarkMap } from '../../interface';
3
3
  import { SeriesTypeEnum } from '../../interface/type';
4
4
  import type { ILinearProgressSeriesSpec } from './interface';
5
5
  import type { IMark } from '../../../mark/interface';
6
+ import type { ISeriesSpecUpdatePolicy } from '../../base/base-series';
6
7
  export declare class LinearProgressSeries<T extends ILinearProgressSeriesSpec = ILinearProgressSeriesSpec> extends CartesianSeries<T> {
7
8
  static readonly type: string;
8
9
  type: SeriesTypeEnum;
@@ -12,6 +13,7 @@ export declare class LinearProgressSeries<T extends ILinearProgressSeriesSpec =
12
13
  };
13
14
  private _progressMark;
14
15
  private _trackMark;
16
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
15
17
  initMark(): void;
16
18
  initMarkStyle(): void;
17
19
  private _initProgressMark;
@@ -2,6 +2,7 @@ import type { DataView } from '@visactor/vdataset';
2
2
  import type { IScatterInvalidType } from '../../typings';
3
3
  import type { IScatterSeriesSpec } from './interface';
4
4
  import { CartesianSeries } from '../cartesian/cartesian';
5
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
5
6
  import type { SeriesMarkMap } from '../interface';
6
7
  import { SeriesTypeEnum } from '../interface/type';
7
8
  import type { ILabelMark, IMark } from '../../mark/interface';
@@ -22,6 +23,7 @@ export declare class ScatterSeries<T extends IScatterSeriesSpec = IScatterSeries
22
23
  private _shape;
23
24
  private _shapeField;
24
25
  protected _invalidType: IScatterInvalidType;
26
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
25
27
  setAttrFromSpec(): void;
26
28
  private _getSeriesAttribute;
27
29
  private getSizeAttribute;
@@ -8,6 +8,7 @@ import type { Datum } from '../../typings';
8
8
  import type { ILabelMark, IRuleMark, ITextMark } from '../../mark/interface';
9
9
  import type { ILabelInfo } from '../../component/label/interface';
10
10
  import { type ICompilableData } from '../../compile/data';
11
+ import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
11
12
  export declare const DefaultBandWidth = 6;
12
13
  export declare class WaterfallSeries<T extends IWaterfallSeriesSpec = IWaterfallSeriesSpec> extends BarSeries<any> {
13
14
  static readonly type: string;
@@ -24,6 +25,7 @@ export declare class WaterfallSeries<T extends IWaterfallSeriesSpec = IWaterfall
24
25
  protected _leaderLineMark: IRuleMark;
25
26
  protected _stackLabelMark: ITextMark;
26
27
  protected _labelMark: ITextMark;
28
+ protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
27
29
  protected initGroups(): void;
28
30
  setAttrFromSpec(): void;
29
31
  getSeriesKeys(): string[];
@@ -1,3 +1,4 @@
1
1
  import type { IMarkGraphic } from '../mark/interface';
2
+ export declare const setGraphicStates: (graphic: IMarkGraphic, nextStates?: string[] | null, hasAnimation?: boolean) => void;
2
3
  export declare const addGraphicState: (graphic: IMarkGraphic, state: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;
3
4
  export declare const removeGraphicState: (graphic: IMarkGraphic, state: string | string[], hasAnimation?: boolean) => void;