Skip to content

Documentation / @finchart/core / index / drawCustom

Function: drawCustom() ​

drawCustom(target, draw): void

Defined in: packages/core/src/render/types.ts:346

Sends an extension's primitive so something gets drawn on any surface.

ts
drawCustom(target, {
  name: "acme/gradient",
  params: { from, to, stops },
  fallback: [{ type: "drawShape", shape: { shape: "rect", …, fill: stops[0] } }],
});

Passes it through as-is to a surface that knows it, replays fallback on one that doesn't — compiling fine while quietly not drawing at runtime is the most dangerous outcome.

Parameters ​

target ​

DrawTarget

draw ​

CustomDraw

Returns ​

void