Skip to content

Function: drawLayout() ​

ts
function drawLayout(
   ctx, 
   layout, 
   options?
): void;

Draw a layout on a canvas context, scaled to fit width by height device pixels (the canvas size by default) and centerd, like SVG's default preserveAspectRatio. It draws what the SVG renderer does: background, cast shadows, fills, images, bevels and strokes. Synchronous: pass loaded images in loaded.

Parameters ​

ParameterType
ctxCanvasContextLike
layoutLayout
optionsCanvasRenderOptions & object

Returns ​

void

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