Skip to content

Class: Root ​

Extends ​

Constructors ​

Constructor ​

new Root(): Root

Returns ​

Root

Overrides ​

Component.constructor

Properties ​

canvas ​

canvas: HTMLCanvasElement = null


context ​

context: CanvasRenderingContext2D = null


dom ​

dom: HTMLCanvasElement = null


MAX_ELAPSE ​

MAX_ELAPSE: number = Infinity

Inherited from ​

Component.MAX_ELAPSE


mounted ​

mounted: boolean = false


paused ​

paused: boolean = false


sleep ​

sleep: boolean = false

Methods ​

alpha() ​

alpha(a, ta?): Root

Parameters ​

a ​

number

ta? ​

number

Returns ​

Root

Inherited from ​

Component.alpha


append() ​

Call Signature ​

append(...child): this

Parameters ​
child ​

...Component[]

Returns ​

this

Inherited from ​

Component.append

Call Signature ​

append(child): this

Parameters ​
child ​

Component[]

Returns ​

this

Inherited from ​

Component.append


appendTo() ​

appendTo(parent): Root

Parameters ​

parent ​

Component

Returns ​

Root

Inherited from ​

Component.appendTo


attr() ​

Call Signature ​

attr(name, value): this

Parameters ​
name ​

string

value ​

any

Returns ​

this

Inherited from ​

Component.attr

Call Signature ​

attr(name): any

Parameters ​
name ​

string

Returns ​

any

Inherited from ​

Component.attr


background() ​

background(color): Root

Parameters ​

color ​

string

Returns ​

Root


clearTimeout() ​

clearTimeout(timer): void

Parameters ​

timer ​

ComponentTickListener<Root>

Returns ​

void

Inherited from ​

Component.clearTimeout


column() ​

column(align): Root

Parameters ​

align ​

number

Returns ​

Root

Inherited from ​

Component.column


direction() ​

direction(direction, align): Root

Parameters ​

direction ​

"row" | "column"

align ​

number

Returns ​

Root

Inherited from ​

Component.direction


empty() ​

empty(): Root

Returns ​

Root

Inherited from ​

Component.empty


first() ​

first(visible?): Component

Parameters ​

visible? ​

boolean

Returns ​

Component

Inherited from ​

Component.first


height() ​

Call Signature ​

height(h): this

Parameters ​
h ​

number

Returns ​

this

Inherited from ​

Component.height

Call Signature ​

height(): number

Returns ​

number

Inherited from ​

Component.height


hide() ​

hide(): Root

Returns ​

Root

Inherited from ​

Component.hide


insertAfter() ​

insertAfter(prev): Root

Parameters ​

prev ​

Component

Returns ​

Root

Inherited from ​

Component.insertAfter


insertBefore() ​

insertBefore(next): Root

Parameters ​

next ​

Component

Returns ​

Root

Inherited from ​

Component.insertBefore


insertNext() ​

insertNext(sibling, more?): Root

Parameters ​

sibling ​

Component

more? ​

Component

Returns ​

Root

Inherited from ​

Component.insertNext


insertPrev() ​

insertPrev(sibling, more?): Root

Parameters ​

sibling ​

Component

more? ​

Component

Returns ​

Root

Inherited from ​

Component.insertPrev


label() ​

Call Signature ​

label(): string

Returns ​

string

Inherited from ​

Component.label

Call Signature ​

label(label): this

Parameters ​
label ​

string

Returns ​

this

Inherited from ​

Component.label


last() ​

last(visible?): Component

Parameters ​

visible? ​

boolean

Returns ​

Component

Inherited from ​

Component.last


listeners() ​

listeners(type): ComponentEventListener<Component>[]

Parameters ​

type ​

string

Returns ​

ComponentEventListener<Component>[]

Inherited from ​

Component.listeners


matrix() ​

matrix(relative?): Matrix

Parameters ​

relative? ​

boolean = false

Returns ​

Matrix

Inherited from ​

Component.matrix


