Skip to content

Commit

Permalink
feat: add typing to label-transform properties (#3127)
Browse files Browse the repository at this point in the history
* feat: add typing to label-transform properties
* fix: Fix typings style error.
  • Loading branch information
chanwutk authored and jheer committed Mar 16, 2021
1 parent 9c86412 commit f262105
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/vega-typings/types/spec/transform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,18 +495,31 @@ export interface LoessTransform {
as?: Vector2<string | SignalRef> | SignalRef;
}

export type LabelAnchor =
| 'left'
| 'right'
| 'top'
| 'bottom'
| 'top-left'
| 'top-right'
| 'bottom-left'
| 'bottom-right'
| 'middle';
export type LineLabelAnchor = 'begin' | 'end';
export type AreaLabelMethod = 'naive' | 'reduced-search' | 'floodfill';

export interface LabelTransform {
type: 'label';
size: Vector2<number | SignalRef> | SignalRef;
sort?: Compare;
offset?: number[] | number | SignalRef;
anchor?: string[] | string | SignalRef;
anchor?: LabelAnchor[] | LabelAnchor | SignalRef;
padding?: number | SignalRef;
markIndex?: number;
lineAnchor?: 'begin' | 'end' | SignalRef;
lineAnchor?: LineLabelAnchor | SignalRef;
avoidBaseMark?: boolean | SignalRef;
avoidMarks?: string[];
method?: 'naive' | 'reduced-search' | 'floodfill';
method?: AreaLabelMethod;
as?: Vector7<string | SignalRef> | SignalRef;
}

Expand Down

0 comments on commit f262105

Please sign in to comment.