@visactor/vchart-types 1.11.11 → 1.11.12

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.
@@ -1,8 +1,9 @@
1
+ import type { IPointLike } from '@visactor/vutils';
1
2
  import type { IPolarAxisSpec } from '../../component/axis/polar/interface';
2
3
  import type { IPolarCrosshairSpec } from '../../component/crosshair/interface';
3
- import type { IChartSpec, ILayoutRect, IPoint } from '../../typings';
4
+ import type { IChartSpec, ILayoutRect } from '../../typings';
4
5
  export interface IPolarChartSpec extends IChartSpec {
5
6
  axes?: IPolarAxisSpec[];
6
7
  crosshair?: IPolarCrosshairSpec | IPolarCrosshairSpec[];
7
- layoutRadius?: 'auto' | number | ((layoutRect: ILayoutRect, center: IPoint) => number);
8
+ layoutRadius?: 'auto' | number | ((layoutRect: ILayoutRect, center: IPointLike) => number);
8
9
  }
@@ -81,8 +81,8 @@ export declare abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarA
81
81
  protected _getStartValue(): number;
82
82
  private _layoutAngleAxis;
83
83
  private _layoutRadiusAxis;
84
- protected _getRelatedAngleAxis(): IPolarAxis | undefined;
85
- private computeLayoutRadius;
84
+ protected _getRelatedAxis(index: number): IPolarAxis | undefined;
85
+ private _computeLayoutRadius;
86
86
  private computeLayoutOuterRadius;
87
87
  private computeLayoutInnerRadius;
88
88
  private getRefLayoutRect;
@@ -1,9 +1,10 @@
1
- import type { ILayoutRect, IPoint, IPolarOrientType } from '../../../../typings';
1
+ import type { IPointLike } from '@visactor/vutils';
2
+ import type { ILayoutRect, IPolarOrientType } from '../../../../typings';
2
3
  import type { IBandAxisSpec, IDomainLine, ILinearAxisSpec, ITitle, ILabel, ICommonAxisSpec } from '../../interface';
3
4
  import type { IPolarGrid } from './common';
4
5
  export type IPolarAxisSpec = IPolarLinearAxisSpec | IPolarBandAxisSpec;