maximize() ​

maximize(): Root

Set size to match parent size.

Returns ​

Root

Inherited from ​

Component.maximize


minimize() ​

minimize(): Root

Set size to match largest child size.

Returns ​

Root

Inherited from ​

Component.minimize


mount() ​

mount(configs?): void

Parameters ​

configs? ​

RootConfig = {}

Returns ​

void


next() ​

next(visible?): Component

Parameters ​

visible? ​

boolean

Returns ​

Component

Inherited from ​

Component.next


off() ​

off(types, listener): this

Parameters ​

types ​

string

listener ​

ComponentEventListener<Root>

Returns ​

this

Inherited from ​

Component.off


offset() ​

Call Signature ​

offset(value): this

Parameters ​
value ​

Vec2Value

Returns ​

this

Inherited from ​

Component.offset

Call Signature ​

offset(x, y): this

Parameters ​
x ​

number

y ​

number

Returns ​

this

Inherited from ​

Component.offset


on() ​

on(types, listener): this

Parameters ​

types ​

string

listener ​

ComponentEventListener<Root>

Returns ​

this

Inherited from ​

Component.on


padding() ​

padding(pad): Root

Set cell spacing for layout.

Parameters ​

pad ​

number

Returns ​

Root

Inherited from ​

Component.padding


parent() ​

parent(): Component

Returns ​

Component

Inherited from ​

Component.parent


pause() ​

pause(): Root

Returns ​

Root


pin() ​

Call Signature ​

pin(key): any

Parameters ​
key ​

keyof GetPinType

Returns ​

any

Inherited from ​

Component.pin

Call Signature ​

pin(key, value): this

Parameters ​
key ​

keyof SetPinType

value ​

any

Returns ​

this

Inherited from ​

Component.pin

Call Signature ​

pin(obj): this

Parameters ​
obj ​

SetPinType

Returns ​

this

Inherited from ​

Component.pin

Call Signature ​

pin(): Pin

Returns ​

Pin

Inherited from ​

Component.pin


prepend() ​

Call Signature ​

prepend(...child): this

Parameters ​
child ​

...Component[]

Returns ​

this

Inherited from ​

Component.prepend

Call Signature ​

prepend(child): this

Parameters ​
child ​

Component[]

Returns ​

this

Inherited from ​

Component.prepend


prependTo() ​

prependTo(parent): Root

Parameters ​

parent ​

Component

Returns ​

Root

Inherited from ​

Component.prependTo


prev() ​

prev(visible?): Component

Parameters ​

visible? ​

boolean

Returns ​

Component

Inherited from ​

Component.prev


publish() ​

publish(name, args?): number

Parameters ​

name ​

string

args? ​

any[]

Returns ​

number

Inherited from ​

Component.publish


remove() ​

remove(child?, more?): Root

Parameters ​

child? ​

Component

more? ​

any

Returns ​

Root

Inherited from ​

Component.remove


renderDebug() ​

renderDebug(ctx, m): void

Parameters ​

ctx ​

CanvasRenderingContext2D

m ​

Matrix

Returns ​

void

Overrides ​

Component.renderDebug


resizeCanvas() ​

resizeCanvas(): void

Returns ​

void


resume() ​

resume(): Root

Returns ​

Root


rotate() ​

rotate(a): Root

Parameters ​

a ​

number

Returns ​

Root

Inherited from ​

Component.rotate


row() ​

row(align): Root

Parameters ​

align ​

number

Returns ​

Root

Inherited from ​

Component.row


scale() ​

Call Signature ​

scale(value): this

Parameters ​
value ​

Vec2Value

Returns ​

this

Inherited from ​

Component.scale

Call Signature ​

scale(x, y): this

Parameters ​
x ​

number

y ​

number

Returns ​

this

Inherited from ​

Component.scale

Call Signature ​

scale(s): this

Parameters ​
s ​

number

Returns ​

this

Inherited from ​

Component.scale


setTimeout() ​

