@visactor/vchart-types 1.11.0-alpha.2 → 1.11.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.
Files changed (124) hide show
  1. package/package.json +1 -1
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/animation/utils.d.ts +2 -2
  4. package/types/chart/base/base-chart.d.ts +7 -2
  5. package/types/chart/common/interface.d.ts +2 -2
  6. package/types/chart/index.d.ts +6 -4
  7. package/types/chart/interface/chart.d.ts +9 -1
  8. package/types/chart/interface/type.d.ts +2 -1
  9. package/types/chart/sankey/sankey.d.ts +5 -0
  10. package/types/chart/venn/index.d.ts +3 -0
  11. package/types/chart/venn/interface.d.ts +6 -0
  12. package/types/chart/venn/venn-transformer.d.ts +7 -0
  13. package/types/chart/venn/venn.d.ts +14 -0
  14. package/types/compile/compiler.d.ts +3 -3
  15. package/types/compile/interface/compiler.d.ts +1 -0
  16. package/types/compile/mark/compilable-mark.d.ts +2 -1
  17. package/types/compile/mark/interface.d.ts +4 -1
  18. package/types/component/axis/base-axis.d.ts +2 -0
  19. package/types/component/axis/cartesian/axis.d.ts +1 -2
  20. package/types/component/axis/cartesian/interface/common.d.ts +1 -0
  21. package/types/component/axis/interface/spec.d.ts +2 -0
  22. package/types/component/axis/mixin/linear-axis-mixin.d.ts +12 -3
  23. package/types/component/axis/polar/axis.d.ts +0 -1
  24. package/types/component/axis/polar/interface/common.d.ts +1 -0
  25. package/types/component/axis/polar/linear-axis.d.ts +5 -1
  26. package/types/component/base/base-component.d.ts +1 -0
  27. package/types/component/crosshair/base.d.ts +1 -2
  28. package/types/component/crosshair/interface/cartesian.d.ts +11 -24
  29. package/types/component/crosshair/interface/polar.d.ts +7 -5
  30. package/types/component/custom-mark/custom-mark.d.ts +11 -4
  31. package/types/component/data-zoom/data-filter-base-component.d.ts +3 -2
  32. package/types/component/data-zoom/interface.d.ts +1 -4
  33. package/types/component/index.d.ts +7 -7
  34. package/types/component/interface/theme.d.ts +4 -0
  35. package/types/component/interface/type.d.ts +4 -0
  36. package/types/component/label/util.d.ts +9 -1
  37. package/types/component/legend/continuous/interface.d.ts +1 -0
  38. package/types/component/legend/discrete/interface.d.ts +1 -0
  39. package/types/component/legend/discrete/legend.d.ts +4 -1
  40. package/types/component/legend/util.d.ts +12 -2
  41. package/types/component/marker/base-marker.d.ts +30 -44
  42. package/types/component/marker/interface.d.ts +40 -13
  43. package/types/component/marker/mark-area/base-mark-area.d.ts +18 -0
  44. package/types/component/marker/mark-area/cartesian-mark-area.d.ts +19 -0
  45. package/types/component/marker/mark-area/index.d.ts +2 -1
  46. package/types/component/marker/mark-area/interface/spec.d.ts +16 -1
  47. package/types/component/marker/mark-area/interface/theme.d.ts +5 -7
  48. package/types/component/marker/mark-area/polar-mark-area.d.ts +25 -0
  49. package/types/component/marker/mark-line/base-mark-line.d.ts +18 -0
  50. package/types/component/marker/mark-line/cartesian-mark-line.d.ts +20 -0
  51. package/types/component/marker/mark-line/index.d.ts +2 -1
  52. package/types/component/marker/mark-line/interface/spec.d.ts +26 -2
  53. package/types/component/marker/mark-line/interface/theme.d.ts +5 -7
  54. package/types/component/marker/mark-line/polar-mark-line.d.ts +23 -0
  55. package/types/component/marker/mark-point/base-mark-point.d.ts +17 -0
  56. package/types/component/marker/mark-point/cartesian-mark-point.d.ts +16 -0
  57. package/types/component/marker/mark-point/geo-mark-point.d.ts +14 -0
  58. package/types/component/marker/mark-point/index.d.ts +3 -1
  59. package/types/component/marker/mark-point/interface/spec.d.ts +9 -1
  60. package/types/component/marker/mark-point/interface/theme.d.ts +11 -16
  61. package/types/component/marker/mark-point/polar-mark-point.d.ts +18 -0
  62. package/types/component/marker/utils.d.ts +40 -5
  63. package/types/component/player/player.d.ts +2 -1
  64. package/types/component/tooltip/tooltip.d.ts +2 -6
  65. package/types/component/tooltip/utils/compose.d.ts +2 -2
  66. package/types/component/tooltip/utils/index.d.ts +1 -0
  67. package/types/component/tooltip/utils/pattern.d.ts +4 -0
  68. package/types/component/tooltip/utils/show-tooltip.d.ts +20 -3
  69. package/types/core/factory.d.ts +1 -1
  70. package/types/core/interface.d.ts +8 -1
  71. package/types/core/vchart.d.ts +5 -2
  72. package/types/data/transforms/aggregation.d.ts +12 -7
  73. package/types/data/transforms/invalid-travel.d.ts +1 -1
  74. package/types/data/transforms/legend-data/discrete/interface.d.ts +2 -0
  75. package/types/event/interface.d.ts +2 -0
  76. package/types/layout/grid-layout/grid-layout.d.ts +1 -1
  77. package/types/mark/index.d.ts +20 -20
  78. package/types/model/interface.d.ts +1 -0
  79. package/types/plugin/base/base-plugin-service.d.ts +2 -0
  80. package/types/plugin/base/interface.d.ts +3 -0
  81. package/types/plugin/components/tooltip-handler/base.d.ts +1 -1
  82. package/types/plugin/components/tooltip-handler/utils/index.d.ts +0 -1
  83. package/types/region/interface.d.ts +2 -0
  84. package/types/region/region.d.ts +1 -0
  85. package/types/series/base/base-series.d.ts +9 -17
  86. package/types/series/base/tooltip-helper.d.ts +8 -5
  87. package/types/series/box-plot/tooltip-helper.d.ts +1 -1
  88. package/types/series/cartesian/cartesian.d.ts +1 -1
  89. package/types/series/circle-packing/tooltip-helper.d.ts +1 -1
  90. package/types/series/funnel/tooltip-helper.d.ts +3 -3
  91. package/types/series/geo/geo.d.ts +1 -0
  92. package/types/series/index.d.ts +7 -3
  93. package/types/series/interface/common.d.ts +3 -2
  94. package/types/series/interface/series.d.ts +7 -0
  95. package/types/series/interface/theme.d.ts +2 -0
  96. package/types/series/interface/tooltip-helper.d.ts +8 -5
  97. package/types/series/interface/type.d.ts +6 -2
  98. package/types/series/map/geo-source.d.ts +3 -1
  99. package/types/series/map/tooltip-helper.d.ts +1 -1
  100. package/types/series/polar/polar.d.ts +2 -2
  101. package/types/series/range-area/range-area.d.ts +0 -2
  102. package/types/series/sankey/interface.d.ts +5 -0
  103. package/types/series/sankey/sankey.d.ts +10 -4
  104. package/types/series/sunburst/tooltip-helper.d.ts +1 -1
  105. package/types/series/treemap/tooltip-helper.d.ts +1 -1
  106. package/types/series/venn/animation.d.ts +6 -0
  107. package/types/series/venn/constant.d.ts +2 -0
  108. package/types/series/venn/interface.d.ts +21 -0
  109. package/types/series/venn/tooltip-helper.d.ts +5 -0
  110. package/types/series/venn/util.d.ts +1 -0
  111. package/types/series/venn/venn-transform.d.ts +6 -0
  112. package/types/series/venn/venn.d.ts +63 -0
  113. package/types/series/waterfall/interface.d.ts +6 -1
  114. package/types/series/waterfall/waterfall.d.ts +9 -0
  115. package/types/series/word-cloud/base.d.ts +2 -0
  116. package/types/theme/builtin/common/series/venn.d.ts +2 -0
  117. package/types/typings/spec/chart.d.ts +2 -0
  118. package/types/typings/spec/common.d.ts +5 -2
  119. package/types/typings/tooltip/line.d.ts +4 -0
  120. package/types/typings/tooltip/tooltip.d.ts +1 -0
  121. package/types/util/data.d.ts +21 -4
  122. package/types/util/index.d.ts +1 -0
  123. package/types/util/math.d.ts +1 -1
  124. package/types/util/spec/index.d.ts +0 -5