5
6
  export type IPolarAxisCommonSpec = Omit<ICommonAxisSpec, 'center'> & {
6
- layoutRadius?: 'auto' | number | ((layoutRect: ILayoutRect, center: IPoint) => number);
7
+ layoutRadius?: 'auto' | number | ((layoutRect: ILayoutRect, center: IPointLike) => number);
7
8
  inside?: boolean;
8
9
  orient: IPolarOrientType;
9
10
  grid?: IPolarGrid;
@@ -1,4 +1,6 @@
1
1
  import type { IPolarAxisCommonSpec } from '../interface';
2
+ import type { ILayoutRect } from '../../../../typings/layout';
3
+ import type { IPoint } from '../../../../typings/coordinate';
2
4
  export declare const getPolarAxisInfo: (spec: IPolarAxisCommonSpec, chartSpec: any) => {
3
5
  axisType: import("../..").AxisType;
4
6
  componentName: string;
@@ -8,3 +10,4 @@ export declare const getPolarAxisInfo: (spec: IPolarAxisCommonSpec, chartSpec: a
8
10
  outerRadius: any;
9
11
  layoutRadius: any;
10
12
  };
13
+ export declare const computeLayoutRadius: (layoutRadius: number | "auto" | ((layoutRect: ILayoutRect, center: IPoint) => number), getLayoutRect: () => ILayoutRect, getCenter: () => IPoint, startAngle?: number, endAngle?: number) => number;
@@ -10,7 +10,7 @@ import type { ITheme } from '../theme';
10
10
  import type { IComponent } from '../component/interface';
11
11
  import type { LayoutCallBack } from '../layout/interface';
12
12
  import type { Compiler } from '../compile/compiler';
13
- import type { IChart, IChartSpecInfo } from '../chart/interface';
13
+ import type { DimensionIndexOption, IChart, IChartSpecInfo } from '../chart/interface';
14
14
  import type { Stage } from '@visactor/vrender-core';
15
15
  import type { IContainerSize } from '@visactor/vrender-components';
16
16
  import type { IBaseScale } from '@visactor/vscale';
@@ -29,8 +29,8 @@ export interface IVChartConstructor {
29
29
  }
30
30
  export interface IVChart {
31
31
  readonly id: number;
32
- renderSync: (morphConfig?: IMorphConfig, resetMediaQuery?: boolean) => IVChart;
33
- renderAsync: (morphConfig?: IMorphConfig, resetMediaQuery?: boolean) => Promise<IVChart>;
32
+ renderSync: (morphConfig?: IMorphConfig) => IVChart;
33
+ renderAsync: (morphConfig?: IMorphConfig) => Promise<IVChart>;
34
34
  updateData: (id: StringOrNumber, data: Datum[] | string, options?: IParserOptions) => Promise<IVChart>;
35
35
  updateDataInBatches: (list: {
36
36
  id: string;
@@ -39,6 +39,7 @@ export interface IVChart {
39
39
  }[]) => Promise<IVChart>;
40
40
  updateDataSync: (id: StringOrNumber, data: Datum[], options?: IParserOptions) => IVChart;
41
41
  updateFullDataSync: (data: IDataValues | IDataValues[], reRender?: boolean) => IVChart;
42
+ updateFullData: (data: IDataValues | IDataValues[], reRender?: boolean) => Promise<IVChart>;
42
43
  updateSpec: (spec: ISpec, forceMerge?: boolean, morphConfig?: IMorphConfig, userUpdateOptions?: IUpdateSpecResult) => Promise<IVChart>;
43
44
  updateSpecSync: (spec: ISpec, forceMerge?: boolean, morphConfig?: IMorphConfig, userUpdateOptions?: IUpdateSpecResult) => void;
44
45
  updateModelSpecSync: (filter: string | {
@@ -89,8 +90,19 @@ export interface IVChart {
89
90
  getComponents: () => IComponent[];
90
91
  getDataSet: () => Maybe<DataSet>;
91
92
  getScale: (scaleId: string) => IBaseScale | null;
93
+ setDimensionIndex: (value: StringOrNumber, options?: DimensionIndexOption) => void;
92
94
  convertDatumToPosition: (datum: Datum, dataLinkInfo?: DataLinkSeries, isRelativeToCanvas?: boolean, checkInViewData?: boolean) => IPoint | null;
93
95
  convertValueToPosition: ((value: StringOrNumber, dataLinkInfo: DataLinkAxis, isRelativeToCanvas?: boolean) => number | null) & ((value: [StringOrNumber, StringOrNumber], dataLinkInfo: DataLinkSeries, isRelativeToCanvas?: boolean) => IPoint | null);
96
+ updateIndicatorDataById: (id: string, datum?: Datum) => void;
97
+ updateIndicatorDataByIndex: (index?: number, datum?: Datum) => void;
98
+ geoZoomByIndex: (regionIndex: number, zoom: number, center?: {
99
+ x: number;
100
+ y: number;
101
+ }) => void;
102
+ geoZoomById: (regionId: string | number, zoom: number, center?: {
103
+ x: number;
104
+ y: number;
105
+ }) => void;
94
106
  stopAnimation: () => void;
95
107
  pauseAnimation: () => void;
96
108
  resumeAnimation: () => void;
@@ -1,9 +1,9 @@
1
1
  import type { DataView } from '@visactor/vdataset';
2
2
  export interface IPieOpt {
3
- angleField: string;
4
- startAngle: number;
5
- endAngle: number;
6
- minAngle: number;
3
+ angleField: () => string;
4
+ startAngle: () => number;
5
+ endAngle: () => number;
6
+ minAngle: () => number;
7
7
  asStartAngle: string;
8
8
  asEndAngle: string;
9
9
  asMiddleAngle: string;
@@ -46,6 +46,7 @@ export interface IUpdateSpecResult {
46
46
  reTransformSpec?: boolean;
47
47
  reAnimate?: boolean;
48
48
  changeTheme?: boolean;
49
+ changeBackground?: boolean;
49
50
  }
50
51
  export interface IUpdateDataResult {
51
52
  reAnimate?: boolean;
@@ -6,6 +6,8 @@ import type { IPolarSeriesSpec, IPolarSeriesTheme } from '../polar/interface';
6
6
  import type { PieAppearPreset } from './animation/animation';
7
7
  import type { ILabelSpec, IMultiLabelSpec } from '../../component/label';
8
8
  import type { ICustomPath2D, ILineGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
9
+ import type { ILayoutRect } from '../../typings/layout';
10
+ import type { IPointLike } from '@visactor/vutils';
9
11
  export type PieMarks = 'pie' | 'label' | 'labelLine';
10
12
  export type IBasePieSeriesSpec = Omit<IPieSeriesSpec, 'type'> & {
11
13
  type: string;
@@ -25,6 +27,7 @@ export interface IPieSeriesSpec extends IPolarSeriesSpec, IAnimationSpec<PieMark
25
27
  endAngle?: number;
26
28
  padAngle?: number;
27
29
  minAngle?: number;
30
+ layoutRadius?: 'auto' | number | ((layoutRect: ILayoutRect, center: IPointLike) => number);
28
31
  [SeriesMarkNameEnum.pie]?: IMarkSpec<IArcMarkSpec>;
29
32
  [SeriesMarkNameEnum.label]?: IMultiLabelSpec<IArcLabelSpec>;
30
33
  }
@@ -18,7 +18,7 @@ export declare class BasePieSeries<T extends IBasePieSeriesSpec> extends PolarSe
18
18
  protected _pieMarkType: MarkTypeEnum;
19
19
  static readonly mark: SeriesMarkMap;
20
20
  protected _viewDataLabel: SeriesData;
21
- getCenter(): IPoint;
21
+ getCenter: () => IPoint;
22
22
  protected _centerOffset: number;
23
23
  protected _cornerRadius: number;
24
24
  protected _startAngle: number;
@@ -33,6 +33,7 @@ export declare class BasePieSeries<T extends IBasePieSeriesSpec> extends PolarSe
33
33
  initMark(): void;
34
34
  private startAngleScale;
35
35
  private endAngleScale;
36
+ protected _computeLayoutRadius(): number;
36
37
  initMarkStyle(): void;
37
38
  initInteraction(): void;
38
39
  protected initTooltip(): void;