@visactor/vchart-types 2.0.10-alpha.0 → 2.0.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.
@@ -15,6 +15,7 @@ import type { IParserOptions } from '@visactor/vdataset';
15
15
  import type { IBoundsLike, Maybe } from '@visactor/vutils';
16
16
  import { CompilableBase } from '../../compile/compilable-base';
17
17
  import type { IGlobalScale } from '../../scale/interface';
18
+ import type { IAxis } from '../../component/axis/interface/common';
18
19
  import type { IMorphConfig } from '../../animation/spec';
19
20
  import type { IInteraction } from '../../interaction/interface/common';
20
21
  export declare class BaseChart<T extends IChartSpec> extends CompilableBase implements IChart {
@@ -161,5 +162,6 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
161
162
  }): IMarkGraphic[];
162
163
  protected _setStateInDatum(stateKey: string, d: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
163
164
  setDimensionIndex(value: StringOrNumber, opt: DimensionIndexOption): void;
165
+ showCrosshair(cb: (axis: IAxis) => false | string | number): void;
164
166
  getColorScheme(): any;
165
167
  }
@@ -14,6 +14,7 @@ import type { DataView } from '@visactor/vdataset';
14
14
  import type { IGlobalScale } from '../../scale/interface';
15
15
  import type { IMorphConfig } from '../../animation/spec';
16
16
  import type { IMarkGraphic } from '../../mark/interface/common';
