Skip to content

System map

A network of systems as a connections map, plus one system with what uses it and what it uses.

<p>Every system is a card and every tie a wire: the shared packages in the middle lane, each group of the rest on the side that crosses least. Point at a card or tab to it to light its wires and the systems at their ends; a tap opens it.</p>
<div data-mount="network"></div>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/system-map.css";
import { enhance } from "capsomer/behavior/system-map";

enhance();

Usage

import { enhance, modelMapData, systemMapHtml } from "capsomer/behavior/system-map";
const data = modelMapData(model, (id) => `/systems/${id}`);
network.innerHTML = systemMapHtml(data, { id: "network", label: "The network" });
one.innerHTML = systemMapHtml(data, { id: "system", system: "foxing", label: "Foxing" });
enhance(document);

Examples

A card lit, its ties shown

<p>Carrel lit: its wires go accent, and the systems it uses and the ones that use it keep their color and say how they are tied; the rest fade. On a shared package this is the impact view: everything a change to it reaches.</p>
<div data-mount="lit"></div>

One system

<p>Capsid: what uses it, its parts in three lanes (Runs, Stores, Outside, each part with its own lines in words), and what it uses, wired together. Point at a part or a tie to light its wires. Below, its flows as ordered steps.</p>
<div data-mount="system"></div>

A flow at a step

<p>A job's life at its fifth step: the parts it touches and the wires between them lit, the part it moves toward with the heaviest edge, and the step marked in the list. Back and Next step it; Escape stops.</p>
<div data-mount="step"></div>

A card under the pointer and with keyboard focus

<p>Forced states on a map that is not enhanced: Prelum under the pointer, Carrel with the focus ring.</p>
<div data-mount="states"></div>

As delivered with no script

<p>No wires without a script: every card is a link, every tie and line is words, and each flow is an ordered list.</p>
<div data-mount="noscript"></div>

API reference

Functions

FunctionSignatureDoes
controller(root: HTMLElement): SystemMapControllerThe map's behavior on one root; enhance calls it for every map on the page.
enhance(root?: ParentNode): () => voidEnhances every system map under root not yet enhanced; returns a function that detaches them.

Parts and data attributes

ClassIs
.cap-system-mapthe root
.cap-system-map-captiona part
.cap-system-map-carda part
.cap-system-map-card-abouta part
.cap-system-map-card-domaina part
.cap-system-map-card-fulla part
.cap-system-map-card-metaa part
.cap-system-map-card-namea part
.cap-system-map-card-privatea part
.cap-system-map-card-tiea part
.cap-system-map-cardsa part
.cap-system-map-cella part
.cap-system-map-cell-namea part
.cap-system-map-columna part
.cap-system-map-column-namea part
.cap-system-map-columnsa part
.cap-system-map-comba part
.cap-system-map-comb-cellsa part
.cap-system-map-comb-groupa part
.cap-system-map-detaila part
.cap-system-map-flowa part
.cap-system-map-flow-controlsa part
.cap-system-map-flow-namea part
.cap-system-map-flow-statusa part
.cap-system-map-flow-texta part
.cap-system-map-flowsa part
.cap-system-map-grapha part
.cap-system-map-group-counta part
.cap-system-map-group-namea part
.cap-system-map-heada part
.cap-system-map-hexa part
.cap-system-map-lanea part
.cap-system-map-networka part
.cap-system-map-nonea part
.cap-system-map-parta part
.cap-system-map-part-abouta part
.cap-system-map-part-fulla part
.cap-system-map-part-kinda part
.cap-system-map-part-linesa part
.cap-system-map-part-namea part
.cap-system-map-partsa part
.cap-system-map-place-namea part
.cap-system-map-porta part
.cap-system-map-stepsa part
.cap-system-map-switcha part
.cap-system-map-tiea part
.cap-system-map-tie-namea part
.cap-system-map-tie-verbsa part
.cap-system-map-tiesa part
.cap-system-map-titlea part
.cap-system-map-viewsa part
.cap-system-map-wirea part
.cap-system-map-wiresa part
AttributeValues
data-atpresent or absent
data-bothpresent or absent
data-columninside
data-levelnetwork
data-linkpresent or absent
data-litpresent or absent
data-onpresent or absent
data-onlypresent or absent
data-placeoutside stores
data-places2 3
data-privatepresent or absent
data-ringcore shared
data-steppresent or absent
data-tieself
data-wirepresent or absent
StateRead from
:emptythe platform
:focus-visiblethe platform
:focus-withinthe platform
:hoverthe platform
[aria-current="step"]an attribute
[hidden]an attribute

Accessibility

KeyDoes
TabMoves between the systems' names (each a link: a hexagon, or a card on the plain map) and, on a system, the ties and the flows' buttons. Focusing a system or a tie lights its lines and ties
Right arrow, Left arrowOn the view tabs, moves between Hexagons and Plain map and shows it
EnterOpens the system focused; on a flow's button, steps
EscapeInside a flow, stops it
  • Every card is a list item with its name as a heading and a link stretched over the card, so a tap anywhere opens it and a screen reader hears the name alone as the link.
  • The groups and bands are sections named by their headings; level 2's columns and flows are too.
  • The hexagons' drawing is a group named by the map's title. Each system in it is a link whose name starts with the words it shows and then gives the full name ("Dustin, dustinedwards.info"); the comb, its lines and the group names are hidden from assistive technology, since the plain map holds the same ties as words. The two views are tabs (components/tabs), and with no script both show, one after the other.
  • The wires are one SVG hidden from assistive technology (aria-hidden), and the lighting is a convenience over what the cards already say (each card's counts, level 2's columns and each part's lines in words), so the line that says how a card is tied is hidden too. A screen reader meets the same ties as text, in reading order: the network's lanes left to right, each block's cards top to bottom (W3C WAI, complex images: the information a drawing carries is in the text beside it).
  • The detail line repeats words already in the cards and parts, so it is hidden from assistive technology.
  • A flow's status line is a polite live region; focus stays on the button pressed, or moves to Back when Next ends the flow.
  • Text 4.5:1 on its card in both themes, lit and muted; edges, lit wires and the focus ring 3:1. In forced colors wires are CanvasText and a lit card's edge and wires are Highlight.