Class Path<O>
Type Parameters
Hierarchy
- Shape<O>
- Path (View Summary)
Index
Accessors
Constructors
Methods
Properties
Accessors
bottom
center
left
points
Untracked snapshot of the points list.
Returns readonly Vec[]
right
svgRoot
- get svgRoot(): SVGSVGElement | null
Nearest enclosing
<svg>root, ornullif this shape isn't mounted under one. Used by drag helpers that need world-space cursor coords.Returns SVGSVGElement | null
top
Methods
add
along
at
attr
Bind one SVG attribute; static sets once, reactive runs as effect.
Parameters
- name: string
- val: Val<string | number>
- target: "intrinsic" | "wrapper" = "intrinsic"
Returns void
attrs
Bind several attributes at once —
this.attrs({ cx, cy, r }).Parameters
- map: Record<string, Val<string | number>>
- target: "intrinsic" | "wrapper" = "intrinsic"
Returns void
boundary
clear
Returns void
d
dispose
Returns void
effect
Reactive effect torn down with the shape.
Parameters
- fn: () => void
Returns void
l
offset
on
Parameters
- name: string
- handler: (e: Event) => void
Optionalopts: AddEventListenerOptions
Returns () => void
r
remove
Parameters
- ...toRemove: AnyShape[]
Returns void
segments
Stroke segments for the dashed renderer; default = bounding rect.
Returns Segment[]
stroke
- stroke(
opts: CommonOpts,
closed: boolean,
nativeAttrs?: Record<string, Val<string | number>>,
): voidWire stroke / fill / dashed for a stroked shape.
nativeAttrsbinds the shape's native geometry (e.g.{cx, cy, r}for circle); it's skipped whenopts.dashedsince the intrinsic is then a<path>whosedis driven bysegments().Parameters
- opts: CommonOpts
- closed: boolean
OptionalnativeAttrs: Record<string, Val<string | number>>
Returns void
to
Parameters
- p: Vec
Returns this
toLocal
Map client coords into this shape's local frame.
Parameters
- evt: { clientX: number; clientY: number }
Returns V
toWorld
Map client coords into the SVG root's frame; stable under rotation (unlike
toLocal). Returns(0, 0)when detached.Parameters
- evt: { clientX: number; clientY: number }
Returns V
track
Register a disposer to run on
dispose().Parameters
- dispose: () => void
Returns void
u
until
Properties
ReadonlyangleAt
Readonlyaside
ReadonlyatDistance
Readonlybox
Local-frame box; reach into .x, .center, .at(u,v), etc.
Readonlyclosed
Readonlyel
Optional Readonlyintrinsic
Readonlylength
ReadonlylocalFrame
Composed local-frame matrix: T(t) T(p) R(r) S(s) T(-p).
ReadonlynormalAt
Readonlyopacity
Readonlyorigin
parent
Back-link set by add(); cleared by dispose(). Non-reactive.
ReadonlypointAt
Sample at t ∈ [0, 1]. Named to avoid shadowing the Box at(u, v)
anchor — same symmetry as tangentAt / normalAt / angleAt.
Open or closed polyline through a reactive list of Points.
path(start, opts?).to(p2).to(p3) — fluent (preferred) new Path([p1, p2, p3], opts?) — explicit array
Extension methods (
to/u/d/l/r/offset/along) mutate in place and returnthis. Thedattribute and all sampling methods react to point changes automatically.