- ds
- Components
- Diagram primitives
Diagram primitives
Kinds, shapes, links, zones and details.
These are topo's own SVG primitives, rendered by topo at build time and styled by the diagram layer of ds.css. Anything that outputs the same markup gets the same look, in both themes, including exports.
Kinds
A component's kind is what it is, and it sets the outline. Compute is ink, storage is amber with a lip, control planes are dashed on a sunk fill, workloads are hatched, externals sit on the page colour.
io · compute · store · control · host
Shapes
shape=box pill cylinder hex diamond circle doc cloud
Links
Data flows in the accent. Control is dashed and does not move. Fallback and physical links are dotted. Streams are thicker and carry packets.
-> ~> ..> =>
Zones
Zones are real boundaries: a cluster, a VPC, a tenant. The label sits above the top-left corner, in its own layer so links never cover it.
zone … dashed | solid | tint tone=…
Details
stack · status · badge · busy · glow · pulse
Markup
<svg class="tp" viewBox="…">
<g class="l-zones"><g class="zone tint tone-purple"><rect class="zr" …/></g></g>
<g class="l-edges">
<g class="edge data" data-from="api" data-to="db">
<path class="base" marker-end="url(#arr)"/><path class="flow"/>
<text class="elabel">writes</text>
</g>
</g>
<g class="l-nodes">
<g class="node store" data-node="db">
<rect class="body" …/><line class="lip" …/>
<g class="ico">…</g><text class="nl">PostgreSQL</text><text class="ns">primary</text>
<circle class="status ok" …/>
</g>
</g>
</svg>| Class | On | What it does |
|---|---|---|
.tp | svg | Scopes the whole diagram layer. |
.node.io|compute|store|control|host | g | A component. Parts: .body, .ghost (stack), .lip, .hfill, .ico, .nl, .ns, .badge, .status, .busy. |
.tone-* | .node, .edge, .zone | Sets --tc and --tw from a tone. |
.glow / .pring | .node, path | Breathing halo, pulse ring. |
.edge.data|control|fallback|stream | g | A link. Parts: .base, .flow, .pulse, .comet, .pkt, .elabel. |
.zone.dashed|solid|tint | g | A boundary. Parts: .zr, .zl. |
.focusing / .near / .on | svg, g | Hover state: everything not .near or .on dims. |
.still | svg | Pauses every animation (off screen, or exports). |