Canvas State Variable Reference

Table of contents


Introduction

Canvas state variables represent HTML canvas outputs

The value of a Canvas state variable is a function with the following signature:

canvasFn (node)

where node is a DOM <canvas> element. The state variable is considered changed every time it is assigned. Once changed, every Component rendering the state variable will call the function with the Component's <canvas> node. The function can then extract a drawing context and query any node size properties.

Constructor

Syntax

ctl.createPage({
	...,
	stateVarInfo:[
		{type:'canvas', ...},
	],
})

Parameters


Instance methods

Inherited methods

Note: The component() method returns a CanvasSvCmp.


Instance properties

Inherited properties


DOM element properties