Spring Nodes

Category: Effects & motion

Live preview
WebAPIDatabaseAuthCacheQueue
  • Web: linked to API, Auth
  • API: linked to Web, Database, Auth, Cache, Queue
  • Database: linked to API
  • Auth: linked to API, Web
  • Cache: linked to API
  • Queue: linked to API

Mass-spring graph: nodes repel each other (Coulomb) and are held by Hooke springs on defined edges. By default a settled, static layout computed server-side, so it works everywhere, including print and assistive tech. Drag-to-pin with live springs is opt-in with interactive: true.

Surfaces
google-apps-script-webwebgoogle-meet-stagemcp-appsandroid
Fields
FieldTypeRequired
nodesarray. Array of {id, label} objects. Defaults to 6 labelled nodes.optional
edgesarray. Array of {a, b} index pairs for spring connections.optional
colourstring. Node and edge accent colour. Defaultoptional
bgstring. Background colour. Defaultoptional
heightinteger. Canvas height px. Default 420.optional
rest_lengthinteger. Spring rest length px. Default 110.optional
interactiveboolean. Default false: a settled, static layout that works everywhere and for assistive tech. Set true when the atom is shown in a live browser or app view and the viewer should be able to play with the graph: drag nodes to pin them, watch the springs react. Ignored under reduced motion and on static surfaces (print, slides, email, chat, and any surface that strips scripts).optional
Example payload
{
  "type": "spring_nodes"
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:spring_nodes",
  "displayName": "Spring Nodes",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/spring_nodes/",
  "capabilities": [
    "google-apps-script-web",
    "web",
    "google-meet-stage",
    "mcp-apps",
    "android"
  ],
  "description": "Mass-spring graph: nodes repel each other (Coulomb) and are held by Hooke springs on defined edges. By default a settled, static layout computed server-side, so it works everywhere, including print and assistive tech. Drag-to-pin with live springs is opt-in with interactive: true.",
  "representativeQueries": [
    "show a mass-spring graph, settled static layout by default; interactive true adds drag-to-pin physics",
    "mass-spring graph: nodes repel each other (coulomb) and are held by hooke springs on defined edges.",
    "render a spring nodes"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →