Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change repeating alingment string to single type #10111

Merged
merged 2 commits into from Jan 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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