Hub-and-Spoke

A hub-and-spoke diagram. A central node radiates connections to surrounding spoke nodes. Used for showing a central concept with related elements, or a hub with connected services.

Fields

FieldRequiredTypeDescription
kindyes"hub_spoke"Must be exactly "hub_spoke"
titlenostringTitle rendered above the diagram
centeryesstringLabel for the central hub node
spokesyesarray of SpokeAt least two spokes required

Spoke fields

FieldRequiredTypeDescription
labelyesstringText displayed in the spoke node
emphasisnostring"primary" or "secondary". See schema.
statusnostring"success", "normal", "warning", or "critical". See schema.

Rendering rules

  • The center node is rendered at the center of the diagram.
  • Spoke nodes are arranged evenly around the center in a circle.
  • Lines connect the center node to each spoke node.
  • The center node is visually distinguished from spoke nodes (larger, different color).
  • Spoke nodes use the base color; the center uses the apex color.

Example

Cloud Architecture API Gateway at the centre, connected to Auth Service, User Service, Order Service, Payment Service, Notification. Cloud Architecture Auth Service User Service Order Service Payment Service Notification API Gateway

Label capacity

How long a label can be before the engine sets it smaller, wraps it, or cuts it short with "…". Each number is measured by rendering a small reference declaration with a growing label and reading the diagnostics render_detailed returns, so the table always agrees with them. Lengths are in characters written without spaces: Hangul syllables are one em wide, Latin lowercase letters about half that. unchanged is the longest label shown at the usual size on one line; whole is the longest shown without "…". A slot's width depends on its siblings, so read a number as a guide for the reference declaration named in the second column and use declart validate --strict for the declaration itself.

A dash means the engine reports nothing for the slot up to 120 characters. That is not a promise that any length fits: a slot the engine does not fit at all draws a long label past the picture without a warning.

SlotMeasured inHangul (unchanged / whole)Latin (unchanged / whole)
center3 spokes9 / 922 / 22
spokes[].label3 spokes9 / 915 / 15

Schema

What a declaration of this kind may contain, as declart schema and schema() report it. The value lists and counts are the ones the parser checks, and a test holds every field, count and rule to the parser in both directions, so a declaration written to this page parses. The prose above is the explanation; this is the reference.

Fields

FieldTypeRequiredValues / meaning
kindenumyeshub_spoke
titlestringno
centerstringyes

spokes — 2 or more elements

FieldTypeRequiredValues / meaning
labelstringyes
emphasisenumnoprimary, secondary
statusenumnosuccess, normal, warning, critical