@@ -29,8 +29,12 @@ export interface IComponentTheme {
29
29
  [ComponentTypeEnum.colorLegend]?: IColorLegendTheme;
30
30
  [ComponentTypeEnum.sizeLegend]?: ISizeLegendTheme;
31
31
  [ComponentTypeEnum.markLine]?: IMarkLineTheme;
32
+ [ComponentTypeEnum.polarMarkLine]?: IMarkLineTheme;
32
33
  [ComponentTypeEnum.markArea]?: IMarkAreaTheme;
34
+ [ComponentTypeEnum.polarMarkArea]?: IMarkAreaTheme;
33
35
  [ComponentTypeEnum.markPoint]?: IMarkPointTheme;
36
+ [ComponentTypeEnum.polarMarkPoint]?: IMarkPointTheme;
37
+ [ComponentTypeEnum.geoMarkPoint]?: IMarkPointTheme;
34
38
  [ComponentTypeEnum.tooltip]?: ITooltipTheme<string | IColorKey>;
35
39
  [ComponentTypeEnum.crosshair]?: ICrosshairTheme;
36
40
  [ComponentTypeEnum.dataZoom]?: IDataZoomTheme;
@@ -23,6 +23,10 @@ export declare enum ComponentTypeEnum {
23
23
  markLine = "markLine",
24
24
  markArea = "markArea",
25
25
  markPoint = "markPoint",
26
+ polarMarkLine = "polarMarkLine",
27
+ polarMarkArea = "polarMarkArea",
28
+ polarMarkPoint = "polarMarkPoint",
29
+ geoMarkPoint = "geoMarkPoint",
26
30
  tooltip = "tooltip",
27
31
  title = "title",
28
32
  player = "player",
@@ -1,3 +1,4 @@
1
+ import type { WaterfallSeries } from './../../series/waterfall/waterfall';
1
2
  import type { Datum } from '../../typings/common';
2
3
  import type { ILabelInfo } from './label';
3
4
  import type { LabelItem, Strategy } from '@visactor/vrender-components';
@@ -14,6 +15,7 @@ export declare const labelRuleMap: {
14
15
  rect3d: typeof barLabel;
15
16
  arc3d: typeof pieLabel;
16
17
  treemap: typeof treemapLabel;
18
+ venn: typeof vennLabel;
17
19
  };
18
20
  export declare function defaultLabelConfig(rule: string, labelInfo: ILabelInfo): any;
19
21
  export declare function textAttribute(labelInfo: ILabelInfo, datum: Datum, formatMethod?: ILabelSpec['formatMethod'], formatter?: ILabelSpec['formatter']): any;
@@ -48,7 +50,9 @@ export declare function pieLabel(labelInfo: ILabelInfo): {
48
50
  position: import("@visactor/vrender-components").Functional<string>;
49
51
  smartInvert: boolean | import("@visactor/vrender-components").SmartInvertAttrs;
50
52
  };
51
- export declare function stackLabel(labelInfo: ILabelInfo): {
53
+ export declare function stackLabelX(datum2: Datum, series: WaterfallSeries, pos: string, offset: number): number;
54
+ export declare function stackLabelY(datum2: Datum, series: WaterfallSeries, pos: string, offset: number): number;
55
+ export declare function stackLabel(labelInfo: ILabelInfo, datumTransform?: (data: any) => any, attributeTransform?: (label: LabelItem, datum: Datum, att: any) => any): {
52
56
  customLayoutFunc: (labels: LabelItem[]) => import("@visactor/vrender-core").IText[];
53
57
  dataFilter: (labels: LabelItem[]) => LabelItem[];
54
58
  overlap: {
@@ -59,6 +63,10 @@ export declare function treemapLabel(labelInfo: ILabelInfo): {
59
63
  customLayoutFunc: (labels: LabelItem[], text: any) => any;
60
64
  overlap: boolean;
61
65
  };
66
+ export declare function vennLabel(labelInfo: ILabelInfo): {
67
+ customLayoutFunc: (labels: LabelItem[], text: any) => any;
68
+ smartInvert: boolean;
69
+ };
62
70
  export declare function LineLabel(labelInfo: ILabelInfo): {
63
71
  position: string;
64
72
  data: any;
@@ -16,6 +16,7 @@ export type HandlerTextAttribute = {
16
16
  style?: Omit<NoVisibleMarkStyle<ITextMarkSpec>, 'text'>;
17
17
  };
18
18
  export type IContinuousLegendSpec = ILegendCommonSpec & {
19
+ inverse?: boolean;
19
20
  field?: string;
20
21
  scale?: string;
21
22
  defaultSelected?: [number, number];
@@ -67,6 +67,7 @@ export type IDiscreteLegendSpec = ILegendCommonSpec & {
67
67
  data?: (data: LegendItemDatum[], colorScale: IBaseScale, globalScale: IGlobalScale) => LegendItemDatum[];
68
68
  item?: IItem;
69
69
  pager?: IPager | ILegendScrollbar;
70
+ scale?: string;
70
71
  scaleName?: string;
71
72
  field?: string;
72
73
  defaultSelected?: string[];
@@ -7,20 +7,23 @@ import { ComponentTypeEnum } from '../../interface/type';
7
7
  import { DiscreteLegend as LegendComponent } from '@visactor/vrender-components';
8
8
  import { BaseLegend } from '../base-legend';
9
9
  import type { ILayoutRect } from '../../../typings/layout';
10
+ import type { StringOrNumber } from '../../../typings';
10
11
  export declare class DiscreteLegend extends BaseLegend<IDiscreteLegendSpec> {
11
12
  static specKey: string;
12
13
  static type: ComponentTypeEnum;
13
14
  type: ComponentTypeEnum;
14
15
  name: string;
16
+ protected _unselectedData: StringOrNumber[];
15
17
  static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
16
18
  init(option: IModelInitOption): void;
17
19
  protected _initLegendData(): DataView;
18
20
  protected _getSeriesLegendField(s: ISeries): string;
19
21
  protected _initSelectedData(): void;
20
- private _getLegendDefaultData;
22
+ getLegendDefaultData(originalData?: boolean): any;
21
23
  private _addDefaultTitleText;
22
24
  protected _getLegendAttributes(rect: ILayoutRect): any;
23
25
  protected _getLegendConstructor(): typeof LegendComponent;
26
+ setSelectedData(selectedData: StringOrNumber[]): void;
24
27
  protected _initEvent(): void;
25
28
  private _getLegendItems;
26
29
  private _addLegendItemFormatMethods;
@@ -15,12 +15,22 @@ export declare function transformLegendTitleAttributes(title: ITitle): {
15
15
  visible?: boolean;
16
16
  style?: Omit<import("./interface").NoVisibleMarkStyle<import("../..").IRectMarkSpec>, "visible" | "width" | "height">;
17
17
  };
18
- text?: string | number | string[] | number[] | {
18
+ text?: string | number | number[] | string[] | {
19
19
  type?: "text";
20
- text: string | number | string[] | number[];
20
+ text: string | number | number[] | string[];
21
21
  } | {
22
22
  type: "rich";
23
23
  text: import("@visactor/vrender-core").IRichTextCharacter[];
24
+ } | {
25
+ type: "html";
26
+ text: {
27
+ dom: string | HTMLElement;
28
+ } & import("@visactor/vrender-core").SimpleDomStyleOptions & import("@visactor/vrender-core").CommonDomOptions;
29
+ } | {
30
+ type: "react";
31
+ text: {
32
+ element: any;
33
+ } & import("@visactor/vrender-core").SimpleDomStyleOptions & import("@visactor/vrender-core").CommonDomOptions;
24
34
  };
25
35
  visible?: boolean;
26
36
  padding?: import("@visactor/vrender-components").Padding;
@@ -1,67 +1,53 @@
1
- import type { DataView } from '@visactor/vdataset';
2
- import type { IModelRenderOption } from '../../model/interface';
1
+ import { DataView } from '@visactor/vdataset';
2
+ import type { Maybe } from '@visactor/vutils';
3
+ import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
3
4
  import type { IRegion } from '../../region/interface';
4
- import type { ICartesianSeries } from '../../series/interface';
5
5
  import type { ILayoutRect, ILayoutType, IRect } from '../../typings';
6
6
  import { BaseComponent } from '../base/base-component';
7
- import type { IAggrType, IDataPos, IDataPosCallback, IMarkerSpec } from './interface';
7
+ import type { IDataPos, IDataPosCallback, IMarkerSpec, IMarkerSupportSeries } from './interface';
8
8
  import type { IGraphic, IGroup } from '@visactor/vrender-core';
9
9
  export declare abstract class BaseMarker<T extends IMarkerSpec> extends BaseComponent<T> {
10
10
  layoutType: ILayoutType | 'none';
11
- protected _startRelativeSeries: ICartesianSeries;
12
- protected _endRelativeSeries: ICartesianSeries;
13
- protected _relativeSeries: ICartesianSeries;
14
- getRelativeSeries(): ICartesianSeries;
11
+ static specKey: string;
12
+ static type: string;
13
+ static coordinateType: string;
14
+ coordinateType: string;
15
+ protected _startRelativeSeries: IMarkerSupportSeries;
16
+ protected _endRelativeSeries: IMarkerSupportSeries;
17
+ protected _relativeSeries: IMarkerSupportSeries;
18
+ protected _specifiedDataSeries: IMarkerSupportSeries | IMarkerSupportSeries[];
19
+ getRelativeSeries(): IMarkerSupportSeries;
15
20
  protected _markerData: DataView;
21
+ getMarkerData(): DataView;
16
22
  protected _markerComponent: any;
17
23
  protected _layoutOffsetX: number;
18
24
  protected _layoutOffsetY: number;
19
25
  private _firstSeries;
26
+ protected abstract _initDataView(): void;
27
+ protected abstract _createMarkerComponent(): IGroup;
28
+ protected abstract _markerLayout(): void;
29
+ static _getMarkerCoordinateType(markerSpec: any): string;
30
+ static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
20
31
  created(): void;
21
32
  protected _getAllRelativeSeries(): {
22
- getRelativeSeries: () => ICartesianSeries;
23
- getStartRelativeSeries: () => ICartesianSeries;
24
- getEndRelativeSeries: () => ICartesianSeries;
33
+ getRelativeSeries: () => IMarkerSupportSeries;
34
+ getStartRelativeSeries: () => IMarkerSupportSeries;
35
+ getEndRelativeSeries: () => IMarkerSupportSeries;
25
36
  };
26
37
  private _getFieldInfoFromSpec;
27
- protected _processSpecX(specX: IDataPos | IDataPosCallback): {
28
- getRelativeSeries: () => ICartesianSeries;
29
- getStartRelativeSeries: () => ICartesianSeries;
30
- getEndRelativeSeries: () => ICartesianSeries;
31
- x: string | number | IDataPosCallback | {
32
- field: any;
33
- aggrType: IAggrType;
34
- };
35
- };
36
- protected _processSpecY(specY: IDataPos | IDataPosCallback): {
37
- getRelativeSeries: () => ICartesianSeries;
38
- getStartRelativeSeries: () => ICartesianSeries;
39
- getEndRelativeSeries: () => ICartesianSeries;
40
- y: string | number | IDataPosCallback | {
41
- field: any;
42
- aggrType: IAggrType;
43
- };
44
- };
45
- protected _processSpecXY(specX: IDataPos | IDataPosCallback, specY: IDataPos | IDataPosCallback): {
46
- getRelativeSeries: () => ICartesianSeries;
47
- getStartRelativeSeries: () => ICartesianSeries;
48
- getEndRelativeSeries: () => ICartesianSeries;
49
- x: string | number | IDataPosCallback | {
50
- field: any;
51
- aggrType: IAggrType;
52
- };
53
- y: string | number | IDataPosCallback | {
54
- field: any;
55
- aggrType: IAggrType;
56
- };
38
+ protected _processSpecByDims(dimSpec: {
39
+ dim: 'x' | 'y' | 'angle' | 'radius' | 'areaName';
40
+ specValue: IDataPos | IDataPosCallback;
41
+ }[]): {
42
+ getRelativeSeries: () => IMarkerSupportSeries;
43
+ getStartRelativeSeries: () => IMarkerSupportSeries;
44
+ getEndRelativeSeries: () => IMarkerSupportSeries;
57
45
  };
58
46
  protected _processSpecCoo(spec: any): any;
47
+ protected _getRelativeDataView(): DataView;
59
48
  updateLayoutAttribute(): void;
60
49
  private _getSeriesByIdOrIndex;
61
50
  protected _bindSeries(): void;
62
- protected abstract _initDataView(): void;
63
- protected abstract _createMarkerComponent(): IGroup;
64
- protected abstract _markerLayout(): void;
65
51
  protected initEvent(): void;
66
52
  onRender(ctx: IModelRenderOption): void;
67
53
  changeRegions(regions: IRegion[]): void;
@@ -1,17 +1,24 @@
1
+ import type { DataView } from '@visactor/vdataset';
1
2
  import type { IPadding } from '@visactor/vutils';
2
3
  import type { SymbolType } from '@visactor/vrender-core';
3
4
  import type { IComposedTextMarkSpec, IFormatMethod, IRectMarkSpec, IRichTextFormatMethod, ISymbolMarkSpec, StringOrNumber } from '../../typings';
4
5
  import type { IComponentSpec } from '../base/interface';
5
6
  import type { Datum } from '@visactor/vrender-components';
6
- import type { ICartesianSeries } from '../../series/interface';
7
- import type { IOptionAggrField, IOptionSeries } from '../../data/transforms/aggregation';
7
+ import type { ICartesianSeries, IGeoSeries, IPolarSeries } from '../../series/interface';
8
+ import type { IOptionAggr, IOptionAggrField, IOptionSeries } from '../../data/transforms/aggregation';
9
+ import type { IOptionRegr } from '../../data/transforms/regression';
10
+ export type IMarkerSupportSeries = ICartesianSeries | IPolarSeries | IGeoSeries;
11
+ export type IPolarPoint = {
12
+ angle: number;
13
+ radius: number;
14
+ };
8
15
  export type OffsetPoint = {
9
16
  x?: number | string;
10
17
  y?: number | string;
11
18
  };
12
19
  export type IAggrType = 'sum' | 'average' | 'min' | 'max' | 'variance' | 'standardDeviation' | 'median';
13
20
  export type IDataPos = StringOrNumber | IAggrType;
14
- export type IDataPosCallback = (relativeSeriesData: Datum[], startRelativeSeriesData: Datum[], endRelativeSeriesData: Datum[], relativeSeries: ICartesianSeries, startRelativeSeries: ICartesianSeries, endRelativeSeries: ICartesianSeries) => StringOrNumber;
21
+ export type IDataPosCallback = (relativeSeriesData: Datum[], startRelativeSeriesData: Datum[], endRelativeSeriesData: Datum[], relativeSeries: IMarkerSupportSeries, startRelativeSeries: IMarkerSupportSeries, endRelativeSeries: IMarkerSupportSeries) => StringOrNumber;
15
22
  export type IDataPointSpec = {
16
23
  [key: string]: IDataPos | IDataPosCallback;
17
24
  refRelativeSeriesIndex?: number;
@@ -20,6 +27,10 @@ export type IDataPointSpec = {
20
27
  xFieldDim?: string;
21
28
  yFieldIndex?: number;
22
29
  yFieldDim?: string;
30
+ angleFieldIndex?: number;
31
+ angleFieldDim?: string;
32
+ radiusFieldIndex?: number;
33
+ radiusFieldDim?: string;
23
34
  };
24
35
  export type MarkerPositionPoint = {
25
36
  x: StringOrNumber;
@@ -28,7 +39,9 @@ export type MarkerPositionPoint = {
28
39
  export type ICoordinateOption = {
29
40
  x?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
30
41
  y?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
31
- getRefRelativeSeries?: () => ICartesianSeries;
42
+ angle?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
43
+ radius?: IOptionAggrField | (IDataPosCallback | StringOrNumber)[];
44
+ getRefRelativeSeries?: () => IMarkerSupportSeries;
32
45
  } & IOptionSeries;
33
46
  export type IMarkerPositionsSpec = {
34
47
  positions: MarkerPositionPoint[];
@@ -42,12 +55,10 @@ export type IMarkerLabelWithoutRefSpec = {
42
55
  labelBackground?: {
43
56
  visible?: boolean;
44
57
  padding?: IPadding | number[] | number;
45
- style?: Omit<IRectMarkSpec, 'visible'>;
46
- };
58
+ } & Partial<IMarkerState<Omit<IRectMarkSpec, 'visible'>>>;
47
59
  type?: 'rich' | 'text';
48
60
  text?: string | string[] | number | number[] | ReturnType<IRichTextFormatMethod<[]>>;
49
61
  formatMethod?: IFormatMethod<[markData: Datum[], seriesData: Datum[]]>;
50
- style?: Omit<IComposedTextMarkSpec, 'visible'>;
51
62
  shape?: {
52
63
  visible?: boolean;
53
64
  style: Omit<ISymbolMarkSpec, 'visible'>;
@@ -56,7 +67,7 @@ export type IMarkerLabelWithoutRefSpec = {
56
67
  confine?: boolean;
57
68
  dx?: number;
58
69
  dy?: number;
59
- };
70
+ } & Partial<IMarkerState<Omit<IComposedTextMarkSpec, 'visible'>>>;
60
71
  export type IMarkerLabelSpec = IMarkerLabelWithoutRefSpec & IMarkerRef;
61
72
  export interface IMarkerRef {
62
73
  refX?: number;
@@ -68,8 +79,10 @@ export interface IMarkerCrossSeriesSpec {
68
79
  endRelativeSeriesIndex?: number;
69
80
  startRelativeSeriesId?: string;
70
81
  endRelativeSeriesId?: string;
82
+ specifiedDataSeriesIndex?: 'all' | number | number[];
83
+ specifiedDataSeriesId?: 'all' | string | string[];
71
84
  }
72
- export interface IMarkerSpec extends IComponentSpec {
85
+ export type IMarkerSpec = IComponentSpec & {
73
86
  relativeSeriesIndex?: number;
74
87
  relativeSeriesId?: number | string;
75
88
  visible?: boolean;
@@ -77,10 +90,24 @@ export interface IMarkerSpec extends IComponentSpec {
77
90
  autoRange?: boolean;
78
91
  clip?: boolean;
79
92
  name?: string;
80
- }
81
- export interface IMarkerSymbol extends IMarkerRef {
93
+ coordinateType?: string;
94
+ };
95
+ export type IMarkerSymbol = IMarkerRef & {
82
96
  visible: boolean;
83
97
  symbolType?: SymbolType;
84
98
  size?: number;
85
- style?: Omit<ISymbolMarkSpec, 'visible'>;
86
- }
99
+ } & Partial<IMarkerState<Omit<ISymbolMarkSpec, 'visible'>>>;
100
+ export type MarkerStyleCallback<T> = (markerData: DataView) => T;
101
+ export type MarkerStateCallback<T> = (markerData: DataView) => T;
102
+ export type MarkerStateValue = 'hover' | 'hover_reverse' | 'selected' | 'selected_reverse';
103
+ export type IMarkerState<T> = {
104
+ style?: T | MarkerStyleCallback<T>;
105
+ state?: Record<MarkerStateValue, T | MarkerStateCallback<T>>;
106
+ };
107
+ export type MarkCoordinateType = 'cartesian' | 'polar' | 'geo';
108
+ export type IMarkProcessOptions = {
109
+ options: IOptionAggr[] | IOptionRegr;
110
+ needAggr?: boolean;
111
+ needRegr?: boolean;
112
+ processData?: DataView;
113
+ };
@@ -0,0 +1,18 @@
1
+ import type { IMarkArea, IMarkAreaSpec } from './interface';
2
+ import type { MarkArcAreaAttrs, MarkAreaAttrs } from '@visactor/vrender-components';
3
+ import type { MarkArea as MarkAreaComponent, MarkArcArea as MarkArcAreaComponent } from '@visactor/vrender-components';
4
+ import { BaseMarker } from '../base-marker';
5
+ import type { IGroup } from '@visactor/vrender-core';
6
+ import type { IMarkProcessOptions } from '../interface';
7
+ export declare abstract class BaseMarkArea extends BaseMarker<IMarkAreaSpec> implements IMarkArea {
8
+ static specKey: string;
9
+ specKey: string;
10
+ layoutZIndex: number;
11
+ protected abstract _newMarkAreaComponent(attr: MarkAreaAttrs | MarkArcAreaAttrs): MarkAreaComponent | MarkArcAreaComponent;
12
+ protected abstract _computePointsAttr(): any;
13
+ protected abstract _computeOptions(): IMarkProcessOptions;
14
+ static _getMarkerCoordinateType(markerSpec: any): string;
15
+ protected _createMarkerComponent(): IGroup;
16
+ protected _markerLayout(): void;
17
+ protected _initDataView(): void;
18
+ }
@@ -0,0 +1,19 @@
1
+ import { ComponentTypeEnum } from '../../interface/type';
2
+ import type { MarkAreaAttrs } from '@visactor/vrender-components';
3
+ import { MarkArea as MarkAreaComponent } from '@visactor/vrender-components';
4
+ import type { IPoint } from '../../../typings';
5
+ import type { IMarkProcessOptions } from '../interface';
6
+ import { BaseMarkArea } from './base-mark-area';
7
+ export declare class CartesianMarkArea extends BaseMarkArea {
8
+ static type: ComponentTypeEnum;
9
+ type: ComponentTypeEnum;
10
+ name: string;
11
+ static coordinateType: string;
12
+ coordinateType: string;
13
+ protected _newMarkAreaComponent(attr: MarkAreaAttrs): MarkAreaComponent;
14
+ protected _computePointsAttr(): {
15
+ points: IPoint[];
16
+ };
17
+ protected _computeOptions(): IMarkProcessOptions;
18
+ }
19
+ export declare const registerMarkArea: () => void;
@@ -1,2 +1,3 @@
1
- export * from './mark-area';
1
+ export * from './cartesian-mark-area';
2
+ export * from './polar-mark-area';
2
3
  export * from './interface';
@@ -1,9 +1,10 @@
1
+ import type { BaseMarkerAnimation, CommonMarkAreaAnimationType } from '@visactor/vrender-components';
1
2
  import type { IComponent } from '../../../interface';
2
3
  import type { IMarkerPositionsSpec, IDataPointSpec, IDataPos, IMarkerSpec, IDataPosCallback, IMarkerCrossSeriesSpec, OffsetPoint } from '../../interface';
3
4
  import type { IMarkAreaTheme } from './theme';
4
5
  export type IMarkArea = IComponent;
5
6
  export type IRegressType = 'regression';
6
- export type IMarkAreaSpec = IMarkerSpec & (IMarkAreaXSpec | IMarkAreaYSpec | IMarkAreaXYSpec | IMarkAreaCoordinateSpec | IMarkerPositionsSpec) & IMarkAreaTheme;
7
+ export type IMarkAreaSpec = IMarkerSpec & (IMarkAreaXSpec | IMarkAreaYSpec | IMarkAreaXYSpec | IMarkAreaAngleSpec | IMarkAreaRadiusSpec | IMarkAreaAngleRadiusSpec | IMarkAreaCoordinateSpec | IMarkerPositionsSpec) & IMarkAreaTheme & BaseMarkerAnimation<CommonMarkAreaAnimationType>;
7
8
  export interface IMarkAreaXSpec extends IMarkerCrossSeriesSpec {
8
9
  x: IDataPos | IDataPosCallback;
9
10
  x1: IDataPos | IDataPosCallback;
@@ -18,6 +19,20 @@ export interface IMarkAreaXYSpec extends IMarkerCrossSeriesSpec {
18
19
  y: IDataPos | IDataPosCallback;
19
20
  y1: IDataPos | IDataPosCallback;
20
21
  }
22
+ export interface IMarkAreaAngleSpec extends IMarkerCrossSeriesSpec {
23
+ angle: IDataPos | IDataPosCallback;
24
+ angle1: IDataPos | IDataPosCallback;
25
+ }
26
+ export interface IMarkAreaRadiusSpec extends IMarkerCrossSeriesSpec {
27
+ radius: IDataPos | IDataPosCallback;
28
+ radius1: IDataPos | IDataPosCallback;
29
+ }
30
+ export interface IMarkAreaAngleRadiusSpec extends IMarkerCrossSeriesSpec {
31
+ angle: IDataPos | IDataPosCallback;
32
+ angle1: IDataPos | IDataPosCallback;
33
+ radius: IDataPos | IDataPosCallback;
34
+ radius1: IDataPos | IDataPosCallback;
35
+ }
21
36
  export type IMarkAreaCoordinateSpec = {
22
37
  coordinates: IDataPointSpec[];
23
38
  coordinatesOffset?: OffsetPoint[];
@@ -1,11 +1,9 @@
1
- import type { IMarkAreaLabelPosition } from '@visactor/vrender-components';
2
- import type { IPolygonMarkSpec } from '../../../../typings';
3
- import type { IMarkerLabelWithoutRefSpec } from '../../interface';
1
+ import type { IMarkAreaLabelPosition, IMarkCommonArcLabelPosition } from '@visactor/vrender-components';
2
+ import type { IArcMarkSpec, IPolygonMarkSpec } from '../../../../typings';
3
+ import type { IMarkerLabelWithoutRefSpec, IMarkerState } from '../../interface';
4
4
  export interface IMarkAreaTheme {
5
- area?: {
6
- style?: IPolygonMarkSpec;
7
- };
5
+ area?: Partial<IMarkerState<IPolygonMarkSpec | IArcMarkSpec>>;
8
6
  label?: {
9
- position?: keyof typeof IMarkAreaLabelPosition;
7
+ position?: keyof typeof IMarkAreaLabelPosition | IMarkCommonArcLabelPosition;
10
8
  } & IMarkerLabelWithoutRefSpec;
11
9
  }
@@ -0,0 +1,25 @@
1
+ import { ComponentTypeEnum } from '../../interface/type';
2
+ import type { MarkArcAreaAttrs, MarkAreaAttrs } from '@visactor/vrender-components';
3
+ import { MarkArcArea as MarkArcAreaComponent, MarkArea as MarkAreaComponent } from '@visactor/vrender-components';
4
+ import type { IPoint, IPolarPoint } from '../../../typings';
5
+ import { BaseMarkArea } from './base-mark-area';
6
+ import type { IMarkProcessOptions } from '../interface';
7
+ export declare class PolarMarkArea extends BaseMarkArea {
8
+ static type: ComponentTypeEnum;
9
+ type: ComponentTypeEnum;
10
+ name: string;
11
+ static coordinateType: string;
12
+ coordinateType: string;
13
+ protected _markerComponent: MarkArcAreaComponent;
14
+ protected _newMarkAreaComponent(attr: MarkArcAreaAttrs | MarkAreaAttrs): MarkArcAreaComponent | MarkAreaComponent;
15
+ protected _computePointsAttr(): {
16
+ points?: IPoint[] | IPolarPoint[];
17
+ innerRadius?: number;
18
+ outerRadius?: number;
19
+ startAngle?: number;
20
+ endAngle?: number;
21
+ center?: IPoint;
22
+ };
23
+ protected _computeOptions(): IMarkProcessOptions;
24
+ }
25
+ export declare const registerPolarMarkArea: () => void;
@@ -0,0 +1,18 @@
1
+ import type { IMarkLine, IMarkLineSpec } from './interface';
2
+ import type { MarkArcLineAttrs, MarkLineAttrs } from '@visactor/vrender-components';
3
+ import type { MarkLine as MarkLineComponent, MarkArcLine as MarkArcLineComponent } from '@visactor/vrender-components';
4
+ import { BaseMarker } from '../base-marker';
5
+ import type { IGroup } from '@visactor/vrender-core';
6
+ import type { IMarkProcessOptions } from '../interface';
7
+ export declare abstract class BaseMarkLine extends BaseMarker<IMarkLineSpec> implements IMarkLine {
8
+ static specKey: string;
9
+ specKey: string;
10
+ layoutZIndex: number;
11
+ protected abstract _newMarkLineComponent(attr: MarkLineAttrs | MarkArcLineAttrs): MarkLineComponent | MarkArcLineComponent;
12
+ protected abstract _computePointsAttr(): any;
13
+ protected abstract _computeOptions(): IMarkProcessOptions;
14
+ static _getMarkerCoordinateType(markerSpec: any): string;
15
+ protected _createMarkerComponent(): IGroup;
16
+ protected _markerLayout(): void;
17
+ protected _initDataView(): void;
18
+ }
@@ -0,0 +1,20 @@
1
+ import { ComponentTypeEnum } from '../../interface/type';
2
+ import { type MarkLineAttrs, MarkLine as MarkLineComponent } from '@visactor/vrender-components';
3
+ import type { IMarkProcessOptions } from '../interface';
4
+ import type { IPoint } from '../../../typings';
5
+ import { BaseMarkLine } from './base-mark-line';
6
+ export declare class CartesianMarkLine extends BaseMarkLine {
7
+ static type: ComponentTypeEnum;
8
+ type: ComponentTypeEnum;
9
+ name: string;
10
+ static coordinateType: string;
11
+ coordinateType: string;
12
+ protected _markerComponent: MarkLineComponent;
13
+ protected _newMarkLineComponent(attr: MarkLineAttrs): MarkLineComponent;
14
+ protected _computePointsAttr(): {
15
+ points: IPoint[];
16
+ };
17
+ protected _markerLayout(): void;
18
+ protected _computeOptions(): IMarkProcessOptions;
19
+ }
20
+ export declare const registerMarkLine: () => void;
@@ -1,2 +1,3 @@
1
- export * from './mark-line';
1
+ export * from './cartesian-mark-line';
2
+ export * from './polar-mark-line';
2
3
  export * from './interface';
@@ -1,10 +1,11 @@
1
1
  import type { IComponent } from '../../../interface';
2
- import type { IAggrType, IMarkerPositionsSpec, IDataPointSpec, IMarkerSpec, IDataPos, IDataPosCallback, IMarkerLabelSpec, IMarkerCrossSeriesSpec, OffsetPoint } from '../../interface';
2
+ import type { IAggrType, IMarkerPositionsSpec, IDataPointSpec, IMarkerSpec, IDataPos, IDataPosCallback, IMarkerLabelSpec, IMarkerCrossSeriesSpec, OffsetPoint, MarkerStateValue, MarkerStateCallback } from '../../interface';
3
3
  import type { IRegressType } from '../../mark-area/interface';
4
4
  import type { IMarkLineTheme } from './theme';
5
5
  import type { ILineMarkSpec, IPoint } from '../../../../typings';
6
+ import type { BaseMarkerAnimation, MarkCommonLineAnimationType } from '@visactor/vrender-components/es/marker/type';
6
7
  export type IMarkLine = IComponent;
7
- export type IMarkLineSpec = (IMarkerSpec & (IMarkLineXSpec | IMarkLineYSpec | IMarkLineXYSpec | IMarkLineXYY1Spec | IMarkLineYXX1Spec | IMarkLineCoordinateSpec | IMarkerPositionsSpec) & IMarkLineTheme) | IStepMarkLineSpec;
8
+ export type IMarkLineSpec = (IMarkerSpec & (IMarkLineXSpec | IMarkLineYSpec | IMarkLineXYSpec | IMarkLineXYY1Spec | IMarkLineYXX1Spec | IMarkLineAngleSpec | IMarkLineRadiusSpec | IMarkLineAngRadRad1Spec | IMarkLineRadAngAng1Spec | IMarkLineAngRadSpec | IMarkLineCoordinateSpec | IMarkerPositionsSpec) & IMarkLineTheme & BaseMarkerAnimation<MarkCommonLineAnimationType>) | (IStepMarkLineSpec & BaseMarkerAnimation<MarkCommonLineAnimationType>);
8
9
  export interface IMarkLineXSpec extends IMarkerCrossSeriesSpec {
9
10
  x: IDataPos | IDataPosCallback;
10
11
  }
@@ -27,6 +28,28 @@ export interface IMarkLineXYSpec extends IMarkerCrossSeriesSpec {
27
28
  x1: IDataPos | IDataPosCallback;
28
29
  y1: IDataPos | IDataPosCallback;
29
30
  }
31
+ export interface IMarkLineAngleSpec extends IMarkerCrossSeriesSpec {
32
+ angle: IDataPos | IDataPosCallback;
33
+ }
34
+ export interface IMarkLineRadiusSpec extends IMarkerCrossSeriesSpec {
35
+ radius: IDataPos | IDataPosCallback;
36
+ }
37
+ export interface IMarkLineAngRadRad1Spec extends IMarkerCrossSeriesSpec {
38
+ angle: IDataPos | IDataPosCallback;
39
+ radius: IDataPos | IDataPosCallback;
40
+ radius1: IDataPos | IDataPosCallback;
41
+ }
42
+ export interface IMarkLineRadAngAng1Spec extends IMarkerCrossSeriesSpec {
43
+ angle: IDataPos | IDataPosCallback;
44
+ angle1: IDataPos | IDataPosCallback;
45
+ radius: IDataPos | IDataPosCallback;
46
+ }
47
+ export interface IMarkLineAngRadSpec extends IMarkerCrossSeriesSpec {
48
+ angle: IDataPos | IDataPosCallback;
49
+ angle1: IDataPos | IDataPosCallback;
50
+ radius: IDataPos | IDataPosCallback;
51
+ radius1: IDataPos | IDataPosCallback;
52
+ }
30
53
  export type IMarkLineCoordinateSpec = {
31
54
  coordinates: IDataPointSpec[];
32
55
  coordinatesOffset?: OffsetPoint[];
@@ -47,6 +70,7 @@ export type IStepMarkLineSpec = IMarkerSpec & {
47
70
  multiSegment?: boolean;
48
71
  mainSegmentIndex?: number;
49
72
  style?: ILineMarkSpec | ILineMarkSpec[];
73
+ state?: Record<MarkerStateValue, ILineMarkSpec | ILineMarkSpec[] | MarkerStateCallback<ILineMarkSpec | ILineMarkSpec[]>>;
50
74
  };
51
75
  } & Omit<IMarkLineTheme, 'label' | 'line'> & ({
52
76
  coordinates: [IDataPointSpec, IDataPointSpec];
@@ -1,12 +1,10 @@
1
- import type { IMarkLineLabelPosition } from '@visactor/vrender-components';
2
- import type { ILineMarkSpec } from '../../../../typings';
3
- import type { IMarkerLabelSpec, IMarkerSymbol } from '../../interface';
1
+ import type { IMarkCommonArcLabelPosition, IMarkLineLabelPosition } from '@visactor/vrender-components';
2
+ import type { IArcMarkSpec, ILineMarkSpec } from '../../../../typings';
3
+ import type { IMarkerLabelSpec, IMarkerState, IMarkerSymbol } from '../../interface';
4
4
  export interface IMarkLineTheme {
5
- line?: {
6
- style?: ILineMarkSpec;
7
- };
5
+ line?: Partial<IMarkerState<ILineMarkSpec | IArcMarkSpec>>;
8
6
  label?: {
9
- position?: keyof typeof IMarkLineLabelPosition;
7
+ position?: keyof typeof IMarkLineLabelPosition | IMarkCommonArcLabelPosition;
10
8
  } & IMarkerLabelSpec;
11
9
  startSymbol?: IMarkerSymbol;
12
10
  endSymbol?: IMarkerSymbol;
@@ -0,0 +1,23 @@
1
+ import { ComponentTypeEnum } from '../../interface/type';
2
+ import type { MarkArcLineAttrs, MarkLineAttrs } from '@visactor/vrender-components';
3
+ import { MarkArcLine as MarkArcLineComponent, MarkLine as MarkLineComponent } from '@visactor/vrender-components';
4
+ import type { IPoint } from '../../../typings';
5
+ import { BaseMarkLine } from './base-mark-line';
6
+ export declare class PolarMarkLine extends BaseMarkLine {
7
+ static type: ComponentTypeEnum;
8
+ type: ComponentTypeEnum;
9
+ name: string;
10
+ static coordinateType: string;
11
+ coordinateType: string;
12
+ protected _markerComponent: MarkArcLineComponent;
13
+ protected _newMarkLineComponent(attr: MarkArcLineAttrs | MarkLineAttrs): MarkArcLineComponent | MarkLineComponent;
14
+ protected _computePointsAttr(): {
15
+ points?: IPoint[];
16
+ radius?: number;
17
+ startAngle?: number;
18
+ endAngle?: number;
19
+ center?: IPoint;
20
+ };
21
+ protected _computeOptions(): any;
22
+ }
23
+ export declare const registerPolarMarkLine: () => void;
@@ -0,0 +1,17 @@
1
+ import type { IMarkPoint, IMarkPointSpec } from './interface';
2
+ import { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';
3
+ import { BaseMarker } from '../base-marker';
4
+ import type { IGroup } from '@visactor/vrender-core';
5
+ import type { IMarkProcessOptions } from '../interface';
6
+ export declare abstract class BaseMarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {
7
+ static specKey: string;
8
+ specKey: string;
9
+ layoutZIndex: number;
10
+ protected _markerComponent: MarkPointComponent;
11
+ protected abstract _computePointsAttr(): any;
12
+ protected abstract _computeOptions(): IMarkProcessOptions;
13
+ static _getMarkerCoordinateType(markerSpec: any): string;
14
+ protected _createMarkerComponent(): IGroup;
15
+ protected _markerLayout(): void;
16
+ protected _initDataView(): void;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { ComponentTypeEnum } from '../../interface/type';
2
+ import type { IPoint } from '../../../typings';
3
+ import { BaseMarkPoint } from './base-mark-point';
4
+ import type { IMarkProcessOptions } from '../interface';
5
+ export declare class CartesianMarkPoint extends BaseMarkPoint {
6
+ static type: ComponentTypeEnum;
7
+ type: ComponentTypeEnum;
8
+ name: string;
9
+ static coordinateType: string;
10
+ coordinateType: string;
11
+ protected _computePointsAttr(): {
12
+ point: IPoint;
13
+ };
14
+ protected _computeOptions(): IMarkProcessOptions;
15
+ }
16
+ export declare const registerMarkPoint: () => void;