Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Line

Hierarchy

Index

Constructors

constructor

  • new Line(x1?: undefined | number, y1?: undefined | number, x2?: undefined | number, y2?: undefined | number): Line
  • Parameters

    • Optional x1: undefined | number
    • Optional y1: undefined | number
    • Optional x2: undefined | number
    • Optional y2: undefined | number

    Returns Line

Properties

Private _from

_from: Point = new Point()

Private _to

_to: Point = new Point()

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

angle

  • get angle(): number

contents

dx

  • get dx(): number

dy

  • get dy(): number

from

length

  • get length(): number

to

x1

  • get x1(): number

x2

  • get x2(): number

y1

  • get y1(): number

y2

  • get y2(): number

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

appendChild

  • appendChild(child: Element): void

calculateDistanceToPoint

  • calculateDistanceToPoint(point: Point): number
  • Calculates the distance if a point to this line

    Parameters

    Returns number

calculatePointBetween

  • calculatePointBetween(offset: number, inPixels?: boolean): Point
  • Calculates a point on the line. Offset 0 is the starting point, offset 1 is the ending point.

    Parameters

    • offset: number
    • Default value inPixels: boolean = false

      If true, the offset is given in pixels

    Returns Point

    a new point instance

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns ( string | symbol ) []

getCoordinates

  • getCoordinates(): object
  • Returns the line's coordinates

    Returns object

    • x1: number
    • x2: number
    • y1: number
    • y2: number

getHref

  • getHref(): string | undefined

getID

  • getID(): string | undefined

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getOrigin

  • getOrigin(): string | undefined

getTypeName

  • getTypeName(): string | undefined

getTypeURI

  • getTypeURI(): string | undefined

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

merge

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeChild

  • removeChild(child: Element): boolean

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

setID

  • setID(ID: string | undefined): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setOrigin

  • setOrigin(origin: string): void

setTypeName

  • setTypeName(name: string | undefined): void

setTypeURI

  • setTypeURI(uri: string | undefined): void

Static fromCoordinates

  • fromCoordinates(__namedParameters: object): Line
  • Parameters

    • __namedParameters: object
      • x1: number
      • x2: number
      • y1: number
      • y2: number

    Returns Line

Static fromTwoPoints

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc