Class Curve<O>
Type Parameters
Hierarchy
- Shape<O>
- Curve (View Summary)
Index
Accessors
Constructors
Methods
Properties
Accessors
bottom
center
left
right
segs
Untracked snapshot of the segment list.
Returns readonly CurveSegment[]
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
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
dispose
Returns void
effect
Reactive effect torn down with the shape.
Parameters
- fn: () => void
Returns void
ellipseArc
Append an elliptic-arc segment.
a0,a1are parametric angles in the ellipse's rotated frame.Parameters
- center: V
- a: number
- b: number
- rotation: number
- a0: number
- a1: number
Returns this
on
Parameters
- name: string
- handler: (e: Event) => void
Optionalopts: AddEventListenerOptions
Returns () => void
pointAt
remove
Parameters
- ...toRemove: AnyShape[]
Returns void
segments
Segments for the dashed renderer: lines pass through, circular arcs (
a ≈ b, rotation ≈ 0) become native arcs, other ellipse arcs tessellate.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
tangentAt
to
Append a line segment to
p.Parameters
- p: V
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
until
Properties
Readonlyaside
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).
Readonlyopacity
Readonlyorigin
parent
Back-link set by add(); cleared by dispose(). Non-reactive.
Piecewise curve with line and ellipse-arc segments.