Skip to content

Documentation / @ripl/terminal / TerminalPath

Class: TerminalPath

Defined in: terminal/src/path.ts:30

Terminal path implementation that records drawing commands for later rasterization.

Extends

Constructors

Constructor

new TerminalPath(id?): TerminalPath

Defined in: terminal/src/path.ts:40

Parameters

ParameterType
id?string

Returns

TerminalPath

Overrides

ContextPath.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
commandsreadonlyTerminalPathCommand[][]Ordered list of recorded drawing commands, replayed during rasterization.-terminal/src/path.ts:33
idreadonlystringundefinedUnique identifier for this path, used for SVG element diffing between frames.ContextPath.idcore/src/context/path.ts:20

Methods

addPath()

addPath(path): void

Defined in: terminal/src/path.ts:157

Appends the recorded commands of another TerminalPath to this path.

Parameters

ParameterType
pathContextPath

Returns

void

Overrides

ContextPath.addPath


arc()

arc(x, y, radius, startAngle, endAngle, counterclockwise?): void

Defined in: terminal/src/path.ts:45

Records an arc centered at (x, y) sweeping from startAngle to endAngle.

Parameters

ParameterType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
counterclockwise?boolean

Returns

void

Overrides

ContextPath.arc


arcTo()

arcTo(x1, y1, x2, y2, radius): void

Defined in: terminal/src/path.ts:62

Records an arc approximated as two line segments to the tangent points.

Parameters

ParameterType
x1number
y1number
x2number
y2number
radiusnumber

Returns

void

Overrides

ContextPath.arcTo


bezierCurveTo()

bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y): void

Defined in: terminal/src/path.ts:69

Records a cubic bezier curve from the current point to (x, y).

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Overrides

ContextPath.bezierCurveTo


circle()

circle(x, y, radius): void

Defined in: terminal/src/path.ts:56

Records a full circle centered at (x, y) as a complete arc.

Parameters

ParameterType
xnumber
ynumber
radiusnumber

Returns

void

Overrides

ContextPath.circle


closePath()

closePath(): void

Defined in: terminal/src/path.ts:80

Closes the current subpath with a line back to its start point.

Returns

void

Overrides

ContextPath.closePath


ellipse()

ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise?): void

Defined in: terminal/src/path.ts:91

Records an ellipse centered at (x, y) with the given radii.

Parameters

ParameterType
xnumber
ynumber
radiusXnumber
radiusYnumber
rotationnumber
startAnglenumber
endAnglenumber
counterclockwise?boolean

Returns

void

Overrides

ContextPath.ellipse


lineTo()

lineTo(x, y): void

Defined in: terminal/src/path.ts:102

Records a straight line from the current point to (x, y).

Parameters

ParameterType
xnumber
ynumber

Returns

void

Overrides

ContextPath.lineTo


moveTo()

moveTo(x, y): void

Defined in: terminal/src/path.ts:113

Moves the cursor to (x, y), starting a new subpath.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Overrides

ContextPath.moveTo


polyline()

polyline(points): void

Defined in: core/src/context/path.ts:82

Adds a connected series of straight line segments through the given points.

Parameters

ParameterType
pointsPoint[]

Returns

void

Inherited from

ContextPath.polyline


quadraticCurveTo()

quadraticCurveTo(cpx, cpy, x, y): void

Defined in: terminal/src/path.ts:126

Records a quadratic bezier curve from the current point to (x, y).

Parameters

ParameterType
cpxnumber
cpynumber
xnumber
ynumber

Returns

void

Overrides

ContextPath.quadraticCurveTo


rect()

rect(x, y, width, height): void

Defined in: terminal/src/path.ts:137

Records an axis-aligned rectangle with its top-left corner at (x, y).

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Overrides

ContextPath.rect


roundRect()

roundRect(x, y, width, height, radii?): void

Defined in: terminal/src/path.ts:151

Records a rounded rectangle, approximated as a plain rectangle for terminal rendering.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber
radii?BorderRadius

Returns

void

Overrides

ContextPath.roundRect