@wcardinal/wcardinal-ui 0.291.0 → 0.292.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 (26) hide show
  1. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +67 -46
  2. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +42 -16
  3. package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +6 -4
  4. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +8 -7
  5. package/dist/types/wcardinal/ui/d-chart-axis-x-datetime.d.ts +3 -2
  6. package/dist/types/wcardinal/ui/d-chart-axis-x.d.ts +3 -3
  7. package/dist/types/wcardinal/ui/d-chart-axis-y.d.ts +3 -3
  8. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +32 -14
  9. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  10. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  11. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +5 -5
  12. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  13. package/dist/wcardinal/ui/d-chart-axis-base.js +8 -5
  14. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  15. package/dist/wcardinal/ui/d-chart-axis-x-datetime.js.map +1 -1
  16. package/dist/wcardinal/ui/d-chart-axis-x.js.map +1 -1
  17. package/dist/wcardinal/ui/d-chart-axis-y.js.map +1 -1
  18. package/dist/wcardinal-ui-theme-dark.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-white.js +1 -1
  21. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  22. package/dist/wcardinal-ui.cjs.js +41 -25
  23. package/dist/wcardinal-ui.js +41 -25
  24. package/dist/wcardinal-ui.min.js +2 -2
  25. package/dist/wcardinal-ui.min.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { DChartAxisBaseOptions, DChartAxisBaseTickContainerOptions, DChartAxisBaseTickMajorGridlineOptions, DChartAxisBaseTickMajorOptions, DChartAxisBaseTickMinorOptions, DChartAxisBaseTickTextOptions, DThemeChartAxisBase } from "./d-chart-axis-base-options";
1
+ import { DChartAxisBaseOptions, DChartAxisBaseTickOptions, DChartAxisBaseTickMajorGridlineOptions, DChartAxisBaseTickMajorOptions, DChartAxisBaseTickMinorOptions, DChartAxisBaseTextDirectionOption, DChartAxisBaseTickTextOptions, DThemeChartAxisBase, DChartAxisBaseStrokeOptions } from "./d-chart-axis-base-options";
2
2
  import { DChartAxisPosition } from "./d-chart-axis-position";
3
3
  import { DChartAxisTickPosition } from "./d-chart-axis-tick-position";
4
4
  import { DChartCoordinateTickMajorStepFunction } from "./d-chart-coordinate-tick-major-step-function";
@@ -8,7 +8,7 @@ import { EShapePointsStyleOption } from "./shape/e-shape-points-styles";
8
8
  import { EShapeStrokeLike } from "./shape/e-shape-stroke";
9
9
  import { EShapeStrokeSide } from "./shape/e-shape-stroke-side";
10
10
  import { EShapeStrokeStyle } from "./shape/e-shape-stroke-style";
11
- import { EShapeTextLike } from "./shape/e-shape-text";
11
+ import { EShapeTextLike, EShapeTextStyle, EShapeTextWeight } from "./shape/e-shape-text";
12
12
  import { EShapeTextAlignLike } from "./shape/e-shape-text-align";
13
13
  import { EShapeTextDirection } from "./shape/e-shape-text-direction";
14
14
  import { EShapeTextOffsetLike } from "./shape/e-shape-text-offset";
@@ -16,6 +16,26 @@ import { EShapeTextOutlineLike } from "./shape/e-shape-text-outline";
16
16
  import { EShapeBarPosition } from "./shape/variant/e-shape-bar-position";
17
17
  import { DeepPartial } from "./util/deep-partial";
18
18
  import { NumberFormatter } from "./util/number-formatter";
19
+ import { NumberFormatterFunction } from "./util/number-formatter-function";
20
+ export interface DChartAxisBaseOptionParserText {
21
+ /** A format. Please refer to {@link NumberFormatter} for format details. */
22
+ format?: string | null;
23
+ /** A formatter function. */
24
+ formatter?: NumberFormatterFunction;
25
+ color?: number;
26
+ alpha?: number;
27
+ family?: string;
28
+ size?: number;
29
+ weight?: EShapeTextWeight;
30
+ align?: Partial<EShapeTextAlignLike>;
31
+ offset?: Partial<EShapeTextOffsetLike>;
32
+ style?: EShapeTextStyle;
33
+ outline?: Partial<EShapeTextOutlineLike>;
34
+ spacing?: Partial<EShapeTextOffsetLike>;
35
+ direction?: EShapeTextDirection;
36
+ padding?: Partial<EShapeTextOffsetLike>;
37
+ clipping?: boolean;
38
+ }
19
39
  export interface DChartAxisBaseOptionParserGridline {
20
40
  enable: boolean;
21
41
  style?: EShapePointsStyle;
@@ -29,7 +49,7 @@ export interface DChartAxisBaseOptionParserTickMajor {
29
49
  position: EShapeBarPosition;
30
50
  style?: EShapePointsStyle;
31
51
  stroke?: Partial<EShapeStrokeLike>;
32
- text?: DChartAxisBaseTickTextOptions;
52
+ text?: DChartAxisBaseOptionParserText;
33
53
  formatter?: NumberFormatter;
34
54
  gridline: DChartAxisBaseOptionParserGridline;
35
55
  }
@@ -40,10 +60,10 @@ export interface DChartAxisBaseOptionParserTickMinor {
40
60
  position: EShapeBarPosition;
41
61
  style?: EShapePointsStyle;
42
62
  stroke?: Partial<EShapeStrokeLike>;
43
- text?: DChartAxisBaseTickTextOptions;
63
+ text?: DChartAxisBaseOptionParserText;
44
64
  formatter?: NumberFormatter;
45
65
  }
46
- export interface DChartAxisBaseOptionParserTickContainer {
66
+ export interface DChartAxisBaseOptionParserTick {
47
67
  enable: boolean;
48
68
  major: DChartAxisBaseOptionParserTickMajor;
49
69
  minor: DChartAxisBaseOptionParserTickMinor;
@@ -52,56 +72,57 @@ export interface DChartAxisBaseOptionParserBar {
52
72
  style?: EShapePointsStyle;
53
73
  stroke?: Partial<EShapeStrokeLike>;
54
74
  }
55
- export declare class DChartAxisBaseOptionParser {
75
+ export declare class DChartAxisBaseOptionParser<THEME extends DThemeChartAxisBase = DThemeChartAxisBase, OPTIONS extends DChartAxisBaseOptions<THEME> = DChartAxisBaseOptions<THEME>> {
56
76
  protected _coordinateIndex: number;
57
77
  protected _position: DChartAxisPosition;
58
- protected _tick: DChartAxisBaseOptionParserTickContainer;
78
+ protected _tick: DChartAxisBaseOptionParserTick;
59
79
  protected _label: DeepPartial<EShapeTextLike> | undefined;
60
80
  protected _padding: number;
61
81
  protected _bar: DChartAxisBaseOptionParserBar;
62
- constructor(theme: DThemeChartAxisBase, options?: DChartAxisBaseOptions);
82
+ constructor(theme: THEME, options?: OPTIONS);
63
83
  get coordinateIndex(): number;
64
84
  get padding(): number;
65
85
  get position(): DChartAxisPosition;
66
86
  get bar(): DChartAxisBaseOptionParserBar;
67
- get tick(): DChartAxisBaseOptionParserTickContainer;
87
+ get tick(): DChartAxisBaseOptionParserTick;
68
88
  get label(): DeepPartial<EShapeTextLike> | undefined;
69
- protected toPosition(theme: DThemeChartAxisBase, options?: DChartAxisBaseOptions): DChartAxisPosition;
70
- protected toBar(theme: DThemeChartAxisBase, options?: DChartAxisBaseOptions): DChartAxisBaseOptionParserBar;
71
- protected toTickContainer(theme: DThemeChartAxisBase, options?: DChartAxisBaseOptions): DChartAxisBaseOptionParserTickContainer;
72
- protected toTickMajor(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickContainerOptions): DChartAxisBaseOptionParserTickMajor;
73
- protected toTickMajorGridline(theme: DThemeChartAxisBase, options: DChartAxisBaseTickMajorGridlineOptions | undefined, optionsStyle: EShapePointsStyleOption | undefined, optionsStroke: Partial<EShapeStrokeLike> | undefined): DChartAxisBaseOptionParserGridline;
89
+ protected toPosition(theme: THEME, options?: OPTIONS): DChartAxisPosition;
90
+ protected toBar(theme: THEME, options?: OPTIONS): DChartAxisBaseOptionParserBar;
91
+ protected toTick(theme: THEME, options?: OPTIONS): DChartAxisBaseOptionParserTick;
92
+ protected toTickMajor(theme: THEME, options?: DChartAxisBaseTickOptions): DChartAxisBaseOptionParserTickMajor;
93
+ protected toTickMajorGridline(theme: THEME, options: DChartAxisBaseTickMajorGridlineOptions | undefined, optionsStyle: EShapePointsStyleOption | undefined, optionsStroke: DChartAxisBaseStrokeOptions | undefined): DChartAxisBaseOptionParserGridline;
74
94
  protected toTickPosition(tickPosition: DChartAxisTickPosition | keyof typeof DChartAxisTickPosition): EShapeBarPosition;
75
- protected toTickMinor(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickContainerOptions): DChartAxisBaseOptionParserTickMinor;
76
- protected toBarStroke(theme: DThemeChartAxisBase, options?: Partial<EShapeStrokeLike>): Partial<EShapeStrokeLike>;
77
- protected toTickMajorStroke(theme: DThemeChartAxisBase, optionsA?: Partial<EShapeStrokeLike>, optionsB?: Partial<EShapeStrokeLike>): Partial<EShapeStrokeLike>;
78
- protected toTickMajorGridlineStroke(theme: DThemeChartAxisBase, optionsA?: Partial<EShapeStrokeLike>, optionsB?: Partial<EShapeStrokeLike>): Partial<EShapeStrokeLike>;
79
- protected toTickMinorStroke(theme: DThemeChartAxisBase, optionsA?: Partial<EShapeStrokeLike>, optionsB?: Partial<EShapeStrokeLike>): Partial<EShapeStrokeLike>;
80
- protected toStroke(optionsA: Partial<EShapeStrokeLike> | undefined, optionsB: Partial<EShapeStrokeLike> | undefined, enable: boolean | undefined, color: number | undefined, alpha: number | undefined, width: number | undefined, align: number | undefined, side: EShapeStrokeSide | undefined, style: EShapeStrokeStyle | undefined): Partial<EShapeStrokeLike>;
81
- protected toTickMajorFormatter(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickMajorOptions): NumberFormatter | undefined;
82
- protected toTickMajorText(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickTextOptions): DChartAxisBaseTickTextOptions | undefined;
83
- protected toTickMajorTextOutline(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
84
- protected toTickMajorTextAlign(theme: DThemeChartAxisBase, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
85
- protected toTickMajorTextOffset(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
86
- protected toTickMajorTextSpacing(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
87
- protected toTickMajorTextPadding(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
88
- protected toTickMajorTextDirection(theme: DThemeChartAxisBase, options?: EShapeTextDirection): EShapeTextDirection;
89
- protected toTickMajorTextColor(theme: DThemeChartAxisBase, options?: number): number | undefined;
90
- protected toTickMinorFormatter(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickMinorOptions): NumberFormatter | undefined;
91
- protected toTickMinorText(theme: DThemeChartAxisBase, options?: DChartAxisBaseTickTextOptions): DChartAxisBaseTickTextOptions | undefined;
92
- protected toTickMinorTextOutline(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
93
- protected toTickMinorTextAlign(theme: DThemeChartAxisBase, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
94
- protected toTickMinorTextOffset(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
95
- protected toTickMinorTextSpacing(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
96
- protected toTickMinorTextPadding(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
97
- protected toTickMinorTextDirection(theme: DThemeChartAxisBase, options?: EShapeTextDirection): EShapeTextDirection;
98
- protected toTickMinorTextColor(theme: DThemeChartAxisBase, options?: number): number | undefined;
99
- protected toLabel(theme: DThemeChartAxisBase, options?: DChartAxisBaseOptions): DeepPartial<EShapeTextLike> | undefined;
100
- protected toLabelOutline(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
101
- protected toLabelAlign(theme: DThemeChartAxisBase, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
102
- protected toLabelOffset(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
103
- protected toLabelSpacing(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
104
- protected toLabelPadding(theme: DThemeChartAxisBase, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
105
- protected toLabelDirection(theme: DThemeChartAxisBase, options?: EShapeTextDirection): EShapeTextDirection;
106
- protected toLabelColor(theme: DThemeChartAxisBase, options?: number): number | undefined;
95
+ protected toTickMinor(theme: THEME, options?: DChartAxisBaseTickOptions): DChartAxisBaseOptionParserTickMinor;
96
+ protected toBarStroke(theme: THEME, options?: DChartAxisBaseStrokeOptions): Partial<EShapeStrokeLike>;
97
+ protected toTickMajorStroke(theme: THEME, optionsA?: DChartAxisBaseStrokeOptions, optionsB?: DChartAxisBaseStrokeOptions): Partial<EShapeStrokeLike>;
98
+ protected toTickMajorGridlineStroke(theme: THEME, optionsA?: DChartAxisBaseStrokeOptions, optionsB?: DChartAxisBaseStrokeOptions): Partial<EShapeStrokeLike>;
99
+ protected toTickMinorStroke(theme: THEME, optionsA?: DChartAxisBaseStrokeOptions, optionsB?: DChartAxisBaseStrokeOptions): Partial<EShapeStrokeLike>;
100
+ protected toStroke(optionsA: DChartAxisBaseStrokeOptions | undefined, optionsB: DChartAxisBaseStrokeOptions | undefined, enable: boolean | undefined, color: number | undefined, alpha: number | undefined, width: number | undefined, align: number | undefined, side: EShapeStrokeSide | undefined, style: EShapeStrokeStyle | undefined): Partial<EShapeStrokeLike>;
101
+ protected toStrokeStyle(target?: EShapeStrokeStyle | keyof typeof EShapeStrokeStyle | Array<keyof typeof EShapeStrokeStyle>): EShapeStrokeStyle | undefined;
102
+ protected toTickMajorFormatter(theme: THEME, options?: DChartAxisBaseTickMajorOptions): NumberFormatter | undefined;
103
+ protected toTickMajorText(theme: THEME, options?: DChartAxisBaseTickTextOptions): DChartAxisBaseOptionParserText | undefined;
104
+ protected toTickMajorTextOutline(theme: THEME, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
105
+ protected toTickMajorTextAlign(theme: THEME, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
106
+ protected toTickMajorTextOffset(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
107
+ protected toTickMajorTextSpacing(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
108
+ protected toTickMajorTextPadding(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
109
+ protected toTickMajorTextDirection(theme: THEME, options?: DChartAxisBaseTextDirectionOption): EShapeTextDirection;
110
+ protected toTickMajorTextColor(theme: THEME, options?: number): number | undefined;
111
+ protected toTickMinorFormatter(theme: THEME, options?: DChartAxisBaseTickMinorOptions): NumberFormatter | undefined;
112
+ protected toTickMinorText(theme: THEME, options?: DChartAxisBaseTickTextOptions): DChartAxisBaseOptionParserText | undefined;
113
+ protected toTickMinorTextOutline(theme: THEME, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
114
+ protected toTickMinorTextAlign(theme: THEME, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
115
+ protected toTickMinorTextOffset(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
116
+ protected toTickMinorTextSpacing(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
117
+ protected toTickMinorTextPadding(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
118
+ protected toTickMinorTextDirection(theme: THEME, options?: DChartAxisBaseTextDirectionOption): EShapeTextDirection;
119
+ protected toTickMinorTextColor(theme: THEME, options?: number): number | undefined;
120
+ protected toLabel(theme: THEME, options?: OPTIONS): DeepPartial<EShapeTextLike> | undefined;
121
+ protected toLabelOutline(theme: THEME, options?: Partial<EShapeTextOutlineLike>): Partial<EShapeTextOutlineLike> | undefined;
122
+ protected toLabelAlign(theme: THEME, options?: Partial<EShapeTextAlignLike>): Partial<EShapeTextAlignLike> | undefined;
123
+ protected toLabelOffset(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
124
+ protected toLabelSpacing(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike> | undefined;
125
+ protected toLabelPadding(theme: THEME, options?: Partial<EShapeTextOffsetLike>): Partial<EShapeTextOffsetLike>;
126
+ protected toLabelDirection(theme: THEME, options?: DChartAxisBaseTextDirectionOption): EShapeTextDirection;
127
+ protected toLabelColor(theme: THEME, options?: number): number | undefined;
107
128
  }
@@ -5,18 +5,19 @@ import { DChartCoordinateTickMajorStepFunction } from "./d-chart-coordinate-tick
5
5
  import { DChartCoordinateTickMinorStepFunction } from "./d-chart-coordinate-tick-minor-step-function";
6
6
  import { EShapePointsStyle } from "./shape/e-shape-points-style";
7
7
  import { EShapePointsStyleOption } from "./shape/e-shape-points-styles";
8
- import { EShapeStrokeLike } from "./shape/e-shape-stroke";
9
8
  import { EShapeStrokeSide } from "./shape/e-shape-stroke-side";
10
9
  import { EShapeStrokeStyle } from "./shape/e-shape-stroke-style";
11
- import { EShapeTextLike, EShapeTextStyle, EShapeTextWeight } from "./shape/e-shape-text";
10
+ import { EShapeTextStyle, EShapeTextWeight } from "./shape/e-shape-text";
12
11
  import { EShapeTextAlignLike } from "./shape/e-shape-text-align";
13
12
  import { EShapeTextAlignHorizontal } from "./shape/e-shape-text-align-horizontal";
14
13
  import { EShapeTextAlignVertical } from "./shape/e-shape-text-align-vertical";
15
14
  import { EShapeTextDirection } from "./shape/e-shape-text-direction";
16
15
  import { EShapeTextOffsetLike } from "./shape/e-shape-text-offset";
17
16
  import { EShapeTextOutlineLike } from "./shape/e-shape-text-outline";
18
- import { DeepPartial } from "./util/deep-partial";
19
17
  import { NumberFormatterFunction } from "./util/number-formatter-function";
18
+ export declare type DChartAxisBaseTextWeightOption = EShapeTextWeight | keyof typeof EShapeTextWeight;
19
+ export declare type DChartAxisBaseTextStyleOption = EShapeTextStyle | keyof typeof EShapeTextStyle;
20
+ export declare type DChartAxisBaseTextDirectionOption = EShapeTextDirection | keyof typeof EShapeTextDirection;
20
21
  export interface DChartAxisBaseTickTextOptions {
21
22
  /** A format. Please refer to {@link NumberFormatter} for format details. */
22
23
  format?: string | null;
@@ -26,20 +27,29 @@ export interface DChartAxisBaseTickTextOptions {
26
27
  alpha?: number;
27
28
  family?: string;
28
29
  size?: number;
29
- weight?: EShapeTextWeight;
30
+ weight?: DChartAxisBaseTextWeightOption;
30
31
  align?: Partial<EShapeTextAlignLike>;
31
32
  offset?: Partial<EShapeTextOffsetLike>;
32
- style?: EShapeTextStyle;
33
+ style?: DChartAxisBaseTextStyleOption;
33
34
  outline?: Partial<EShapeTextOutlineLike>;
34
35
  spacing?: Partial<EShapeTextOffsetLike>;
35
- direction?: EShapeTextDirection;
36
+ direction?: DChartAxisBaseTextDirectionOption;
36
37
  padding?: Partial<EShapeTextOffsetLike>;
37
38
  clipping?: boolean;
38
39
  }
40
+ export interface DChartAxisBaseStrokeOptions {
41
+ enable?: boolean;
42
+ color?: number;
43
+ alpha?: number;
44
+ width?: number;
45
+ align?: number;
46
+ side?: EShapeStrokeSide;
47
+ style?: EShapeStrokeStyle | keyof typeof EShapeStrokeStyle | Array<keyof typeof EShapeStrokeStyle>;
48
+ }
39
49
  export interface DChartAxisBaseTickMajorGridlineOptions {
40
50
  enable?: boolean;
41
51
  style?: EShapePointsStyleOption;
42
- stroke?: Partial<EShapeStrokeLike>;
52
+ stroke?: DChartAxisBaseStrokeOptions;
43
53
  }
44
54
  export declare type DChartAxisTickPositionOption = DChartAxisTickPosition | keyof typeof DChartAxisTickPosition;
45
55
  export interface DChartAxisBaseTickMajorOptions {
@@ -49,7 +59,7 @@ export interface DChartAxisBaseTickMajorOptions {
49
59
  size?: number;
50
60
  position?: DChartAxisTickPositionOption;
51
61
  style?: EShapePointsStyleOption;
52
- stroke?: Partial<EShapeStrokeLike>;
62
+ stroke?: DChartAxisBaseStrokeOptions;
53
63
  text?: DChartAxisBaseTickTextOptions;
54
64
  gridline?: DChartAxisBaseTickMajorGridlineOptions;
55
65
  }
@@ -59,25 +69,41 @@ export interface DChartAxisBaseTickMinorOptions {
59
69
  size?: number;
60
70
  position?: DChartAxisTickPositionOption;
61
71
  style?: EShapePointsStyleOption;
62
- stroke?: Partial<EShapeStrokeLike>;
72
+ stroke?: DChartAxisBaseStrokeOptions;
63
73
  text?: DChartAxisBaseTickTextOptions;
64
74
  }
65
- export interface DChartAxisBaseTickContainerOptions {
75
+ export interface DChartAxisBaseTickOptions {
66
76
  enable?: boolean;
67
77
  position?: DChartAxisTickPositionOption;
68
78
  style?: EShapePointsStyleOption;
69
- stroke?: Partial<EShapeStrokeLike>;
79
+ stroke?: DChartAxisBaseStrokeOptions;
70
80
  major?: DChartAxisBaseTickMajorOptions;
71
81
  minor?: DChartAxisBaseTickMinorOptions;
72
82
  }
73
- export interface DChartAxisBaseOptions extends DChartAxisOptions {
74
- tick?: DChartAxisBaseTickContainerOptions;
75
- label?: DeepPartial<EShapeTextLike>;
83
+ export interface DChartAxisBaseLabelOptions {
84
+ value?: string;
85
+ color?: number;
86
+ alpha?: number;
87
+ family?: string;
88
+ size?: number;
89
+ weight?: DChartAxisBaseTextWeightOption;
90
+ align?: Partial<EShapeTextAlignLike>;
91
+ offset?: Partial<EShapeTextOffsetLike>;
92
+ style?: DChartAxisBaseTextStyleOption;
93
+ outline?: Partial<EShapeTextOutlineLike>;
94
+ spacing?: Partial<EShapeTextOffsetLike>;
95
+ direction?: DChartAxisBaseTextDirectionOption;
96
+ padding?: Partial<EShapeTextOffsetLike>;
97
+ clipping?: boolean;
98
+ }
99
+ export interface DChartAxisBaseOptions<THEME extends DThemeChartAxisBase> extends DChartAxisOptions {
100
+ tick?: DChartAxisBaseTickOptions;
101
+ label?: DChartAxisBaseLabelOptions;
76
102
  style?: EShapePointsStyle;
77
- stroke?: Partial<EShapeStrokeLike>;
103
+ stroke?: DChartAxisBaseStrokeOptions;
78
104
  coordinate?: number;
79
105
  padding?: number;
80
- theme?: DThemeChartAxisBase;
106
+ theme?: THEME;
81
107
  }
82
108
  export interface DThemeChartAxisBase {
83
109
  getPosition(): DChartAxisPosition;
@@ -9,7 +9,9 @@ import { DChartCoordinate } from "./d-chart-coordinate";
9
9
  import { DChartCoordinateTickMajorStepFunction } from "./d-chart-coordinate-tick-major-step-function";
10
10
  import { DChartCoordinateTickMinorStepFunction } from "./d-chart-coordinate-tick-minor-step-function";
11
11
  import { EShape } from "./shape/e-shape";
12
- export declare class DChartAxisBaseTickContainer<CHART extends DBase> implements DChartAxisTickContainer<CHART> {
12
+ export interface DChartAxisBaseTickContainerOptions {
13
+ }
14
+ export declare class DChartAxisBaseTickContainer<CHART extends DBase, OPTIONS extends DChartAxisBaseTickContainerOptions> implements DChartAxisTickContainer<CHART> {
13
15
  protected _parser: DChartAxisBaseOptionParser;
14
16
  protected _container?: DChartAxisContainer<CHART>;
15
17
  protected _index: number;
@@ -17,11 +19,11 @@ export declare class DChartAxisBaseTickContainer<CHART extends DBase> implements
17
19
  protected _minor: DChartAxisTickMinor<CHART>;
18
20
  protected _majorTicks: number[];
19
21
  protected _minorTicks: number[];
20
- constructor(parser: DChartAxisBaseOptionParser);
22
+ constructor(parser: DChartAxisBaseOptionParser, options?: OPTIONS);
21
23
  get major(): DChartAxisTickMajor<CHART>;
22
- protected newMajor(parser: DChartAxisBaseOptionParser): DChartAxisTickMajor<CHART>;
24
+ protected newMajor(parser: DChartAxisBaseOptionParser, options?: OPTIONS): DChartAxisTickMajor<CHART>;
23
25
  get minor(): DChartAxisTickMinor<CHART>;
24
- protected newMinor(parser: DChartAxisBaseOptionParser): DChartAxisTickMinor<CHART>;
26
+ protected newMinor(parser: DChartAxisBaseOptionParser, options?: OPTIONS): DChartAxisTickMinor<CHART>;
25
27
  bind(container: DChartAxisContainer<CHART>, index: number): void;
26
28
  unbind(): void;
27
29
  update(): boolean;
@@ -6,26 +6,27 @@ import { DChartAxisBaseOptionParser } from "./d-chart-axis-base-options-parser";
6
6
  import { DChartAxisContainer } from "./d-chart-axis-container";
7
7
  import { DChartAxisPosition } from "./d-chart-axis-position";
8
8
  import { DChartAxisTickContainer } from "./d-chart-axis-tick-container";
9
- export declare class DChartAxisBase<CHART extends DBase = DBase, OPTIONS extends DChartAxisBaseOptions = DChartAxisBaseOptions> implements DChartAxis<CHART> {
9
+ export declare class DChartAxisBase<CHART extends DBase = DBase, THEME extends DThemeChartAxisBase = DThemeChartAxisBase, OPTIONS extends DChartAxisBaseOptions<THEME> = DChartAxisBaseOptions<THEME>> implements DChartAxis<CHART> {
10
10
  protected _theme: DThemeChartAxisBase;
11
- protected _parser: DChartAxisBaseOptionParser;
11
+ protected _parser: DChartAxisBaseOptionParser<THEME>;
12
12
  protected _container?: DChartAxisContainer<CHART>;
13
13
  protected _index: number;
14
14
  protected _bar: DChartAxisBar<CHART>;
15
15
  protected _tick: DChartAxisTickContainer<CHART>;
16
16
  constructor(options?: OPTIONS);
17
- get parser(): DChartAxisBaseOptionParser;
17
+ get parser(): DChartAxisBaseOptionParser<THEME>;
18
+ protected newParser(theme: THEME, options?: OPTIONS): DChartAxisBaseOptionParser<THEME>;
18
19
  get position(): DChartAxisPosition;
19
20
  get bar(): DChartAxisBar<CHART>;
20
- protected newBar(parser: DChartAxisBaseOptionParser): DChartAxisBar<CHART>;
21
+ protected newBar(parser: DChartAxisBaseOptionParser<THEME>, theme: THEME, options?: OPTIONS): DChartAxisBar<CHART>;
21
22
  get tick(): DChartAxisTickContainer<CHART>;
22
- protected newTick(parser: DChartAxisBaseOptionParser): DChartAxisTickContainer<CHART>;
23
+ protected newTick(parser: DChartAxisBaseOptionParser<THEME>, theme: THEME, options?: OPTIONS): DChartAxisTickContainer<CHART>;
23
24
  bind(container: DChartAxisContainer<CHART>, index: number): void;
24
25
  unbind(): void;
25
26
  update(): void;
26
27
  onRender(): void;
27
28
  destroy(): void;
28
- protected toTheme(options?: DChartAxisBaseOptions): DThemeChartAxisBase;
29
- protected getThemeDefault(): DThemeChartAxisBase;
29
+ protected toTheme(options?: DChartAxisBaseOptions<THEME>): THEME;
30
+ protected getThemeDefault(): THEME;
30
31
  protected getType(): string;
31
32
  }
@@ -1,10 +1,11 @@
1
1
  import { DBase } from "./d-base";
2
+ import { DThemeChartAxisBase } from "./d-chart-axis-base-options";
2
3
  import { DChartAxisX, DChartAxisXOptions } from "./d-chart-axis-x";
3
- export interface DChartAxisXDatetimeOptions extends DChartAxisXOptions {
4
+ export interface DChartAxisXDatetimeOptions<THEME extends DThemeChartAxisBase> extends DChartAxisXOptions<THEME> {
4
5
  }
5
6
  /**
6
7
  * An X axis for datetimes.
7
8
  */
8
- export declare class DChartAxisXDatetime<CHART extends DBase = DBase, OPTIONS extends DChartAxisXDatetimeOptions = DChartAxisXDatetimeOptions> extends DChartAxisX<CHART, OPTIONS> {
9
+ export declare class DChartAxisXDatetime<CHART extends DBase = DBase, THEME extends DThemeChartAxisBase = DThemeChartAxisBase, OPTIONS extends DChartAxisXDatetimeOptions<THEME> = DChartAxisXDatetimeOptions<THEME>> extends DChartAxisX<CHART, THEME, OPTIONS> {
9
10
  protected getType(): string;
10
11
  }
@@ -1,11 +1,11 @@
1
1
  import { DBase } from "./d-base";
2
2
  import { DChartAxisBase } from "./d-chart-axis-base";
3
- import { DChartAxisBaseOptions } from "./d-chart-axis-base-options";
4
- export interface DChartAxisXOptions extends DChartAxisBaseOptions {
3
+ import { DChartAxisBaseOptions, DThemeChartAxisBase } from "./d-chart-axis-base-options";
4
+ export interface DChartAxisXOptions<THEME extends DThemeChartAxisBase> extends DChartAxisBaseOptions<THEME> {
5
5
  }
6
6
  /**
7
7
  * An X axis.
8
8
  */
9
- export declare class DChartAxisX<CHART extends DBase = DBase, OPTIONS extends DChartAxisXOptions = DChartAxisXOptions> extends DChartAxisBase<CHART, OPTIONS> {
9
+ export declare class DChartAxisX<CHART extends DBase = DBase, THEME extends DThemeChartAxisBase = DThemeChartAxisBase, OPTIONS extends DChartAxisXOptions<THEME> = DChartAxisXOptions<THEME>> extends DChartAxisBase<CHART, THEME, OPTIONS> {
10
10
  protected getType(): string;
11
11
  }
@@ -1,11 +1,11 @@
1
1
  import { DBase } from "./d-base";
2
2
  import { DChartAxisBase } from "./d-chart-axis-base";
3
- import { DChartAxisBaseOptions } from "./d-chart-axis-base-options";
4
- export interface DChartAxisYOptions extends DChartAxisBaseOptions {
3
+ import { DChartAxisBaseOptions, DThemeChartAxisBase } from "./d-chart-axis-base-options";
4
+ export interface DChartAxisYOptions<THEME extends DThemeChartAxisBase> extends DChartAxisBaseOptions<THEME> {
5
5
  }
6
6
  /**
7
7
  * An Y axis.
8
8
  */
9
- export declare class DChartAxisY<CHART extends DBase = DBase, OPTIONS extends DChartAxisYOptions = DChartAxisYOptions> extends DChartAxisBase<CHART, OPTIONS> {
9
+ export declare class DChartAxisY<CHART extends DBase = DBase, THEME extends DThemeChartAxisBase = DThemeChartAxisBase, OPTIONS extends DChartAxisYOptions<THEME> = DChartAxisYOptions<THEME>> extends DChartAxisBase<CHART, THEME, OPTIONS> {
10
10
  protected getType(): string;
11
11
  }
@@ -5,15 +5,20 @@
5
5
  import { DChartAxisPosition } from "./d-chart-axis-position";
6
6
  import { DChartAxisTickPosition } from "./d-chart-axis-tick-position";
7
7
  import { EShapePointsStyles } from "./shape/e-shape-points-styles";
8
+ import { EShapeStrokeStyle } from "./shape/e-shape-stroke-style";
9
+ import { EShapeTextStyle, EShapeTextWeight } from "./shape/e-shape-text";
10
+ import { EShapeTextDirection } from "./shape/e-shape-text-direction";
8
11
  import { EShapeBarPosition } from "./shape/variant/e-shape-bar-position";
12
+ import { isArray } from "./util/is-array";
9
13
  import { isString } from "./util/is-string";
10
14
  import { NumberFormatters } from "./util/number-formatters";
15
+ import { toEnum } from "./util/to-enum";
11
16
  var DChartAxisBaseOptionParser = /** @class */ (function () {
12
17
  function DChartAxisBaseOptionParser(theme, options) {
13
18
  var _a, _b;
14
19
  this._coordinateIndex = (_a = options === null || options === void 0 ? void 0 : options.coordinate) !== null && _a !== void 0 ? _a : 0;
15
20
  this._position = this.toPosition(theme, options);
16
- this._tick = this.toTickContainer(theme, options);
21
+ this._tick = this.toTick(theme, options);
17
22
  this._label = this.toLabel(theme, options);
18
23
  this._padding = (_b = options === null || options === void 0 ? void 0 : options.padding) !== null && _b !== void 0 ? _b : theme.getPadding();
19
24
  this._bar = this.toBar(theme, options);
@@ -77,7 +82,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
77
82
  stroke: this.toBarStroke(theme, options === null || options === void 0 ? void 0 : options.stroke)
78
83
  };
79
84
  };
80
- DChartAxisBaseOptionParser.prototype.toTickContainer = function (theme, options) {
85
+ DChartAxisBaseOptionParser.prototype.toTick = function (theme, options) {
81
86
  var _a;
82
87
  var tick = options === null || options === void 0 ? void 0 : options.tick;
83
88
  return {
@@ -188,7 +193,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
188
193
  width: (_h = (_g = optionsA.width) !== null && _g !== void 0 ? _g : optionsB.width) !== null && _h !== void 0 ? _h : width,
189
194
  align: (_k = (_j = optionsA.align) !== null && _j !== void 0 ? _j : optionsB.align) !== null && _k !== void 0 ? _k : align,
190
195
  side: (_m = (_l = optionsA.side) !== null && _l !== void 0 ? _l : optionsB.side) !== null && _m !== void 0 ? _m : side,
191
- style: (_p = (_o = optionsA.style) !== null && _o !== void 0 ? _o : optionsB.style) !== null && _p !== void 0 ? _p : style
196
+ style: this.toStrokeStyle((_p = (_o = optionsA.style) !== null && _o !== void 0 ? _o : optionsB.style) !== null && _p !== void 0 ? _p : style)
192
197
  };
193
198
  }
194
199
  else {
@@ -199,7 +204,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
199
204
  width: (_t = optionsA.width) !== null && _t !== void 0 ? _t : width,
200
205
  align: (_u = optionsA.align) !== null && _u !== void 0 ? _u : align,
201
206
  side: (_v = optionsA.side) !== null && _v !== void 0 ? _v : side,
202
- style: (_w = optionsA.style) !== null && _w !== void 0 ? _w : style
207
+ style: this.toStrokeStyle((_w = optionsA.style) !== null && _w !== void 0 ? _w : style)
203
208
  };
204
209
  }
205
210
  }
@@ -211,7 +216,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
211
216
  width: (_0 = optionsB.width) !== null && _0 !== void 0 ? _0 : width,
212
217
  align: (_1 = optionsB.align) !== null && _1 !== void 0 ? _1 : align,
213
218
  side: (_2 = optionsB.side) !== null && _2 !== void 0 ? _2 : side,
214
- style: (_3 = optionsB.style) !== null && _3 !== void 0 ? _3 : style
219
+ style: this.toStrokeStyle((_3 = optionsB.style) !== null && _3 !== void 0 ? _3 : style)
215
220
  };
216
221
  }
217
222
  else {
@@ -226,6 +231,19 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
226
231
  };
227
232
  }
228
233
  };
234
+ DChartAxisBaseOptionParser.prototype.toStrokeStyle = function (target) {
235
+ if (isString(target)) {
236
+ return EShapeStrokeStyle[target];
237
+ }
238
+ else if (isArray(target)) {
239
+ var result = EShapeStrokeStyle.NONE;
240
+ for (var i = 0, imax = target.length; i < imax; ++i) {
241
+ result |= EShapeStrokeStyle[target[i]];
242
+ }
243
+ return result;
244
+ }
245
+ return target;
246
+ };
229
247
  DChartAxisBaseOptionParser.prototype.toTickMajorFormatter = function (theme, options) {
230
248
  var text = options === null || options === void 0 ? void 0 : options.text;
231
249
  if (text) {
@@ -259,10 +277,10 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
259
277
  alpha: options.alpha,
260
278
  family: options.family,
261
279
  size: options.size,
262
- weight: options.weight,
280
+ weight: toEnum(options.weight, EShapeTextWeight),
263
281
  align: this.toTickMajorTextAlign(theme, options.align),
264
282
  offset: this.toTickMajorTextOffset(theme, options.offset),
265
- style: options.style,
283
+ style: toEnum(options.style, EShapeTextStyle),
266
284
  outline: this.toTickMajorTextOutline(theme, options.outline),
267
285
  spacing: this.toTickMajorTextSpacing(theme, options.spacing),
268
286
  direction: this.toTickMajorTextDirection(theme, options.direction),
@@ -312,7 +330,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
312
330
  };
313
331
  };
314
332
  DChartAxisBaseOptionParser.prototype.toTickMajorTextDirection = function (theme, options) {
315
- return options !== null && options !== void 0 ? options : theme.getMajorTickTextDirection();
333
+ return toEnum(options !== null && options !== void 0 ? options : theme.getMajorTickTextDirection(), EShapeTextDirection);
316
334
  };
317
335
  DChartAxisBaseOptionParser.prototype.toTickMajorTextColor = function (theme, options) {
318
336
  return options !== null && options !== void 0 ? options : theme.getMajorTickTextColor();
@@ -350,10 +368,10 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
350
368
  alpha: options.alpha,
351
369
  family: options.family,
352
370
  size: options.size,
353
- weight: options.weight,
371
+ weight: toEnum(options.weight, EShapeTextWeight),
354
372
  align: this.toTickMinorTextAlign(theme, options.align),
355
373
  offset: this.toTickMinorTextOffset(theme, options.offset),
356
- style: options.style,
374
+ style: toEnum(options.style, EShapeTextStyle),
357
375
  outline: this.toTickMinorTextOutline(theme, options.outline),
358
376
  spacing: this.toTickMinorTextSpacing(theme, options.spacing),
359
377
  direction: this.toTickMinorTextDirection(theme, options.direction),
@@ -403,7 +421,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
403
421
  };
404
422
  };
405
423
  DChartAxisBaseOptionParser.prototype.toTickMinorTextDirection = function (theme, options) {
406
- return options !== null && options !== void 0 ? options : theme.getMinorTickTextDirection();
424
+ return toEnum(options !== null && options !== void 0 ? options : theme.getMinorTickTextDirection(), EShapeTextDirection);
407
425
  };
408
426
  DChartAxisBaseOptionParser.prototype.toTickMinorTextColor = function (theme, options) {
409
427
  return options !== null && options !== void 0 ? options : theme.getMinorTickTextColor();
@@ -417,10 +435,10 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
417
435
  alpha: label.alpha,
418
436
  family: label.family,
419
437
  size: label.size,
420
- weight: label.weight,
438
+ weight: toEnum(label.weight, EShapeTextWeight),
421
439
  align: this.toLabelAlign(theme, label.align),
422
440
  offset: this.toLabelOffset(theme, label.offset),
423
- style: label.style,
441
+ style: toEnum(label.style, EShapeTextStyle),
424
442
  outline: this.toLabelOutline(theme, label.outline),
425
443
  spacing: this.toLabelSpacing(theme, label.spacing),
426
444
  direction: this.toLabelDirection(theme, label.direction),
@@ -471,7 +489,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
471
489
  };
472
490
  };
473
491
  DChartAxisBaseOptionParser.prototype.toLabelDirection = function (theme, options) {
474
- return options !== null && options !== void 0 ? options : theme.getLabelDirection();
492
+ return toEnum(options !== null && options !== void 0 ? options : theme.getLabelDirection(), EShapeTextDirection);
475
493
  };
476
494
  DChartAxisBaseOptionParser.prototype.toLabelColor = function (theme, options) {
477
495
  return options !== null && options !== void 0 ? options : theme.getLabelColor();