Skip to content

Function: renderToCanvas() ​

ts
function renderToCanvas<C>(
   layout, 
   canvas, 
   options?
): Promise<C>;

Draw a layout onto canvas, sizing it to the layout (width × pixelRatio) and loading its images first. Resolves to the canvas.

Type Parameters ​

Type Parameter
C extends CanvasLike

Parameters ​

ParameterType
layoutLayout
canvasC
optionsRasterOptions

Returns ​

Promise<C>

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).