Skip to content

Commit

Permalink
Change repeating alingment string to single type (#10111)
Browse files Browse the repository at this point in the history
* Change repeating alignment to single type for ease of maintenance
* improved naming
  • Loading branch information
LeeLenaleee committed Jan 29, 2022
1 parent a7d98fb commit 6283c6f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions types/index.esm.d.ts
Expand Up @@ -1655,6 +1655,7 @@ export interface FontSpec {
}

export type TextAlign = 'left' | 'center' | 'right';
export type Align = 'start' | 'center' | 'end';

export interface VisualElement {
draw(ctx: CanvasRenderingContext2D, area?: ChartArea): void;
Expand Down Expand Up @@ -2231,7 +2232,7 @@ export interface LegendOptions<TType extends ChartType> {
* Alignment of the legend.
* @default 'center'
*/
align: 'start' | 'center' | 'end';
align: Align;
/**
* Maximum height of the legend, in pixels
*/
Expand Down Expand Up @@ -2367,7 +2368,7 @@ export interface TitleOptions {
* Alignment of the title.
* @default 'center'
*/
align: 'start' | 'center' | 'end';
align: Align;
/**
* Is the title shown?
* @default false
Expand Down Expand Up @@ -2993,7 +2994,7 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
/** If true, displays the axis title. */
display: boolean;
/** Alignment of the axis title. */
align: 'start' | 'center' | 'end';
align: Align;
/** The text for the title, e.g. "# of People" or "Response Choices". */
text: string | string[];
/** Color of the axis label. */
Expand Down Expand Up @@ -3027,7 +3028,7 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
* The label alignment
* @default 'center'
*/
align: 'start' | 'center' | 'end';
align: Align;
/**
* If true, automatically calculates how many labels can be shown and hides labels accordingly. Labels will be rotated up to maxRotation before skipping any. Turn autoSkip off to show all labels no matter what.
* @default true
Expand Down

0 comments on commit 6283c6f

Please sign in to comment.