Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Rect

Index

Constructors

constructor

  • new Rect(p1: Point, p2: Point): Rect
  • new Rect(p: Point, w: number, h: number): Rect
  • new Rect(x: number, y: number, w: number, h: number): Rect
  • Parameters

    Returns Rect

  • Parameters

    • p: Point
    • w: number
    • h: number

    Returns Rect

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns Rect

Properties

h

h: number

p

w

w: number

Methods

area

  • area(): number
  • Returns number

centroid

circumference

  • circumference(): number
  • Returns number

clip

closest

contains

copy

dice

  • dice(data: number[]): Rect[]
  • Parameters

    • data: number[]

    Returns Rect[]

distance

  • distance(p: Point): number
  • Parameters

    Returns number

edges

intersection

intersects

merge

polygon

scale

  • Parameters

    • s: number

    Returns Rect

  • Parameters

    Returns Rect

slice

  • slice(data: number[]): Rect[]
  • Parameters

    • data: number[]

    Returns Rect[]

split

  • split(data: number[], mode?: string): Rect[]
  • Parameters

    • data: number[]
    • mode: string = 'squarify'

    Returns Rect[]

squarify

  • squarify(data: number[], x: number, y: number, w: number, h: number): Rect[]
  • Parameters

    • data: number[]
    • x: number
    • y: number
    • w: number
    • h: number

    Returns Rect[]

translate

  • translate(x: number, y: number): Rect
  • Parameters

    • x: number
    • y: number

    Returns Rect

vertices