PathRecorder
Defined in: core/path-recorder.ts:9
Records PathContext drawing calls into flattened polylines (subpaths). This is the retained-mode capture used by GPU backends: call a d3 generator into a PathRecorder once, then hand the subpaths to the tessellator.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PathRecorder(
tolerance?):PathRecorder
Defined in: core/path-recorder.ts:19
Flattening tolerance in coordinate units.
Parameters
Section titled “Parameters”tolerance?
Section titled “tolerance?”number = 0.25
Returns
Section titled “Returns”PathRecorder
Properties
Section titled “Properties”tolerance
Section titled “tolerance”tolerance:
number=0.25
Defined in: core/path-recorder.ts:19
Accessors
Section titled “Accessors”subpaths
Section titled “subpaths”Get Signature
Section titled “Get Signature”get subpaths(): readonly
Subpath[]
Defined in: core/path-recorder.ts:21
Returns
Section titled “Returns”readonly Subpath[]
Methods
Section titled “Methods”arc(
x,y,radius,startAngle,endAngle,counterclockwise?):void
Defined in: core/path-recorder.ts:80
Parameters
Section titled “Parameters”number
number
radius
Section titled “radius”number
startAngle
Section titled “startAngle”number
endAngle
Section titled “endAngle”number
counterclockwise?
Section titled “counterclockwise?”boolean = false
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”arcTo()
Section titled “arcTo()”arcTo(
_x1,_y1,_x2,_y2,_radius):void
Defined in: core/path-recorder.ts:103
Parameters
Section titled “Parameters”number
number
number
number
_radius
Section titled “_radius”number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”beginPath()
Section titled “beginPath()”beginPath():
void
Defined in: core/path-recorder.ts:25
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”bezierCurveTo()
Section titled “bezierCurveTo()”bezierCurveTo(
cp1x,cp1y,cp2x,cp2y,x,y):void
Defined in: core/path-recorder.ts:65
Parameters
Section titled “Parameters”number
number
number
number
number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”closePath()
Section titled “closePath()”closePath():
void
Defined in: core/path-recorder.ts:122
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”lineTo()
Section titled “lineTo()”lineTo(
x,y):void
Defined in: core/path-recorder.ts:44
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”moveTo()
Section titled “moveTo()”moveTo(
x,y):void
Defined in: core/path-recorder.ts:35
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”quadraticCurveTo()
Section titled “quadraticCurveTo()”quadraticCurveTo(
cpx,cpy,x,y):void
Defined in: core/path-recorder.ts:57
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”rect()
Section titled “rect()”rect(
x,y,w,h):void
Defined in: core/path-recorder.ts:113
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”translate()
Section titled “translate()”translate(
dx,dy):void
Defined in: core/path-recorder.ts:30
Shift all subsequent path coordinates by (dx, dy), accumulating like
CanvasRenderingContext2D.translate. The canonical d3 idiom for placing an
origin-centred generator (radial trees, chords, …) at an offset: call
translate(cx, cy) once, then run the generator into this context unchanged.
This is the only transform in the seam — no rotate/scale/save/restore. Radial generators bake angle into their coordinates, so a translation is all they need; a richer transform stack would complicate every backend for no current consumer. The offset is part of context state (not reset by beginPath) and, in retained backends, lives only for the single drawable the callback is recording.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”void