An anchor is a flexible position at a DOM element

### Hierarchy

- Anchor

## Index

### Constructors

- constructor

### Accessors

- pos

### Methods

- checkForPositionChange
- compute
- distance
- toString
- fromString

## Constructors

### constructor

- new Anchor(elem: Element, anchor: EAnchorDirection, lazy?: boolean): Anchor

- - Defined in annotation.ts:60

  #### Parameters

  - ##### elem: Element

  - ##### anchor: EAnchorDirection

  - ##### Default value lazy: boolean = false

  #### Returns Anchor

## Accessors

### pos

pos:

- Defined in annotation.ts:80

## Methods

### checkForPositionChange

- checkForPositionChange(): boolean

- - Defined in annotation.ts:88

  checks wether the anchor position has changed and updates its position accordingly

  #### Returns boolean

  true if there was a change

### compute

- compute(): [number, number]

- - Defined in annotation.ts:94

  #### Returns [number, number]

### distance

- distance(pos: [number, number]): number

- - Defined in annotation.ts:73

  returns the square distance of this anchor point to the given point

  #### Parameters

  - ##### pos: [number, number]

    the current point

  #### Returns number

  the square distance

### toString

- toString(): string

- - Defined in annotation.ts:128

  returns the ids identifying this anchor based on the data-anchor DOM attribute

  #### Returns string

### Static fromString

- fromString(s: string, lazy?: boolean): Anchor

- - Defined in annotation.ts:137

  converts the given encoded anchor string to its DOM element

  #### Parameters

  - ##### s: string

  - ##### Default value lazy: boolean = true

  #### Returns Anchor

Generated using TypeDoc