Skip to content

Documentation / @finchart/core / index / DrawTarget

Interface: DrawTarget ​

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

The receiving side of draw commands — everything a series knows about the renderer. Requiring this interface instead of a concrete renderer means a series doesn't know how commands pile up or when they get replayed.

Extended by ​

Methods ​

drawCustom()? ​

optional drawCustom(draw): void

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

An extension sends its own primitive. It's optional so existing implementations don't break.

Don't call this directly — use drawCustom(target, draw), which replays the fallback on a surface missing this method. Calling this directly lets optional chaining quietly fall to drawing nothing.

Parameters ​

draw ​

CustomDraw

Returns ​

void


drawLine() ​

drawLine(points, style): void

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

Parameters ​

points ​

Point[]

style ​

LineStyle

Returns ​

void


drawShape() ​

drawShape(params): void

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

Parameters ​

params ​

ShapeParams

Returns ​

void


drawText() ​

drawText(params): void

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

Places text. Measuring and placement are both the receiver's job.

Parameters ​

params ​

TextParams

Returns ​

void