17
+ import type { IAxis } from '../../component/axis/interface';
17
18
  export type DimensionIndexOption = {
18
19
  filter?: (cmp: IComponent) => boolean;
19
20
  tooltip?: boolean;
@@ -95,6 +96,7 @@ export interface IChart extends ICompilable {
95
96
  setCurrentTheme: () => void;
96
97
  getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;
97
98
  setDimensionIndex: (value: StringOrNumber, opt: DimensionIndexOption) => void;
99
+ showCrosshair: (cb: (axis: IAxis) => false | string | number) => void;
98
100
  filterGraphicsByDatum: (datum: MaybeArray<Datum> | null, opt?: {
99
101
  filter?: (series: ISeries, mark: IMark) => boolean;
100
102
  region?: IRegionQuerier;
@@ -22,6 +22,7 @@ import { Compiler } from '../compile/compiler';
22
22
  import type { IMorphConfig } from '../animation/spec';
23
23
  import type { DataLinkAxis, DataLinkSeries, IGlobalConfig, IVChart, IVChartRenderOption } from './interface';
24
24
  import { InstanceManager } from './instance-manager';
25
+ import type { IAxis } from '../component/axis';
25
26
  export declare class VChart implements IVChart {
26
27
  readonly id: number;
27
28
  static useRegisters(comps: (() => void)[]): void;
@@ -180,6 +181,7 @@ export declare class VChart implements IVChart {
180
181
  getComponents(): import("../component/interface").IComponent[];
181
182
  getScale(scaleId: string): import("@visactor/vscale").IBaseScale;
182
183
  setDimensionIndex(value: StringOrNumber, opt?: DimensionIndexOption): void;
184
+ showCrosshair(cb: (axis: IAxis) => false | string | number): void;
183
185
  stopAnimation(): void;
184
186
  reRunNormalAnimation(): void;
185
187
  pauseAnimation(): void;
@@ -154,7 +154,7 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
154
154
  };
155
155
  protected _getEncoderOfStyle: (stateName: string, style: Partial<IAttrs<T>>) => Record<string, (datum: Datum) => any>;
156
156
  protected _setGraphicFromMarkConfig: (g: IMarkGraphic) => void;
157
- protected _setStateOfGraphic: (g: IMarkGraphic) => void;
157
+ protected _setStateOfGraphic: (g: IMarkGraphic, hasAnimation?: boolean) => void;
158
158
  protected _addProgressiveGraphic(parent: IGroup, g: IMarkGraphic): void;
159
159
  protected _runEncoder(graphics: IMarkGraphic[], noGroupEncode?: boolean): void;
160
160
  protected _runApplyGraphic(graphics: IMarkGraphic[]): void;
@@ -1,5 +1,5 @@
1
1
  import type { IModelEvaluateOption, IModelInitOption } from '../../model/interface';
2
- import type { BoxPlotShaftShape, IOutlierMarkSpec } from '../../typings';
2
+ import type { BoxPlotShaftShape, IOutlierMarkSpec, Datum, DirectionType } from '../../typings';
3
3
  import { CartesianSeries } from '../cartesian/cartesian';
4
4
  import type { SeriesMarkMap } from '../interface';
5
5
  import { SeriesTypeEnum } from '../interface/type';
@@ -15,6 +15,7 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
15
15
  boxPlot: import("./interface").IBoxPlotSeriesTheme;
16
16
  };
17
17
  static readonly mark: SeriesMarkMap;
18
+ protected _bandPosition: number;
18
19
  protected _minField: string;
19
20
  getMinField(): string;
20
21
  protected _maxField: string;
@@ -51,6 +52,7 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
51
52
  compileData(): void;
52
53
  init(option: IModelInitOption): void;
53
54
  private _getMarkWidth;
55
+ protected _getPosition(direction: DirectionType, datum: Datum): number;
54
56
  onLayoutEnd(): void;
55
57
  private _initAnimationSpec;
56
58
  initAnimation(): void;
@@ -1,6 +1,6 @@
1
1
  import type { IAnimationSpec } from '../../animation/spec';
2
2
  import type { IMarkProgressiveConfig } from '../../mark/interface';
3
- import type { DirectionType, IBoxPlotMarkSpec, IOutlierMarkSpec, IMarkSpec, IMarkTheme } from '../../typings';
3
+ import type { DirectionType, IBoxPlotMarkSpec, IOutlierMarkSpec, IMarkSpec, IMarkTheme, ISymbolMarkSpec } from '../../typings';
4
4
  import type { ICartesianSeriesSpec, ICartesianSeriesTheme } from '../cartesian/interface';
5
5
  import type { SeriesMarkNameEnum } from '../interface/type';
6
6
  export interface IBoxPlotSeriesSpec extends Omit<ICartesianSeriesSpec, 'xField' | 'yField' | 'direction'>, IAnimationSpec<SeriesMarkNameEnum.boxPlot, string>, IMarkProgressiveConfig {
@@ -13,9 +13,14 @@ export interface IBoxPlotSeriesSpec extends Omit<ICartesianSeriesSpec, 'xField'
13
13
  q1Field?: string;
14
14
  medianField?: string;
15
15
  q3Field?: string;
16
- [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;
17
16
  outliersField?: string;
17
+ [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;
18
+ [SeriesMarkNameEnum.outlier]?: IMarkSpec<ISymbolMarkSpec>;
18
19
  outliersStyle?: IOutlierMarkSpec;
20
+ boxWidth?: number | string;
21
+ boxMinWidth?: number | string;
22
+ boxMaxWidth?: number | string;
23
+ boxGapInGroup?: number | string | (number | string)[];
19
24
  }
20
25
  export interface IBoxPlotSeriesTheme extends ICartesianSeriesTheme {
21
26
  [SeriesMarkNameEnum.boxPlot]?: Partial<IMarkTheme<IBoxPlotMarkSpec>>;
@@ -159,8 +159,8 @@ export interface IRectMarkSpec extends IFillMarkSpec {
159
159
  }
160
160
  export interface IBoxPlotMarkSpec extends ICommonSpec {
161
161
  lineWidth?: number;
162
- boxWidth?: number;
163
- shaftWidth?: number;
162
+ boxWidth?: number | string;
163
+ shaftWidth?: number | string;
164
164
  shaftShape?: BoxPlotShaftShape;
165
165
  boxFill?: string;
166
166
  shaftFillOpacity?: number;
@@ -271,7 +271,7 @@ export type GradientType = 'linear' | 'radial' | 'conical';
271
271
  export type IGradient = IGradientLinear | IGradientRadial | IGradientConical;
272
272
  export type LineStrokeCap = 'butt' | 'round' | 'square';
273
273
  export type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';
274
- export type BoxPlotShaftShape = 'line' | 'bar';
274
+ export type BoxPlotShaftShape = 'line' | 'bar' | 'filled-line';
275
275
  export interface IThresholdStyle extends IVisualSpecStyle<number, string> {
276
276
  domain: number[];
277
277
  field: string;