Skip to main content
tsdraw can render patterned backgrounds behind the drawing canvas — useful for graph paper, dotted grids, or branded visuals.

Preset backgrounds

Four presets are available out of the box:

Custom backgrounds

For full control, pass a custom render function:
The render function receives a CanvasRenderingContext2D, the current Viewport, and the canvas dimensions. It’s called every frame, so keep it efficient.

Background types

Zoom-responsive patterns

The preset backgrounds scale with the viewport zoom. Lines, grid, and dots maintain consistent visual density at any zoom level.