Skip to content
Shapemetry

@huukhanhnguyen/model / core/drafting

core/drafting

drafting()

drafting(role, extra?): { attributes: Record<string, unknown>; }

Parameters

role

string

extra?

Record<string, unknown>

Returns

{ attributes: Record<string, unknown>; }

attributes

attributes: Record<string, unknown>


draftingLine()

draftingLine(role, points, closed?, extra?): CurveData

A polyline/loop mark in drawing space — role rides attributes.drafting. extra merges into attributes alongside drafting (e.g. chart.ts stamping series/category on a line/bar data document for a data-driven reader — classify by data, same as applyAttribute).

Parameters

role

string

points

[number, number][]

closed?

boolean = false

extra?

Record<string, unknown>

Returns

CurveData


draftingText()

draftingText(role, at, content, style?): ObjectData

A text mark in drawing space — a TextData with drafting metadata the serializer styles by (fontSize, align start|middle, bold).

These marks are FURNITURE (a sheet title block, a chart axis label), not authored drawing content, so they carry their size on attributes rather than through the textStyles lane — the same tier the drafting role and bold/align already ride on, and the serializer reads all four together. A mark the user authors goes through the text node and names a real style.

Parameters

role

string

at

[number, number]

content

string

style?

align?

"start" | "middle"

bold?

boolean

fontSize?

number

Returns

ObjectData

Last updated: 📖 1 min readEdit on GitHub