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
| 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:33 |
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:157
Appends the recorded commands of another TerminalPath to this path.
Parameters
| Parameter | Type |
|---|---|
path | ContextPath |
Returns
void
Overrides
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
| 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:62
Records an arc approximated as two line segments to the tangent points.
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:69
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:56
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:80
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:91
Records an ellipse centered at (x, y) with the given radii.
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:102
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:113
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:126
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:137
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:151
Records a rounded rectangle, approximated as a plain rectangle for terminal rendering.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
radii? | BorderRadius |
Returns
void