Documentation / @ripl/terminal / TerminalPath
Class: TerminalPath ​
Defined in: terminal/src/path.ts:37
Terminal path implementation that records drawing commands for later rasterization.
Extends ​
Constructors ​
Constructor ​
new TerminalPath(
id?):TerminalPath
Defined in: terminal/src/path.ts:48
Parameters ​
| Parameter | Type |
|---|---|
id? | string |
Returns ​
TerminalPath
Overrides ​
Properties ​
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|---|
commands | readonly | TerminalPathCommand[] | [] | Ordered list of recorded drawing commands, replayed during rasterization. | - | terminal/src/path.ts:40 |
id | readonly | string | undefined | Unique identifier for this path, used for SVG element diffing between frames. | ContextPath.id | core/src/context/path.ts:20 |
Methods ​
addPath() ​
addPath(
path):void
Defined in: terminal/src/path.ts:250
Appends the recorded commands of another TerminalPath to this path. A path from another backend carries no terminal commands to replay, so it is skipped with a warning rather than composing into a silently empty result.
Parameters ​
| Parameter | Type |
|---|---|
path | ContextPath |
Returns ​
void
Overrides ​
arc() ​
arc(
x,y,radius,startAngle,endAngle,counterclockwise?):void
Defined in: terminal/src/path.ts:64
Records an arc centered at (x, y) sweeping from startAngle to endAngle.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
radius | number |
startAngle | number |
endAngle | number |
counterclockwise? | boolean |
Returns ​
void
Overrides ​
arcTo() ​
arcTo(
x1,y1,x2,y2,radius):void
Defined in: terminal/src/path.ts:86
Records the arc of the given radius tangent to both the line from the current point to (x1, y1) and the line from (x1, y1) to (x2, y2), preceded by a line to the first tangent point — the same construction canvas performs, so the corner point itself is not visited. Degenerate cases (a zero radius, or three collinear points) fall back to a line to (x1, y1).
Parameters ​
| Parameter | Type |
|---|---|
x1 | number |
y1 | number |
x2 | number |
y2 | number |
radius | number |
Returns ​
void
Overrides ​
bezierCurveTo() ​
bezierCurveTo(
cp1x,cp1y,cp2x,cp2y,x,y):void
Defined in: terminal/src/path.ts:124
Records a cubic bezier curve from the current point to (x, y).
Parameters ​
| Parameter | Type |
|---|---|
cp1x | number |
cp1y | number |
cp2x | number |
cp2y | number |
x | number |
y | number |
Returns ​
void
Overrides ​
circle() ​
circle(
x,y,radius):void
Defined in: terminal/src/path.ts:76
Records a full circle centered at (x, y) as a complete arc.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
radius | number |
Returns ​
void
Overrides ​
closePath() ​
closePath():
void
Defined in: terminal/src/path.ts:137
Closes the current subpath with a line back to its start point.
Returns ​
void
Overrides ​
ellipse() ​
ellipse(
x,y,radiusX,radiusY,rotation,startAngle,endAngle,counterclockwise?):void
Defined in: terminal/src/path.ts:149
Records an ellipse centered at (x, y) with the given radii, sweep, and rotation.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
radiusX | number |
radiusY | number |
rotation | number |
startAngle | number |
endAngle | number |
counterclockwise? | boolean |
Returns ​
void
Overrides ​
lineTo() ​
lineTo(
x,y):void
Defined in: terminal/src/path.ts:162
Records a straight line from the current point to (x, y).
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns ​
void
Overrides ​
moveTo() ​
moveTo(
x,y):void
Defined in: terminal/src/path.ts:175
Moves the cursor to (x, y), starting a new subpath.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns ​
void
Overrides ​
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 ​
| Parameter | Type |
|---|---|
points | Point[] |
Returns ​
void
Inherited from ​
quadraticCurveTo() ​
quadraticCurveTo(
cpx,cpy,x,y):void
Defined in: terminal/src/path.ts:203
Records a quadratic bezier curve from the current point to (x, y).
Parameters ​
| Parameter | Type |
|---|---|
cpx | number |
cpy | number |
x | number |
y | number |
Returns ​
void
Overrides ​
rect() ​
rect(
x,y,width,height):void
Defined in: terminal/src/path.ts:189
Records an axis-aligned rectangle with its top-left corner at (x, y).
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
Returns ​
void
Overrides ​
roundRect() ​
roundRect(
x,y,width,height,radii?):void
Defined in: terminal/src/path.ts:216
Records a rounded rectangle, tracing each corner as a quarter arc between the straight edges.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
radii? | BorderRadius |
Returns ​
void