StringTune/Docs

API Reference

GridAdapter

Abstract adapter base for SVG-backed grid overlays in the grid subsystem.

GridAdapter

GridAdapter is the abstract base used by the grid subsystem to render SVG-backed grid overlays.

Public status

GridAdapter is exported by the package root, but it belongs to a specialized subsystem and is not part of the common built-in module path.

What it does

An adapter defines:

  • a unique type
  • a human-readable label
  • an icon
  • default settings
  • a UI schema
  • the actual SVG render logic

Abstract contract

You implement:

  • type
  • label
  • icon
  • getDefaults()
  • getUISchema()
  • render(svg, width, height, settings)

Built-in helpers

The base class already gives helpers for:

  • clearing the instance group
  • getting a scoped <g> group
  • creating SVG lines
  • creating SVG rects
  • creating SVG paths
  • resolving px, %, vw, and vh units

When to use it

Use it only if:

  • your project is intentionally building on top of the grid tooling
  • you need a new SVG grid renderer
  • you control the grid integration around it

Practical note

For most StringTune users, GridAdapter is runtime reference, not a primary integration entry point.