setTimeout(callback, time): (t) => boolean

Parameters ​

callback ​

() => any

time ​

number

Returns ​

(t) => boolean

Inherited from ​

Component.setTimeout


show() ​

show(): Root

Returns ​

Root

Inherited from ​

Component.show


size() ​

size(w, h): Root

Parameters ​

w ​

number

h ​

number

Returns ​

Root

Inherited from ​

Component.size


skew() ​

Call Signature ​

skew(value): this

Parameters ​
value ​

Vec2Value

Returns ​

this

Inherited from ​

Component.skew

Call Signature ​

skew(x, y): this

Parameters ​
x ​

number

y ​

number

Returns ​

this

Inherited from ​

Component.skew


spacing() ​

spacing(space): Root

Set cell spacing for row and column layout.

Parameters ​

space ​

number

Returns ​

Root

Inherited from ​

Component.spacing


tick() ​

tick(callback, before?): void

Parameters ​

callback ​

ComponentTickListener<Root>

before? ​

boolean = false

Returns ​

void

Inherited from ​

Component.tick


timeout() ​

timeout(callback, time): void

Parameters ​

callback ​

() => any

time ​

number

Returns ​

void

Inherited from ​

Component.timeout


toString() ​

toString(): string

Returns ​

string

Inherited from ​

Component.toString


tween() ​

Call Signature ​

tween(opts?): Transition

Parameters ​
opts? ​

TransitionOptions

Returns ​

Transition

Inherited from ​

Component.tween

Call Signature ​

tween(duration?, delay?, append?): Transition

Parameters ​
duration? ​

number

delay? ​

number

append? ​

boolean

Returns ​

Transition

Inherited from ​

Component.tween


unmount() ​

unmount(): Root

Returns ​

Root


untick() ​

untick(callback): void

Parameters ​

callback ​

ComponentTickListener<Root>

Returns ​

void

Inherited from ​

Component.untick


viewbox() ​

Call Signature ​

viewbox(viewbox): this

Set viewbox.

Parameters ​
viewbox ​

Viewbox

Returns ​

this

Call Signature ​

viewbox(width?, height?, mode?): this

Set viewbox.

Parameters ​
width? ​

number

height? ​

number

mode? ​

FitMode

Returns ​

this


viewport() ​

Call Signature ​

viewport(): Viewport

Set/Get viewport. This is used along with viewbox to determine the scale and position of the viewbox within the viewport. Viewport is the size of the container, for example size of the canvas element. Viewbox is provided by the user, and is the ideal size of the content.

Returns ​

Viewport

Call Signature ​

viewport(width, height, ratio?): this

Set/Get viewport. This is used along with viewbox to determine the scale and position of the viewbox within the viewport. Viewport is the size of the container, for example size of the canvas element. Viewbox is provided by the user, and is the ideal size of the content.

Parameters ​
width ​

number

height ​

number

ratio? ​

number

Returns ​

this

Call Signature ​

viewport(viewbox): this

Set/Get viewport. This is used along with viewbox to determine the scale and position of the viewbox within the viewport. Viewport is the size of the container, for example size of the canvas element. Viewbox is provided by the user, and is the ideal size of the content.

Parameters ​
viewbox ​

Viewport

Returns ​

this


visible() ​

Call Signature ​

visible(visible): this

Parameters ​
visible ​

boolean

Returns ​

this

Inherited from ​

Component.visible

Call Signature ​

visible(): boolean

Returns ​

boolean

Inherited from ​

Component.visible


visit() ​

visit<P>(visitor, payload?): boolean | void

Type Parameters ​

P ​

P

Parameters ​

visitor ​

ComponentVisitor<P>

payload? ​

P

Returns ​

boolean | void

Inherited from ​

Component.visit


width() ​

Call Signature ​

width(w): this

Parameters ​
w ​

number

Returns ​

this

Inherited from ​

Component.width

Call Signature ​

width(): number

Returns ​

number

Inherited from ​

Component.width