fin1te/dsv1.0.0
  1. ds
  2. Components
  3. 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.

CustomersExternalAPIComputePostgreSQLStorageSchedulerControl planeGPU nodeWorkload

io · compute · store · control · host

Shapes

boxpillcylinderhexdiamondcircledoccloud

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.

data ->control ~>fallback ..>stream =>SourceTargetSourceTargetSourceTargetSourceTarget

-> ~> ..> =>

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.

dashed · defaultsolidtint · tenant Atint · tenant BServiceServiceServiceService

zone … dashed | solid | tint tone=…

Details

Replicasstack=3Healthystatus=okDegradedstatus=warnDownstatus=downBadgebadge=v2v2AgentbusyRouterglowIngestpulse

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>
ClassOnWhat it does
.tpsvgScopes the whole diagram layer.
.node.io|compute|store|control|hostgA component. Parts: .body, .ghost (stack), .lip, .hfill, .ico, .nl, .ns, .badge, .status, .busy.
.tone-*.node, .edge, .zoneSets --tc and --tw from a tone.
.glow / .pring.node, pathBreathing halo, pulse ring.
.edge.data|control|fallback|streamgA link. Parts: .base, .flow, .pulse, .comet, .pkt, .elabel.
.zone.dashed|solid|tintgA boundary. Parts: .zr, .zl.
.focusing / .near / .onsvg, gHover state: everything not .near or .on dims.
.stillsvgPauses every animation (off screen, or exports).