Life in Glyph · RFC #9 · bio extension

Draw me a neuron

A single pyramidal neuron. You asked Claude. Glyph drew it — from a compose spec. Dendrites on the left collect input; the soma integrates it; the axon on the right fires an action potential down to the synaptic terminals.

▸ The prompt
"Draw me a neuron firing. Soma in the middle with a nucleus. Dendrites branching out to the left. A long axon to the right with myelin sheaths, ending in synaptic terminals. A warm halo around the soma to suggest action-potential glow."

— what to say to your AI agent. Claude writes the Glyph compose spec; the compose compiler emits one byte-locked SVG.

A pyramidal neuron: purple-yellow soma with a dark nucleus, five branching cyan dendrites fanning to the left, a long horizontal axon to the right wrapped in cream-yellow myelin-sheath ellipses, and four branching synaptic terminals at the far right with a soft glow.

One scene, three primitives

RFC #9's defs (gradients + patterns), shapes (silhouette-path, polygon, polyline, ellipse), and accents (glow, starfield, icon) compose the whole picture.

PRIMITIVE 1
silhouette-path × 6

Dendrites & axon

Five dendrite paths fan out from the soma — each one a hand-sampled branching d-string with sub-twigs at the tips. The axon is a single line; six myelin sheaths along it are ellipses.

PRIMITIVE 2
ellipse + radial gradient

The cell body

An ellipse with a 3-stop radial gradient (cream → purple → indigo). The nucleus is a smaller circle. A glow halo (radial-gradient driven) sits behind the soma at radius 130.

PRIMITIVE 3
starfield seed 23 + glow

The dark + the synapse

60 stars seeded at 23 paint the dark backdrop. A second glow halo at the axon terminal — radius 60 — is the moment the action potential reaches the synapse.

How Glyph drew it

Claude writes the compose JSON; Glyph's compose compiler turns it into byte-identical SVG.

The compose spec JSON · excerpt

{
  "compose": {
    "viewBox": { "width": 1000, "height": 500 },
    "theme": { "background": "#020617" },
    "defs": {
      "gradients": [
        { "id": "g-cell", "kind": "linear",
          "x1": "0%", "y1": "0%", "x2": "100%", "y2": "0%",
          "stops": [
            { "offset": "0%",  "color": "#a78bfa" },
            { "offset": "50%", "color": "#22d3ee" },
            { "offset": "100%","color": "#fde68a" }
          ]
        },
        // ... g-soma (radial), g-pulse (radial halo), g-bg
      ]
    },
    "children": [
      // 1. background rect (radial gradient)
      // 2. starfield · 60 stars · seed 23
      // 3. 5 dendrite silhouette-paths
      // 4. axon silhouette-path (3px stroke)
      // 5. 6 myelin-sheath ellipses
      // 6. soma glow halo (radius 130)
      // 7. soma ellipse + nucleus circle
      // 8. 4 synaptic terminal paths + boutons
      // 9. synapse glow halo (radius 60)
      // 10. 5 italic labels
    ]
  }
}

Generator script: scripts/gen-showcase-extensions.mjs · fixture: packages/core/__fixtures__/compose/bio-neuron.json. View on GitHub.

Glyph compose output SVG

Glyph-rendered draw me a neuron, same SVG as the hero stage

Byte-stable across Ubuntu / macOS / Windows × Node 20 / 22. The compose compiler resolves the gradient + pattern defs first, then walks children in z-order.

More Life in Glyph

See the gallery ↗ DNA Heartbeat Jellyfish