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
-
Parameters
-
Parameters
-
x: number
-
y: number
-
w: number
-
h: number
Methods
contains
-
Parameters
Returns boolean
dice
- dice(data: number[]): Rect[]
-
Parameters
Returns Rect[]
distance
- distance(p: Point): number
-
Parameters
Returns number
intersects
-
Parameters
Returns boolean
slice
- slice(data: number[]): Rect[]
-
Parameters
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