@visactor/vchart-types 2.0.20-alpha.7 → 2.0.21

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.
@@ -85,6 +85,18 @@ export interface ICommonSpec {
85
85
  html?: IMarkHtmlSpec;
86
86
  [key: string]: any;
87
87
  }
88
+ export type BackgroundSizing = 'cover' | 'contain' | 'fill' | 'auto';
89
+ export type BackgroundRepeatMode = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
90
+ export type BackgroundSizingShorthand = 'no-repeat-cover' | 'no-repeat-contain' | 'no-repeat-fill' | 'no-repeat-auto';
91
+ export type BackgroundMode = BackgroundRepeatMode | BackgroundSizingShorthand;
92
+ export type BackgroundPositionHorizontalKeyword = 'left' | 'center' | 'right';
93
+ export type BackgroundPositionVerticalKeyword = 'top' | 'center' | 'bottom';
94
+ export type BackgroundPositionKeyword = BackgroundPositionHorizontalKeyword | BackgroundPositionVerticalKeyword;
95
+ export type BackgroundPositionPercent = `${number}%`;
96
+ export type BackgroundPositionValue = number | BackgroundPositionKeyword | BackgroundPositionPercent;
97
+ export type BackgroundPositionPreset = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
98
+ export type BackgroundPosition = BackgroundPositionKeyword | BackgroundPositionPreset | [BackgroundPositionValue, BackgroundPositionValue];
99
+ export type ImageMode = BackgroundSizing;
88
100
  export interface IFillMarkSpec extends ICommonSpec {
89
101
  fill?: VisualType<string> | IGradient | false | IColorKey;
90
102
  shadowBlur?: number;
@@ -93,12 +105,13 @@ export interface IFillMarkSpec extends ICommonSpec {
93
105
  shadowOffsetY?: number;
94
106
  fillOpacity?: number;
95
107
  background?: IColor | HTMLImageElement | HTMLCanvasElement | null;
96
- backgroundMode?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
108
+ backgroundMode?: BackgroundMode;
97
109
  backgroundFit?: boolean;
98
110
  backgroundKeepAspectRatio?: boolean;
99
111
  backgroundScale?: number;
100
112
  backgroundOffsetX?: number;
101
113
  backgroundOffsetY?: number;
114
+ backgroundPosition?: BackgroundPosition;
102
115
  backgroundClip?: boolean;
103
116
  backgroundCornerRadius?: number | number[];
104
117
  backgroundOpacity?: number;
@@ -309,6 +322,11 @@ export interface IImageMarkSpec extends IFillMarkSpec {
309
322
  height?: number;
310
323
  repeatX?: IRepeatType;
311
324
  repeatY?: IRepeatType;
325
+ imageMode?: ImageMode;
326
+ imagePosition?: BackgroundPosition;
327
+ imageScale?: number;
328
+ imageOffsetX?: number;
329
+ imageOffsetY?: number;
312
330
  image?: string | HTMLImageElement | HTMLCanvasElement;
313
331
  }
314
332
  export type TextAlign = TextAlignType;