Diagrams

Diagrams diagram primitive + the Mermaid v10 type catalog the kit ships with. Reference · Mermaid ## Diagram + Mermaid {#diagrams} ### diagram {#diagram} Mermaid-rendered. Lazy-loads Mermaid 10 from the CDN on first ` ` encountered on the page. `source` is any Mermaid syntax (flowchart, sequence, gantt, state, class). Re-renders on theme toggle so colors track light/dark. ### Supported Mermaid types {#mermaid-supported} The diagram primitive forwards source to Mermaid v10 with theme:'base'; no diagram type is gated. Tested in this kit: flowchart, sequence, class, state, ER, journey, gantt, pie, requirement, gitGraph, c4, mindmap, timeline, quadrantChart, sankey-beta, xychart-beta, block-beta, packet-beta, architecture-beta. Each one inherits the page's accent / surface / text tokens via the kit's themeVariables map, so light/dark mode tracks automatically. ### sequence {#mermaid-sequence} Actors / lifelines / signals — best for protocol or call flows. ### state {#mermaid-state} Finite state machine — transitions trigger on events; great for editor / draft / published flows. ### ER (entity-relationship) {#mermaid-er} Primary keys / cardinality. Mirrors what the schema-design skill emits. ### class {#mermaid-class} UML-style class shape with attributes, methods, and inheritance arrows. ### gantt {#mermaid-gantt} Tasks over time, with dependencies and the critical path. ### pie {#mermaid-pie} Simple distribution — limit to ≤6 slices for readability. ### journey {#mermaid-journey} User journey scoring across stages — quick triage of friction points. ### mindmap {#mermaid-mindmap} Tree of related ideas radiating from a central node. ### timeline {#mermaid-timeline} Linear sequence of events, grouped by section. ### sankey-beta {#mermaid-sankey} Flow / share between stages. Use for funnels, energy, traffic. > [!WARNING] Sankey labels have to be ASCII > Mermaid v10 reads the sankey body as CSV, and that grammar rejects a > non-ASCII character in a label whether it is quoted or not. > `Ziyaretçiler,Kayıtlar,40` fails with `Parse error on line 2`, and > `"Ziyaretçiler","Kayıtlar",40` fails the same way; the block renders as > the kit's error card carrying the source. `Ziyaretciler,Kayitlar,40` > parses. Spaces inside a label are fine — `Visitor Count,Sign Ups,40` > renders. > > The limit is Mermaid's, not the kit's, and it is specific to this > diagram type: a flowchart node reading `A[Ziyaretçiler]` renders > without complaint. Transliterate the labels, or pick a diagram type > that accepts them. ## Drawing your own {#hand-drawn} Mermaid covers topology. When the figure needs a real axis, a before / after split, or a shape Mermaid has no grammar for, draw the SVG yourself in an HTML island — the island has no restrictions. The one thing you must not do is reach for a hex literal. A hardcoded colour is how a figure ends up invisible in the theme nobody was looking at: dark ink on the dark surface, a pale box on the pale one. `oku check` says so as `island-hand-styled`. These classes are what it is telling you to use — every one of them is driven by the same tokens the rest of the page uses, so the figure follows the page accent and both themes for free. node accent ok warn fail .okt-diag-node .accent .ok .warn .fail reader writer .okt-diag-group .okt-diag-edge .dashed .strong Five node fills, a group region, three edge weights. Every fill, stroke and text colour above is a CSS variable, so the same markup renders correctly in both themes and follows whatever accent the tree is set to. `.okt-diag-label` also takes `.strong`, `.soft`, `.faint` and `.mono`; `.okt-diag-arrow` takes the same status modifiers as the edge, because a ` ` paints with its own fill and the line's stroke colour never reaches it. For a figure that encodes a category per shape, `.okt-diag-fill-1` through `-10` are the chart ramp, so a hand-drawn figure sits in the same palette as every chart around it.