Class TexShape<Names>

    A LaTeX-rendered shape with addressable Parts. See tex (factory) and parts.ts (Part / PartMarker).

    Type Parameters

    • Names extends string = string
    Hierarchy
    Index

    Accessors

    • get svgRoot(): SVGSVGElement | null

      Nearest enclosing <svg> root, or null if this shape isn't mounted under one. Used by drag helpers that need world-space cursor coords.

      Returns SVGSVGElement | null

    Constructors

    Methods

    • Bind one SVG attribute; static sets once, reactive runs as effect.

      Parameters

      • name: string
      • val: Val<string | number>
      • target: "intrinsic" | "wrapper" = "intrinsic"

      Returns void

    • Bind several attributes at once — this.attrs({ cx, cy, r }).

      Parameters

      • map: Record<string, Val<string | number>>
      • target: "intrinsic" | "wrapper" = "intrinsic"

      Returns void

    • Sugar: eq.highlight("a")eq.parts.a.highlighted.value = true.

      Parameters

      • name: Names
      • on: boolean = true

      Returns void

    • Parameters

      • name: string
      • handler: (e: Event) => void
      • Optionalopts: AddEventListenerOptions

      Returns () => void

    • Wire stroke / fill / dashed for a stroked shape. nativeAttrs binds the shape's native geometry (e.g. {cx, cy, r} for circle); it's skipped when opts.dashed since the intrinsic is then a <path> whose d is driven by segments().

      Parameters

      • opts: CommonOpts
      • closed: boolean
      • OptionalnativeAttrs: Record<string, Val<string | number>>

      Returns void

    • Map client coords into this shape's local frame.

      Parameters

      • evt: { clientX: number; clientY: number }

      Returns V

    • 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

    • Register a disposer to run on dispose().

      Parameters

      • dispose: () => void

      Returns void

    Properties

    aside: boolean
    box: Box

    Local-frame box; reach into .x, .center, .at(u,v), etc.

    el: SVGGElement
    height: Cell<number>

    Height in local-frame user units.

    intrinsic?: SVGElement
    localFrame: Cell<V>

    Composed local-frame matrix: T(t) T(p) R(r) S(s) T(-p).

    opacity: Writable<Num>
    origin: Writable<Vec>
    parent: AnyShape | null = null

    Back-link set by add(); cleared by dispose(). Non-reactive.

    parts: PartList<Names>
    rotate: Writable<Num>
    scale: Writable<Vec>
    translate: Writable<Vec>
    width: Cell<number>

    Width in local-frame user units (the rendered MathML bounding rect).