dsh-diagram-leapavid 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -17
- package/client.js +24 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,25 +55,16 @@ profile 的依赖。装好后确认技能目录里有 `diagram-design`,并且
|
|
|
55
55
|
|
|
56
56
|
### 2. 安装本插件
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
本插件已发布到 npm:[dsh-diagram-leapavid](https://www.npmjs.com/package/dsh-diagram-leapavid)(当前 0.1.0)。
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
ln -s "$PWD" ~/.dsh/profiles/desktop/node_modules/dsh-diagram-leapavid
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
然后在 `~/.dsh/profiles/desktop/package.json` 里做两件事:
|
|
60
|
+
推荐用 DSH 的插件命令装进 desktop profile:
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```json
|
|
69
|
-
{
|
|
70
|
-
"dependencies": {
|
|
71
|
-
"dsh-diagram-leapavid": "file:/absolute/path/to/dsh-diagram-leapavid"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
62
|
+
```bash
|
|
63
|
+
dsh plugin --profile desktop add dsh-diagram-leapavid
|
|
74
64
|
```
|
|
75
65
|
|
|
76
|
-
|
|
66
|
+
装好后确认 `~/.dsh/profiles/desktop/package.json` 的 `dsh.profile.bundles` 里包含
|
|
67
|
+
`"dsh-diagram-leapavid"`。如果插件命令只装了依赖、没有写入 bundles,手动补上:
|
|
77
68
|
|
|
78
69
|
```json
|
|
79
70
|
{
|
|
@@ -90,8 +81,27 @@ ln -s "$PWD" ~/.dsh/profiles/desktop/node_modules/dsh-diagram-leapavid
|
|
|
90
81
|
|
|
91
82
|
改完后重启 DSH。侧栏应该出现 **LeapAvid图表工坊** 入口,点开能看到 50 张图型卡片。
|
|
92
83
|
|
|
93
|
-
> 如果侧栏没有出现,先检查包名是否写进了 `bundles
|
|
94
|
-
>
|
|
84
|
+
> 如果侧栏没有出现,先检查包名是否写进了 `bundles`,再看 DSH 日志里有没有
|
|
85
|
+
> client bundle 404。
|
|
86
|
+
|
|
87
|
+
#### 开发模式:从本地仓库软链
|
|
88
|
+
|
|
89
|
+
想在改代码后立即看到效果时,把仓库软链到 desktop profile,并在
|
|
90
|
+
`dependencies` 里用绝对路径的 `file:` 依赖:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
ln -s "$PWD" ~/.dsh/profiles/desktop/node_modules/dsh-diagram-leapavid
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"dsh-diagram-leapavid": "file:/absolute/path/to/dsh-diagram-leapavid"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
同样确认 `dsh.profile.bundles` 里包含包名,然后重启 DSH。
|
|
95
105
|
|
|
96
106
|
## 使用
|
|
97
107
|
|
package/client.js
CHANGED
|
@@ -3,6 +3,11 @@ window.__ModuleLoader__.load({
|
|
|
3
3
|
factory: function (require) {
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var h = React.createElement;
|
|
6
|
+
var viewReset = null;
|
|
7
|
+
function requestListView() {
|
|
8
|
+
if (typeof viewReset !== 'function') return;
|
|
9
|
+
try { viewReset(); } catch (e) { /* reset must not break the host click */ }
|
|
10
|
+
}
|
|
6
11
|
var DATA = [{"slug":"architecture-delta","title":"Architecture delta","bestFor":"explaining a system migration, service extraction, infrastructure redesign, or integration change through two synchronized topology snapshots. Show which components and relationships survive, appear, disappear, change their properties, move, or reconnect.","lead":"Not this type: ","zh":"架构变更对比","example":"example-architecture-delta.html","sections":[{"h":"Layout conventions","items":["Three panels, one reading order: Before · Changes · After. Both topology panels use the same width, height, and internal grid pitch. The center panel is a short change ledger, not a third topology. Name the two snapshots with meaningful versions or dates.","Keep the mental map stable. Start by copying the Before coordinates into After. Move a retained component only when its movement is part of the story and receives a MOVED entry. Do not independently run a layout algorithm on each panel.","Panel positions are not component positions. Put each snapshot in one SVG <g transform=\"translate(x y)\">; write component bounds and relationship paths in local coordinates. The Before and After origins share one y-coordinate, with the ledger occupying the horizontal gap.","Shared grid: use a 4px pitch by default. Every component's local x, y, width, and height is a multiple of that pitch. The shipped example uses two 336 480 4 grids; scale the overall SVG responsively without changing their local geometry.","Budget: at most 8 unique components, 10 unique relationships, and 8 ledger entries across the complete comparison. A retained ID counts once, not once per snapshot. A component that is both changed and moved consumes two ledger entries. Split larger migrations into named subsystems or phases; never drop edges to fit.","Connectors: use Architecture's rounded orthogonal routing and port rules. In this type, even straight connectors are <path> elements so relationship identity and endpoints have one grammar. Draw paths before components. A stable relationship may take a different route to meet a moved component without becoming REWIRED.","Nodes: print the same stable ID in both states along with the human-readable name. Treat names, responsibilities, implementation versions, and protocols as semantic attributes; identities survive a rename when the underlying object survives.","Ledger: one brief entry per (object ID, change) pair. Begin with the uppercase change word, name the object, and state the actual difference. Do not describe unchanged objects in the ledger. Keep a readable text measure, with wrapped <tspan> lines when needed.","Responsive presentation: preserve the three-panel comparison on small screens with an accessible horizontal scroll region and a visible scroll hint. Do not compress labels until they become illegible or stack snapshots into independently scaled pictures. Print and export keep the whole comparison."]},{"h":"Change vocabulary and redundant encoding","items":["Color is secondary. Every change is readable from text plus a shape or line treatment; unchanged objects remain quiet context. Use the existing skin tokens and reserve the accent for the editorial focus, rather than assigning five status colors.","State · Meaning · Non-color treatment","unchanged · Same identity, semantics, position, and endpoints · Plain solid outline; no ledger entry","added / ADDED · Present only in After · + badge or plus-shaped marker; solid outline","removed / REMOVED · Present only in Before · − badge and dashed outline/path","changed / CHANGED · Retained object whose semantic signature differs · Δ badge or inset rule, plus an explicit old → new ledger description","moved / MOVED · Retained component whose local x or y differs · Direction/position marker and a ledger entry naming the relocation","rewired / REWIRED · Retained relationship whose ordered source/target IDs differ · Distinct dash treatment or endpoint marker, with old → new endpoints written in the ledger","Do not use a missing After node to stand for a removal without a REMOVED entry. Do not substitute an ADDED edge for a REWIRED edge just to avoid explaining endpoint identity. A replacement component gets a new stable ID and separate removal/addition entries; its location alone cannot establish continuity."]},{"h":"Public HTML metadata contract","items":["This is the authoring and validation surface, not a serialization inferred from visible labels. All attributes below are required where applicable; empty, boolean, duplicate, or malformed declarations are findings. IDs are case-sensitive and match [A-Za-z][A-Za-z0-9_.:-]*; they contain no whitespace."]},{"h":"Verification and its boundaries","items":["Run python3 scripts/verify-architecture-delta.py --all (or pass explicit HTML paths) and python3 scripts/test-verify-architecture-delta.py. No arguments also checks shipped examples. The stdlib HTML parser reads real attributes, including unquoted values and entities, ignores comments, and rejects malformed SVG nesting. Synthetic fixtures prove both legal cases and adversarial changes independently of the shipped coordinates; the light, dark, and full variants are checked too.","The verifier enforces the declared structure, differential semantics, grid/bounds geometry, drawn relationship endpoints, budgets, and exact ledger coverage. It rejects CSS transforms/position overrides, CSS sizing that could change bounds, escaped CSS declarations, explicit hidden objects/ledger, and common CSS hiding rules. Ordinary responsive sizing of the outer SVG remains legal.","It is not a browser renderer or a proof of the source system. Authors remain responsible for honest signatures, labels matching those signatures, readable shape/dash treatments, and an accurate migration story. Exotic CSS cascade/variable effects, clipping and occlusion, connector crossings, intermediate segment clearance, ledger placement, and screen-reader quality still require the normal skin, accessibility, geometry, and rendered-layout gates plus desktop/mobile visual review. Keep semantic geometry in the SVG attributes instead of making CSS part of the data model."]},{"h":"Anti-patterns","items":["Two independently arranged snapshots that manufacture apparent movement.","A center ledger that says only “updated” without naming the object and difference.","Color-only statuses or a separate bright color for every kind of change.","Unchanged node positions drifting to make room, with no MOVED entry.","Semantic edits hidden behind an unchanged signature, or all signatures regenerated just because the snapshot changed.","Redrawing an edge to a different component while keeping its endpoint metadata unchanged.","Counting retained objects twice to justify dropping other objects from the comparison.","Treating this comparison as an executable migration plan. Ordering, rollback, availability, and data consistency need their own explanation."]}]},{"slug":"architecture","title":"Architecture","bestFor":"system overviews, data-flow diagrams, integration maps, infra topology.","lead":"","zh":"架构图","example":"example-architecture.html","sections":[{"h":"Layout conventions","items":["Group components by tier or trust boundary (frontend → backend → data; public → private).","Primary flow runs left→right or top→down. Pick one and hold it.","Draw arrows before boxes so z-order puts connections behind components.","1–2 coral focal nodes: the primary integration point, the primary data store, or the key decision node.","Dashed boundary rectangles mark regions (VPC, security group, trust zone); labels sit on a paper-colored mask over the boundary line."]},{"h":"Connector style","items":["Rounded right-angle (orthogonal) connectors are MANDATORY for all non-horizontal/vertical connections — diagonal <line> between off-axis nodes is a hard fail (see SKILL.md §6 Mandatory connector rules). Two-bend elbow path with r=8:","Flip the vertical signs for right+up. Use a plain <line> only when endpoints share the same x or y. Arrow labels sit on the vertical segment, centered horizontally on mid and vertically between the two corners.","Port selection for vertical connectors. When the destination is noticeably above or below the source, enter the destination through its top or bottom edge. Use a single-bend L-path: leave the source through the side edge that faces the destination's column, run horizontally, turn once, and run vertically into the destination:","Every segment leaves its box perpendicular to the edge it starts on. Never start a horizontal segment on a top or bottom edge: it runs along the border, hidden behind the node fill, and the arrow looks like it grows out of the corner. When two of these connectors leave the same side edge, fan their ports (primitives-core.md rule 4) and keep each port at least 8px from a corner so it never lands on the corner radius.","Reserve left/right ports on the destination for connections that travel primarily horizontally. Entering a node from the side on a mainly-vertical path looks like the arrow punctures the node face rather than arriving from above or below.","Dashed paths — same routing rules. Optional, return, async, and passive flows use stroke-dasharray=\"4,3\" and a lighter stroke weight (stroke-width=\"1\"). Apply the same orthogonal routing, port-selection, and bridge/hop rules as solid paths — the dash pattern only communicates semantic weight, not a different routing grammar. When a dashed path and a solid path must cross, bridge the dashed one (it is by definition the less important connection).","Zone label margin. Leave ≥16px between the bottom of the zone eyebrow label and the top of the first enclosed node. Size the zone rect tall enough to contain this header gap (zone y = node_top − 32; label mask y = zone_y + 4)."]},{"h":"Crossing arrows — bridge / hop","items":["When two orthogonal arrows must cross, add a small arc (hop/bridge) on the less important arrow at the crossing point. The more important arrow is drawn uninterrupted.","a 8,8 0 0,1 16,0 is an SVG arc: rx=ry=8, large-arc=0, sweep=1 (curves visually upward), advancing 16px right — creating an 8px-radius semicircular bump over the crossing. For a vertical hop over a horizontal, use a 8,8 0 0,0 0,16 on the vertical path.","Decide which arrow to bridge: bridge the one that is less semantically important (passive, secondary, write-back), or the one with lighter stroke weight (dashed, muted). Never bridge both."]},{"h":"Zone grouping","items":["Group 2+ nodes that serve the same tier or trust boundary with a zone rect — drawn before arrows and nodes (z-order: bg → zones → arrows → nodes):","Rules:","Leave 12–16px above the first enclosed node — the eyebrow label sits in this margin.","Zone fill: ink @ 0.02 (2% ink wash). Any stronger competes with node fills.","Zone label: soft, never ink at an opacity. A zone eyebrow is a boundary label, and soft is the boundary-label role in style-guide.md. An opacity such as ink @ 0.40 composites differently on every paper; on a light warm paper it falls near 2.2:1, unreadable at 7px. The role carries its own contrast contract under any skin.","Max 3 flat zones per diagram. More and it reads like a swimlane (use that type instead). Nested administrative and traffic scopes under Containment below are not this cap — they nest, so the cap is sibling traffic scopes at one level.","Dark mode: the roles invert with the skin, so nothing is swapped by hand. Take ink, soft, and paper from the dark column in style-guide.md; opacities stay the same."]},{"h":"Containment","items":["Use this section when the network hierarchy itself carries the meaning — the reader must see what sits inside which scope, and a flattened zone label (VNET · SNET-APP) would lie about that hierarchy. Connectors stay Architecture; containment geometry comes from Nested (consistent insets, eyebrow per level, fills stepping up inward). This is a variant of Architecture, not a new type and not a provider-specific grammar.","Two scope kinds, never interchangeable:","Kind · What it is · Shape · data-scope-kind","Administrative · Billing, permissions, lifecycle. Holds no traffic. · Horizontal band — a full-width containment rect with a 24px header · admin","Traffic · A boundary packets do not cross without an explicit rule. · Box — the existing zone rect (rx=8) · traffic","Provider-neutral metadata (no vendor prefix):","data-grammar=\"architecture-containment\" on the root <svg> — files without it are ordinary Architecture and this contract does not apply.","data-scope-id + data-scope-kind on every scope's bounds rect (data-role=\"bounds\"). Bounds are always a <rect>, for scopes and nodes alike.","data-parent on every nested scope and every node, naming the innermost enclosing data-scope-id. Only the outermost scope, which no other scope encloses, may omit it.","Nodes: data-node-id, data-kind of compute (workloads inside a traffic scope), endpoint (private endpoint inside a traffic scope), or managed (PaaS that belongs to an administrative scope).","An endpoint carries data-target naming the managed node it reaches.","A peering path carries data-peering, data-from, and data-to naming the two traffic scopes it joins.","PaaS placement (normative). A managed service is never inside a traffic scope. It sits in the administrative band that owns it. What lives in the subnet is its private endpoint. Drawing a database inside a subnet tells the reader it sits behind that subnet's security rules, which it does not. scripts/verify-architecture-containment.py fails a managed node whose bounds fall inside any traffic scope, and an endpoint that is not inside one.","Sibling axis. Sibling traffic scopes at one level share one axis. Directly under an administrative band the parent's aspect chooses it: wider than tall (or square) → a row sharing one y; taller than wide → a column sharing one x. Nested children take the perpendicular axis: siblings inside a traffic scope that sits in a row form a column, and their own children form a row again. Do not mix axes at one level.","Budget (tightens Architecture's flat 3-zone cap; see layout-budget.md): ≤2 administrative bands, ≤4 traffic scopes, ≤8 nodes, 2 accent elements. Split per subscription when a figure exceeds that.","Draw scopes in place. Containment is read from each bounds rect's own x, y, width, and height. Do not position a scope or node with a transform attribute, a moving inline style (transform, translate, x, y, position, margin, and similar), a nested <svg>, a <style> rule, or an animation, on the element or any group around it. The checker fails each of those. It does not evaluate external stylesheets or script, so keep containment geometry out of both.","scripts/verify-architecture-containment.py checks unique IDs, resolving innermost parents, geometric containment, <rect> bounds, the admin-band vs traffic-box shapes (with stroke-dasharray resolved as rendered, so none or all-zero dashes count as solid), PaaS placement, endpoint targets, sibling axes, declared peerings, and the moved-geometry rule above. Files without data-grammar=\"architecture-containment\" are skipped."]},{"h":"Anti-patterns","items":["Every box in coral (\"this is important too\") — hierarchy collapses.","Bidirectional arrow when one direction is obvious from context.","Legend floating inside the diagram area.","Flattening two containment levels into one zone eyebrow (VNET · SNET-APP) — the hierarchy is the claim.","A managed PaaS box drawn inside a subnet or VPC — only its private endpoint belongs there.","Colour as the only distinction between an administrative band and a traffic box — the shapes must differ, because greyscale still has to tell them apart."]}]},{"slug":"axonometric-plan","title":"Axonometric plan","bestFor":"one floor or one site seen from above at an angle, with what stands on it. An office floor with its rooms and furniture, a campus with its buildings and roads, a warehouse with its zones, a store layout. Use it when the reader needs to see rooms or buildings in relation to each other and how they are used, in a single view.","lead":"Not this type: ","zh":"轴测平面","example":"example-axonometric-plan.html","sections":[{"h":"Projection","items":["The same 2:1 dimetric projection as the exploded axonometric, from one function:","Every element is a rounded prism standing on the plate: r = 0 for walls, furniture, and buildings, r = w / 2 for a tree canopy. type-exploded.md § Projection covers the corner ellipse and the face matrices; scripts/build-axonometric-plan-examples.py in the repository builds every shipped example from the same helpers."]},{"h":"Layout conventions","items":["Plate: One floor slab (6 units) or one site (8 units, small corner radius). Everything stands on it, and nothing extends past its edge.","Walls: 6 units thick and cut at desk height, about 22 units, so no wall hides a room. Doors are gaps in a wall. Walls meet without overlapping: run one wall through a junction and stop the other at its face.","Furniture and buildings: Boxes on the plate with the house face shading (type-exploded.md § Faces and lines). Heights are to scale with each other. Two footprints never overlap.","Flat marks: Roads, paths, and floor tints sit on the plate's top face as flat fills (ink at 0.07) with no thickness. A dashed centre line (ink at 0.25, 6,5) may mark a road.","Racks: Tall shelving is a box of kind rack with the house shading, a shelf line every 14 units, and an upright every 30. Run rack rows along x so the reader sees the lit face and the aisles between rows.","Trees: A canopy cylinder 8 units up on a short trunk, canopy top in rule-solid light or soft dark. Trees are planting, so keep them small and off every footprint.","Paint order: The plate first, then flat marks, then every box back to front. Sort with a topological order: box A paints before box B when A lies entirely behind B (A.x1 <= B.x0 or A.y1 <= B.y0) and their screen outlines overlap. A plain x + y sort fails on long walls.","Frame: The canvas is 1000 wide and the plate is centred. The viewBox height follows the plate and its tallest box plus a 48px top margin."]},{"h":"Optional motion","items":["A site that is built in phases can reveal its buildings phase by phase with the pinned controller from assets/template-motion.html in reveal mode. Each building and its tag form one data-motion-item whose data-step is its phase, at most two per step. Buildings drop 16px into place and fade in, inside the 24px limit in animation.md.","A floor plan can reveal by zone the same way. Give each zone's furniture a step, and the builder paints each phase as one contiguous group of boxes (it contracts a phase to one node in the depth sort, so a phase that would have to paint on both sides of a static wall fails the build) plus one group of that phase's room tags after every box. That is two motion items per phase, inside the limit of two per step. Walls and unphased rooms stay static. The static, no-JavaScript, reduced-motion, print, and export states show the finished site."]},{"h":"Metadata contract","items":["scripts/verify-axonometric-plan.py reprojects each element from what it declares:","The figure: one <g data-axo-plan data-origin=\"ox oy\">.","The plate: one <g data-plate data-rect=\"x0 y0 x1 y1 r\" data-z=\"0\" data-t=\"t\">.","Each box: a <g data-box> with data-rect, data-z (the plate top, or 8 above it for a tree canopy), data-h, data-kind (wall, furniture, building, tree, rack), and for a building data-name. Its first path is data-role=\"silhouette\".","Each room: a <g data-room data-name data-rect>.","Each tag: a <g data-role=\"tag\" data-name data-at=\"x y z\"> with a backing <rect> and a <text data-role=\"name\">. Its complete text, including inline <tspan> descendants, must match the tag's data-name. The point sits inside the room it names at the plate top, or on the building's roof.","The focal room or building carries data-focal.","The silhouette verifier accepts signed decimal and scientific-notation coordinates within the existing absolute M/L/A/Z path contract. Every operand must be finite; projected vertices, corner radii, and arc flags are still checked. This does not add relative path commands."]},{"h":"Anti-patterns","items":["Full-height walls that hide the rooms behind them.","Boxes that overlap on the plate, or a box hanging past the plate edge.","Painting by x + y alone, which draws long walls over the furniture in front of them.","Tags tilted onto the floor plane, tags that overlap, or a numbered key under the figure.","Accent on the focal room and on its furniture as well.","Gradients, shadows, or glow on the plate or the boxes."]}]},{"slug":"bar","title":"Bar / Column Chart","bestFor":"comparing discrete quantities across categories or time intervals — sprint velocity, monthly revenue, feature adoption, cohort counts. Use when each category has a single numeric value and the comparison between bars is the primary message — or, in the dumbbell variant below, exactly two values whose difference is the message.","lead":"","zh":"柱状图","example":"example-bar.html","sections":[{"h":"Layout conventions","items":["Orientation: Vertical bars (columns) are default. Horizontal bars are appropriate when category labels are long or you have more than 8 categories.","Plot area margins: left 80px (y-axis labels), bottom 60px (x-axis labels), top 40px, right 40px — inside a 0 0 1000 500 viewBox.","Bar count cap: 4–8 bars. More than 8 → group into periods or split into two charts.","Bar width: ≥ 50% of the column pitch (the gap should never exceed the bar). Typical: pitch=110px, bar=72px.","Y-axis gridlines: 4–6 horizontal lines at regular intervals. Stroke ink @ 0.08 (very faint), 0.8px. X-axis baseline at ink @ 0.25, 1px.","Y-axis labels: right-aligned arrow-label role 8px in muted, at x=72 (8px left of the plot area).","X-axis labels: centered below each bar, node-name role 11px 600 for category names.","Value labels: arrow-label role 8px above each bar. Focal bar label in accent; others in muted.","Focal bar: 1 bar max in accent fill/stroke. All others in muted @ 0.15 fill + muted stroke.","Y-axis line: thin vertical <line> at x=80 from y=40 to y=420."]},{"h":"Anti-patterns","items":["More than 8 bars without grouping (illegible at normal scale).","Truncated y-axis (not starting at 0) — distorts the magnitude comparison.","Accent on more than 1 bar (\"everything is important\" = nothing is).","3-D bar extrusion — no shadows, no depth.","Category labels rotated more than 45°; prefer short labels or horizontal chart instead."]},{"h":"Variants","items":["Grouped bars: two bars per category, side by side. Use accent for the primary series and series-1 for the secondary. Max 2 groups.","Stacked bars: segments stacked to total. Use accent for the focal segment; muted tints for others. Document the total at the top of each stack.","Dumbbell: one row per category, two dots on a single shared horizontal scale joined by a hairline. Use it for a two-state comparison where the distance between the ends is the message — before/after, two cohorts, target vs actual. Two series only; a third dot makes the connector meaningless and the figure is a dot plot."]}]},{"slug":"data-flow","title":"Data Flow","bestFor":"visualising how data moves through a pipeline across organisational roles — who initiates, who processes, who publishes, and who consumes. The canonical use case is a multi-role data platform (Admin → Engineers → Scientists → Consumers) with 4–6 process steps. Use when the reader needs to understand who does what at each stage, not just the technical components.","lead":"Prefer standard Swimlane for cross-functional business processes (HR approvals, support tickets). Use Data flow when the subject is a data pipeline with typed payloads (raw files, tables, reports) and role-scoped access boundaries. This type is parametric — the inputs schema in §1 drives every coordinate via the formulas in §2. Two generations from the same inputs must produce visually identical SVG.","zh":"数据流图","example":"example-data-flow.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved field semantics:","lanes[k].key — the 3-letter role chip text (e.g., ADM, ENG, SCI, CON). Used inside every node in that lane.","lanes[k].name — two-line lane label; both lines use the uppercase eyebrow role.","steps[j].focal: true — exactly one step may declare this. Header chip renders in accent.","nodes[i].focal: true — exactly one node may declare this. Renders with accent border (§5).","nodes[i].chips — data-type chips for the node. Either form accepted:","Object form (preferred): {in: \"<CODE>\", out: \"<CODE>\"} — explicit input/output semantic. Either side optional.","Array form: [\"<INPUT_CODE>\", \"<OUTPUT_CODE>\"] — first item is input, second is output.","Codes from §8 (WB, DB, TB, FL, LS). Position is fixed: input chip on the node's bottom-left, output chip on the bottom-right.","nodes[i].color — optional per-node color override. Any valid \"#hex\" string is accepted; the §4 palette is recommended for cross-diagram consistency but not required. Every node can carry its own color independently of others."]},{"h":"3. Arrow rules (mandatory)","items":["Four styles, bound to topology. Connectors are drawn before all node rects (z-order rule).","style · Stroke · Width · Dash · Marker · When required","muted · muted · 1.0 · — · arr-muted · Standard data hand-off between steps or within a lane.","trigger · muted · 1.0 · 4,3 · arr-muted · Governance trigger — an admin action enables downstream work. Unlabelled.","accent · accent · 1.2 · — · arr-accent · Focal cross-role handoff. Exactly one per diagram, labeled.","link · link · 1.0 · — · arr-link · Published / externally-consumed output.","Defs block (required, three markers):"]},{"h":"4. Component color override","items":["Any node, lane, or step may declare an optional color: \"#hex\". Mirrors high-level §3.4 and dp-integration §4 so the rule reads identically across types."]},{"h":"5. Focal rule","items":["The data-flow diagram is built around one cross-role handoff that defines its central claim. Three focal slots, exactly one entry each:","One focal step (steps[j].focal: true) — typically the analytical pivot (Analyze, Model, …). Header chip and legend chip both render in accent.","One focal node (nodes[i].focal: true) — the node that receives the focal handoff. Accent border + accent role chip + ink title.","One focal arrow (arrows[i].style: \"accent\") — the cross-role handoff into the focal node. Solid accent stroke + labeled with a short payload descriptor (e.g., anon data).","If zero or >1 of any focal slot are declared, halt and ask the user."]},{"h":"6. Dark mode","items":["Token · Light · Dark","Paper · paper · ink","Ink · ink · paper","Muted · muted · soft","Soft · soft · rule-solid","Accent · accent · accent","Link · link · link","Dot pattern · ink @ 0.10 · paper @ 0.10","Lane tint · ink @ 0.018 · paper @ 0.025","Dividers · ink @ 0.12 · paper @ 0.12","Default chip fill · ink @ 0.12 · paper @ 0.12","Focal chip fill · accent @ 0.20 · accent @ 0.22","Default node fill · paper · paper @ 0.04","Default node stroke · ink @ 0.25 · paper @ 0.20","Focal node fill · accent @ 0.07 · accent @ 0.12","Focal node stroke · accent · accent","Custom component colors · C · C_light (lighten ~15%)"]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","viewBox = \"0 0 {viewBox_w} {viewBox_h}\" derived from n_steps and n_lanes via §2.","Header strip at y=0..36; legend strip at y=legend_y_top..viewBox_h (legend_y_top = 36 + n_lanes * 80).","Every node at (step_cx(j) - 50, lane_y_top(k) + 8) size 100×64.","Empty cells render nothing — no placeholder rect, no text.","Exactly one focal step (steps[j].focal: true).","Exactly one focal node (nodes[i].focal: true).","Exactly one focal arrow (style: accent). Labeled, with a paper-masked rect behind the label.","All other arrows unlabelled.","All arrows emitted before any node rect (z-order rule).","Single-bend routing only — no diagonals. Q-bezier r=8 at each bend.","Custom component colors ≤ 3 (in addition to the focal pair). Arrows never recolored by component color.","Subtitle and tool labels stay muted regardless of any component color."]},{"h":"8. Data-type chips reference (input + output)","items":["Small 16×8 rx=3 badges at the bottom of each node, one for input and one for output. Position is non-negotiable:","Input chip at (node_x+4, node_y+54) — bottom-left of the node. Represents the payload format entering the node from upstream.","Output chip at (node_x+80, node_y+54) — bottom-right of the node. Represents the payload format leaving the node toward downstream.","Either chip may be omitted (e.g., a sink node has only an input chip; a source-only node has only an output chip). Reading the diagram becomes a payload-transformation trace: scan a row, read each node's input → output, and you see exactly what shape the data takes at each hand-off."]},{"h":"9. Legend (3- or 4-row strip)","items":["Each row introduced by a category label at x=144. The default legend has 3 rows (STEPS / DATA TYPE / FLOW); when one or more nodes carry a color override (§4), add a 4th CONCERN row and grow legend_h to 100 (so viewBox_h = header_h + n_lanes·80 + 100).","Row 1 — STEPS at y = legend_y_top + 16: repeat the header chips with their labels. Focal step keeps accent fill.","Row 2 — DATA TYPE at y = legend_y_top + 37: one swatch per chip type actually used in the diagram. Append a small sub-hint in the muted sublabel role after the chips: left chip = input · right chip = output. This makes the position-based input/output convention explicit for first-time readers.","Row 3 — CONCERN (only when color overrides are present) at y = legend_y_top + 58: one mini-rect per custom color used, with its semantic label (e.g., Identity · Governance, Data Quality · Observability). The focal accent swatch is also shown here so the reader sees all three colored axes side-by-side.","Row 4 — FLOW (last row, position depends on whether CONCERN row exists): short line segments with their marker + text label, one per arrow style actually used.","All legend items align on a single horizontal strip per row. Do not stack vertically inside a box."]},{"h":"10. Complexity budget","items":["Dimension · Max","Lanes (roles) · 4","Steps · 6","Nodes per lane · Nodes = active steps only — empty cells are invisible (no placeholder box)","Labelled arrows · 1 (focal accent only)","Data-type chips per node · 2","Custom-colored elements (§4) · 3 (in addition to focal node + focal step)","Above 4 lanes or 6 steps: split into two diagrams (e.g., ingestion pipeline / analytics pipeline)."]}]},{"slug":"db-schema","title":"Database Schema","bestFor":"the physical schema — real tables, real SQL types, real constraints, real indexes, and foreign keys that connect one column to another column. It's the DDL made legible: migrations, review of a real database, and anything where the column type or the ON DELETE behavior is the point.","lead":"Not for domain modeling. ER / data model is entity-level: relationship lines join boxes and carry cardinality, fields are a plain list, and it's the right tool for a conceptual or domain conversation. Database schema is column-level: the FK connector anchors to the specific column row on both ends — the one capability ER doesn't have, and the reason this type exists. If you're discussing what an Order is, use ER. If you're discussing what happens when a row is deleted, use this.","zh":"数据库结构","example":"example-db-schema.html","sections":[{"h":"Complexity budget","items":["Max 5 tables, max 8 column rows shown per table, max 6 FK edges, max 2 accent elements. Over budget → show the subsystem, not the database, and say so in a caption."]},{"h":"Anti-patterns","items":["Drawing every column of every table — a schema diagram is an argument about a subsystem, not a \\d+ dump.","FK lines that connect box to box instead of column to column — that's ER, use ER instead.","Missing SQL types — the type is half the content.","Unlabelled FK edges — the ON DELETE behavior is what a reviewer is looking for.","Constraint chips on every row until the chips are the noise.","Index compartments listing every index rather than the ones that matter to the story.","Mixing conceptual entity names with physical table names in one diagram."]}]},{"slug":"dependency","title":"Dependency Graph","bestFor":"what depends on what, across packages, modules, or services — specifically to show two things a tree cannot structurally express: (a) a node with more than one parent (a shared dependency that several things converge on), and (b) a cycle. If neither appears in the data — every node has exactly one parent and nothing points backward — use Tree instead; say so explicitly rather than forcing a graph layout on tree-shaped data.","lead":"","zh":"依赖关系","example":"example-dependency.html","sections":[{"h":"Layout conventions","items":["Ranked layers. Nodes sit in horizontal rank rows by dependency depth: rank 0 (entry points nothing depends on) at the top, deeper ranks below. Forward edges point downward across ranks, or run horizontal within a single rank row when a dependency compresses to the same depth as its dependent (e.g. a shallow sibling dependency) — never upward outside the one marked cycle. Rank rows are 120px apart.","Nodes are the standard node-box pattern (§6, primitives-core.md): rx=6, 160px wide, 56px tall.","Fan-in badge. Every node carries an eyebrow-role 8px badge in its top-right corner, inside a small rx=2 box, showing how many nodes depend on it (4 in). A mask fully inside a node is a badge chip, not a label — legitimate under §6 rule 6. The node with the highest fan-in is the diagram's structural story; size nothing else to compete with it.","Node treatments (style-guide.md § Node type → treatment):","Internal package/service → white fill + ink stroke.","External / third-party → ink @ 0.03 fill + ink @ 0.30 stroke (the External/Cloud treatment).","Leaf with no outgoing edges → ink @ 0.05 fill + muted stroke.","The cycle. At most one back-edge points upward against rank order. It is the editorial point of the diagram: accent stroke, dashed 5,4, marker-end=\"url(#arrow-accent)\", routed around the outside of the node stack — never straight through the middle, and never behind a node it doesn't connect to — with a masked arrow-label-role 8px CYCLE label at its visible end. The two nodes the cycle touches stay in their normal node treatment (§5) — no accent stroke or fill on the nodes themselves, or the 2-accent budget is blown on the wrong elements.","Focal rule: the 2 accent elements permitted per diagram are the back-edge and its CYCLE label. Nothing else in a dependency graph is accent.","All six §6 Mandatory connector rules apply in full, no exemptions: rounded right-angle elbows (r=8) between off-axis nodes, 6–10px label-margin, no overlapping connectors (bridge/hop at crossings), fanned attach points (≥12px apart) where multiple edges share a box edge, no connector passing behind a non-endpoint box, no label mask clipped by a later-painted node."]},{"h":"Complexity budget","items":["Limit · Rule","Max nodes · 9","Max edges · 14","Max rank layers · 4","Max highlighted cycles · 1","Max accent elements · 2","Over budget: collapse a leaf cluster into one aggregate node labelled with its count (e.g. +6 leaves), and say so in a caption — don't silently drop nodes."]},{"h":"Anti-patterns","items":["Drawing a dependency graph when the data is actually a tree (single parent everywhere, no cycles) — use Tree instead.","Forward edges that point upward without being the one marked cycle.","A hairball layout with no rank ordering — rank first, always; ranking is what makes the graph readable, not an optional polish pass.","One node per file instead of per package/module/service — the graph is about dependency structure, not the filesystem.","Unlabelled external dependencies — version or registry belongs in the sublabel (v3.23 · npm), not left implicit.","Highlighting more than one cycle in a single diagram — pick the one that matters editorially; a second cycle competes with the first and neither reads.","Omitting the fan-in badges — without them the reader can't see at a glance where dependencies concentrate, which is the entire reason this type exists over a plain tree."]}]},{"slug":"deployment","title":"Deployment","bestFor":"where the software actually runs — hosts, VMs, pods, and managed services placed inside environment or network-boundary zones, with replica counts and versioned artifacts called out. Architecture answers \"what talks to what\"; deployment answers \"what is installed on which host, in which environment, behind which network boundary, at how many replicas.\" If the diagram has no physical-placement decision to show — no zone boundary, no replica count, no version that matters — use type-architecture.md instead; redrawing the logical architecture with hostnames bolted on is the most common deployment anti-pattern.","lead":"","zh":"部署拓扑","example":"example-deployment.html","sections":[{"h":"Layout conventions","items":["Three nesting levels, outermost to innermost — reuses the containment grammar from type-nested.md, specialized for infrastructure:","Zone — an environment or network boundary (edge, prod / eu-west-1, data). A large rect, rx=8, fill ink @ 0.02, stroke ink @ 0.20 dashed 4,4. An eyebrow-role 8px (or 7px for tight layouts) uppercase tracked label sits inside the top-left corner, on a paper-colored mask over the border. Zones are drawn first — before arrows and nodes — so labels and boxes paint over them (z-order: bg → zones → arrows → labels → nodes).","Infrastructure node — a host, VM, pod, or managed service inside a zone. The §6 node-box pattern (SKILL.md; markup in primitives-core.md) at rx=6, with a rectangular type tag (rx=2, not a pill) carrying POD / VM / MANAGED / CDN in the top-left corner.","Artifact chip — what is deployed onto that node. A small 24px-tall rect rx=4, fill ink @ 0.05, stroke muted, holding the image or service name in the node-name family at 12px (left-aligned) plus a sublabel-role 9px version tag (right-aligned, e.g. v2.4.1). A node can carry more than one chip (stacked with an 8px gap) when more than one artifact is co-located (a sidecar, for example).","Replica badge. A node running N copies carries a right-aligned eyebrow-role 8px badge (x3) inside its own small rx=2 box in the node's top-right corner. A mask fully inside a node is a badge chip and is a legitimate exception to the \"mask must not overlap a later node\" rule (SKILL.md §6 rule 6) — it's part of that same node.","Network paths. Orthogonal elbows between nodes (SKILL.md §6, elbow formula and port-selection rules in type-architecture.md), labelled with protocol and port in the arrow-label role at 8px (HTTPS:443, TLS:5432). A path that crosses a zone boundary is link-blue; a path that stays inside one zone is muted. Async or replication paths are dashed 5,4.","Focal rule. The 2 accent elements are the single-point-of-failure or the newly-introduced piece — never more than 2. In the canonical example: the RDS primary (accent-tint fill, accent stroke) and the replication path to its standby (accent, dashed)."]},{"h":"Complexity budget","items":["Limit · Rule","Max zones · 3","Max infrastructure nodes · 6","Max artifact chips · 9","Max network paths · 8","Max accent elements · 2","Over budget → split into one deployment diagram per environment."]},{"h":"Anti-patterns","items":["Redrawing the logical architecture with hostnames bolted on. If no placement decision is visible (which host, which zone, how many replicas), use type-architecture.md instead.","Zones that are just visual grouping with no boundary meaning — a zone must be a real environment or network boundary, not a layout convenience.","Artifact chips without a version tag. The version is why the diagram exists; an unversioned chip is a wasted box.","One node drawn per replica instead of a single node with a replica badge.","Cloud-vendor icon soup standing in for named nodes — name the host or service, don't decorate it.","Unlabelled network paths. Protocol and port are the content of a deployment diagram, not decoration.","Mixing two environments in one diagram (e.g. staging and production nodes side by side without a zone boundary that actually separates them)."]}]},{"slug":"dp-integration","title":"DP integration","bestFor":"the integration topology of a data platform — which source systems plug in, which consumer surfaces plug out, and which protocol each one speaks. Hub-and-spoke layout wrapped in an explicit Data platform layer; no time/phase axis.","lead":"Use when the question is \"what surfaces does this platform expose, and over what wire?\" rather than \"how does data move through phases?\". This type is parametric — like type-high-level.md, every coord is derived from a small inputs schema. Two generations from the same inputs must produce visually identical SVG.","zh":"数据集成","example":"example-dp-integration.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved kind values for platform.rows:","bar — full-zone-width strip. Default height 44 px (focal bars get 56 px). Required fields: name, icon. Optional: subtitle, role, color, focal.","row — N nodes evenly spaced across zone width. Required: nodes list. Each node has name, icon, optional role, subtitle, color, focal.","Source/consumer type values → icon mapping (extends references/primitive-icons.md):","db → cylinder, sftp → folder-with-arrow, mail → envelope, mainframe → server-with-vents","monitor → desktop screen, chart → bar-chart, globe → globe, api → curly braces","key → key + ring (identity / IDP)","Any explicit icon name in primitive-icons.md is also accepted.","Per-component color: \"#hex\" is optional on any node, bar, or footer entry. See §4."]},{"h":"3. Connector rules (mandatory)","items":["Five styles, bound to topology. Don't let user override style on focal-touching, bar-originating, or Trino → consumer edges — those are fixed by rule.","style · Stroke · Width · Dash · Marker · When required","primary · focal_accent (default accent) · 1.4 · — · arrow-focal · Every edge whose endpoint is a focal: true component. Also every Trino → consumer edge (serve-flow rule).","secondary · muted · 1.2 · — · arrow · Default for internal platform-component edges and source → platform edges that don't touch focal.","federated · link · 1.0 · 4,3 · arrow-link · Federation queries (e.g., source DB → Trino).","trigger · muted · 1.0 · 4,3 · arrow · Every edge originating from a kind: bar component (Airflow drops). Unlabelled.","auth · accent · 1.2 · 5,4 · arrow-accent · Every edge from a footer node up to the zone bottom edge. Never to a specific component.","Defs block (required, six markers — exactly):"]},{"h":"4. Component color override (mirrors type-high-level.md §3.4)","items":["Any source, consumer, platform component (node or bar), or footer node accepts an optional color: \"#hex\". Mirrors high-level so the rule reads identically across types.","Where the color is applied (C = color):","Element · Light · Dark","Container fill (rect body) · rgba(C, 0.06) · rgba(C_light, 0.10)","Container stroke · rgba(C, 0.35) (stroke-width=1 for nodes, 0.8 for bars) · rgba(C_light, 0.45)","Role badge stroke · rgba(C, 0.40) · rgba(C_light, 0.55)","Role badge text · rgba(C, 0.85) · rgba(C_light, 1.0)","Icon stroke / fill · C · C_light","Name text · C · C_light","Subtitle text · unchanged (muted) · unchanged (muted)","Connectors touching this component · unchanged — topology-driven · unchanged","C_light = the same hex lightened ~15% for dark-mode contrast (e.g., #b85450 → #d97a78).","Rules:","Never on focal components. focal_accent always wins — a color on a focal component is ignored.","Never on connectors. If you want a colored edge, pick a different style from §3, not a color override.","Cap at 2 custom-colored components per diagram (in addition to the focal pair).","Semantic palette (use these unless brand demands otherwise):","#b85450 rust-red — Security / Identity (AD, Keycloak, Vault)"]},{"h":"5. Focal rule","items":["Exactly two focal components. Default: the storage hub (MinIO / S3 / similar) and the federation engine (Trino / Dremio / similar). These two surfaces distinguish a \"platform\" from a pile of tools. Everything else (NiFi, Jupyter, Airflow, AD, all sources, all consumers) stays ink / muted.","Mark with focal: true on the component entry.","A focal kind: bar uses bar_h_focal=56 (taller) and accent styling.","A focal kind: row node keeps row_h=72 but uses accent styling.","The Trino → all consumers edges are always primary (accent), regardless of focal flag on each consumer — this is the serve-flow rule.","If fewer than 2 or more than 2 components are marked focal: true, halt and ask the user."]},{"h":"6. Dark mode","items":["paper, ink, muted, soft, accent, and link invert with the skin: take their values from the dark column in style-guide.md. A role at an opacity needs no dark-mode handling, since ink @ 0.32 resolves against whichever ink is active.","Only these differ between modes:","Element · Light · Dark · Why it differs","Side-column fill · muted @ 0.06 · ink @ 0.06 · The slate tint reads as mud on dark paper; plain ink stays neutral","Side-column stroke · soft · ink @ 0.30 · ditto","Zone fill · ink @ 0.025 · ink @ 0.04 · A wash needs slightly more presence on dark paper","Non-focal bar fill · ink @ 0.05 · ink @ 0.06 · ditto","Focal fill · accent @ 0.08 · accent @ 0.12 · ditto","Unchanged across modes: zone stroke ink @ 0.32, focal stroke accent, and custom component colors (C light → C_light, lightened ~15%)."]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","viewBox = \"0 0 1200 {viewBox_h}\" where viewBox_h = max(600, footer_bottom + 84).","Platform zone at x=260 y=72 w=696 h=col_h. Zone label paper-masked across top border at y=zone_y+3.","Left column at x=40..200, right column at x=1000..1160 — both 160 wide.","Source / consumer rows top at y=92, stride 88 px.","platform.rows entries stack inside zone via the §2.1 cursor algorithm; total y-span ≤ zone_h.","Inside each kind: row, node x-centers are evenly spaced across zone width (§2.2).","Exactly 2 focal components (focal: true).","Every edge originating from a kind: bar component uses style: trigger (dashed, unlabelled).","Every Trino → consumer edge uses style: primary (the serve-flow rule).","Footer nodes connect only to the zone bottom edge via auth style. No edge from a footer to a specific component.","Custom component colors ≤ 2 (in addition to the focal pair). Connectors never recolored by component color.","All connectors emitted before any node rect (z-order rule)."]},{"h":"8. Sources and consumers — icon library","items":["Define each icon as <g id=\"ico-…\"> in <defs>, drawn at translate(cx, cy) with stroke=\"currentColor\" so it inherits the surrounding text color. Common icons:","ico-db (cylinder) — relational sources","ico-sftp (folder with down arrow) — file drops","ico-mail (envelope) — email pulls","ico-mainframe (server with vents) — legacy systems","ico-monitor — desktop analytics tools","ico-chart (bars) — BI / report tools","ico-globe — public websites","ico-api (brackets {}) — gateways and 3rd-party clients","ico-key — identity / IDP","ico-monitoring (chart-line) — observability stack","If you need more icons, browse assets/icons.html and define matching <symbol> blocks."]},{"h":"9. Identity, common services → connect to the layer, not to components","items":["Active Directory (or Keycloak, IAM, OPA, any cross-cutting identity / policy / secrets store) authenticates every component in the platform. Wiring it to one specific tool would understate the trust scope. Connect it instead with a single arrow to the bottom edge of the platform zone, labeled AUTH (§3.3).","The same rule applies to any other layer-wide service: centralized logging, secrets vault, observability stack, audit sink, mTLS root. Each goes in the footer list, each gets its own row, each gets its own AUTH line up to the zone bottom edge (staggered by index per §3.3). The visual reading is \"the platform layer delegates to all of these,\" which is the architectural truth."]},{"h":"10. Budget — this type exceeds the default","items":["This is the one type where the default 9-node / 12-arrow budget is intentionally exceeded. A realistic platform integration shows:","4–6 source nodes","5 platform components","4–6 consumer nodes","1–3 footer nodes (identity, observability, backup, …)","That's 14–20 nodes. The complexity is the point — the diagram is making a claim about the number of distinct integration surfaces. Compressing them collapses the claim.","When this gets unwieldy:","Combine clearly-identical source rows (e.g., four MariaDB databases → one Databases node with sublabel 4 × MariaDB)","Split into two diagrams (one per integration plane: data vs. identity vs. observability)"]}]},{"slug":"dp-security-matrix","title":"DP security matrix","bestFor":"documenting per-role / per-component access permissions for a data platform — a grid where each row is a platform component (Keycloak, MinIO bucket, Trino catalog, JupyterHub, NiFi, …) and each column is a role / AD group (Data Administrators, Data Engineers, Data Scientists, Data Consumers, …). Each intersection cell holds a permission value (Admin / Full / R/W / Read / SELECT / Login / No access) with a visual category that matches the permission level. One cell may be marked focal to flag a critical access rule (e.g., \"Data Consumers can ONLY SELECT from the aggregated catalog — sole consumer access\").","lead":"Use when stakeholders need to audit who can do what across the platform. Prefer DP integration when the question is who can talk to what (topology/protocol) rather than who can write/read what (permissions). This type is parametric — the inputs schema in §1 drives every coordinate via the formulas in §2. The rule shape mirrors type-medallion.md / type-process.md / type-data-flow.md so the focal rule, color override, dark mode, and reproducibility checklist read identically across types.","zh":"数据安全矩阵","example":"example-dp-security-matrix.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved field semantics:","roles[j].name — primary role label (node-name role at 11px, white text on the ink banner)","roles[j].code — secondary AD-group identifier (sublabel role, white text at 0.85 opacity)","components[i].hint — optional right-aligned sublabel text in the label cell (e.g., \"SSO\", \"S3 API\")","cells[k].level — closed vocabulary full | rw | read | none. Drives fill/stroke/text-color per §2.4.","cells[k].value — free-form display text. Domain-specific labels (\"R/W\", \"SELECT\", \"Login\") work without inventing new levels.","cells[k].focal: true — exactly one cell may declare this. Overrides level to focal styling.","cells[k].sub — optional 2nd-line text (used with focal). Renders in the sublabel role at 8px below the primary value.","cells[k].color: \"#hex\" — optional per-cell color override (§4)."]},{"h":"3. Cells, not connectors","items":["A matrix diagram has no connectors — there are no arrows between cells, no flow lines. The diagram's information is entirely in the cell content + cell styling. The only \"connector-like\" element is the focal cell's accent border, which visually \"calls out\" a specific intersection.","Cells emit no edges. Don't add arrows pointing into cells or between cells — they belong in a different diagram type."]},{"h":"4. Color overrides","items":["Three independent override axes — per-cell, per-component (row), per-role (column). All optional, all use the same color: \"#hex\" field, all draw from the same recommended palette. Mirrors §3.4 of type-high-level.md, §4 of type-process.md, §4 of type-medallion.md."]},{"h":"5. Focal rule","items":["Exactly one focal cell per diagram (or zero). The focal cell:","Uses focal styling (accent fill + accent stroke 1.4 + accent text bold)","May carry a 2-line content: primary value at y = row_y(k) + 18, sub at y = row_y(k) + 30","Calls out the diagram's central security claim — the one access rule that distinguishes this platform's posture from a generic permissions table","If zero or >1 focal: true cells are declared, halt and ask the user."]},{"h":"6. Dark mode","items":["Token · Light · Dark","Paper · paper · ink","Ink · ink · paper","Muted · muted · soft","Soft (no-access text) · soft · muted","Accent · accent · accent","Role-banner fill · ink · ink","Header / row stroke · ink @ 0.12 · paper @ 0.18","Full / Admin fill · ink @ 0.08 · paper @ 0.10","R/W fill · #FFFFFF · paper @ 0.06","Read fill · muted @ 0.08 · soft @ 0.12","No-access fill · paper · paper @ 0.02","Focal fill · accent @ 0.07 · accent @ 0.12","Focal stroke · accent · accent","Custom component colors · C · C_light (lighten ~15%)"]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","viewBox = \"0 0 {viewBox_w} {viewBox_h}\" derived via §2 (4 roles × 8 components → 920 × 520).","Header row at y=72 h=52. Component header cell white-filled with two-line Component / vs. AD group label. Role banners filled ink with name + AD-group code in white.","Data rows start at y=140, stride 40, height 36. rows_bottom = 140 + (n_components−1)·40 + 36.","Component label cell rx=4, name left-aligned at x=24, optional hint right-aligned at x = comp_col_x + comp_col_w − 12.","Every value cell rx=4, stroke ink @ 0.12 0.6, fill + text matching §2.4 for its level.","Exactly one focal cell (or zero). Focal cell stroke accent width 1.4. Primary value at y = row_y(k) + 18; sub (if present) at y = row_y(k) + 30.","Cells omitted from cells: render as level: \"none\" with none_label text (default \"No access\").","Custom-colored cells ≤ 2 (in addition to the focal cell).","No connector elements anywhere in the SVG.","Legend strip at legend_y_top, one swatch per level actually used, hairline separator above.","viewBox_h grows with n_components; viewBox_w grows with n_roles."]},{"h":"8. Anti-patterns","items":["More than one focal cell — focal exists to mark the critical access rule; >1 erases the signal.","Connectors anywhere — matrix is value-driven; arrows belong in DP integration / process diagrams.","Freeform level values — closed vocabulary is full | rw | read | none. Use value for free-form displayed text + color override for arbitrary tinting.","Per-row or per-column color tints — apply color per cell only. Whole-row or whole-column highlighting tends to over-emphasize and collapses the matrix into a list.","Using none_label as a placeholder for \"TBD\" — none means no access. If the permission is unknown, leave the cell empty in inputs but document it elsewhere; don't render an ambiguous state.","More than 6 roles — split into two matrices (e.g., human roles vs service accounts) before exceeding 6 columns.","More than 14 components — split by domain (storage / compute / observability / governance) before exceeding 14 rows.","**Using the matrix to document how permissions are granted** — that belongs in a process or sequence diagram. The matrix shows what each role can do, not the grant flow."]},{"h":"10. Worked YAML — full inputs for example-dp-security-matrix.html","items":["The complete inputs that map to the shipped canonical example. Every coordinate in that SVG is derivable from §2 applied to these inputs."]}]},{"slug":"er","title":"ER / Data Model","bestFor":"conceptual and logical data models, API resource relationships, domain models — anything where the story is entities and cardinality.","lead":"Not for the physical schema. ER is entity-level: relationship lines join boxes and carry cardinality at each end. When the point is real tables with SQL types, constraint chips, indexes, and foreign keys that anchor column to column, use type-db-schema.md instead.","zh":"实体关系 ER","example":"example-er.html","sections":[{"h":"Layout conventions","items":["Each entity is a two-section box:","Header: type tag (ENTITY) + entity name in the node-name role.","Body: field list in the sublabel role, one per line. PK prefixed with #, FK prefixed with →.","Relationships: lines between entities with cardinality at each end:","1, N, 0..1, 1..* in the arrow-label role, 8px, placed 10–12px from the entity edge.","Optional relationship label (\"has\", \"belongs to\") centered on the line.","Group related entities close; lay out so most relationships are straight lines, not tangles.","Coral on the aggregate root or central entity of the model."]},{"h":"Anti-patterns","items":["Drawing an arrow for every FK on a model with dozens — lay out by cluster instead.","Inconsistent cardinality notation between ends of the same relationship.","Fields padded to equal-height boxes — natural height by content is fine."]}]},{"slug":"event-modeling","title":"Event modeling","bestFor":"showing how commands, resulting domain events, and read models relate across ordered business stages. Use it when the supplied scenario names those elements and their links. The horizontal axis is scenario order unless timestamps or durations are supplied. An illustrative example must say so.","lead":"Not this type: Use Sequence for actor lifelines, message calls, and replies in temporal order. Use Data flow for movement or transformation between systems when commands and resulting events are not the question. Use Timeline for dated occurrences without command and projection roles. Do not infer an event store, broker, or persistence mechanism from this view.","zh":"事件建模","example":"example-event-modeling.html","sections":[{"h":"Layout grammar","items":["Arrange numbered stages left to right. Align Command, Event, and Read model in three fixed horizontal lanes. Within each stage, the command sits above the resulting event, and the read model sits below it.","A command is an intent/request, named as an imperative. An event is a fact that occurred, named in past tense. A read model is a view or projection, not another event. Show each role explicitly in text and metadata.","Draw a directed emits link from command to event and a directed projects link from event to read model. The diagram claims these links only when supplied by the source. If a link is unknown, label the gap; do not silently connect unrelated marks.","Stage order does not encode elapsed time. Do not space stages proportionally to time without a measured axis. If a stage branches, split the scenario or use Flowchart for the decision."]},{"h":"Complexity budget","items":["At most six stages. The overview uses one command, one event, and one read model per stage. Split richer scenarios into overview and detail views instead of shrinking labels.","At most two accent uses. The event and link labels must carry meaning without color."]},{"h":"Anti-patterns","items":["Commands and events in the same lane, or an event named as a future instruction.","A left-to-right stage layout presented as measured duration.","A read model shown as proof of persistence, delivery guarantee, or test coverage.","A generic producer-broker-consumer flow renamed as event modeling with no commands or projections."]}]},{"slug":"exploded","title":"Exploded axonometric","bestFor":"one object or system drawn in parallel projection with its parts pulled apart along one axis and labelled. A device teardown (what is inside a phone), an unboxing (lid, product, insert, box), assembly order, or the layers of a stack when the reader should see them as physical parts of one thing.","lead":"Not this type: ","zh":"爆炸视图","example":"example-exploded.html","sections":[{"h":"Projection","items":["2:1 dimetric. The ground axes run at 26.565 degrees, so every edge lands on whole pixels when model units are multiples of 4. World x runs right and down, y runs left and down, z runs up. Project every point with one function and never place a coordinate by hand:","A rounded-rectangle footprint of corner radius r projects to straight edges joined by quarter arcs of one ellipse with rx = r * sqrt(2) and ry = r / sqrt(2). Use that one shape for everything: r = 0 is a box or slab, a small r is a product corner, and r = w / 2 = d / 2 is a cylinder. Corner centres stay fixed when you inset an outline, so an inner rim is the same four centres at a smaller radius.","Draw faces as plain SVG <path> and <polygon> elements with the projected points written in. No CSS 3D, no canvas, no WebGL, and no transform to place geometry. If content ever has to sit flat on a face, the matrices that agree with iso() are matrix(1,0.5,-1,0.5,tx,ty) for the top face, matrix(1,0.5,0,-1,tx,ty) for the left face, and matrix(-1,0.5,0,-1,tx,ty) for the right face. Labels never use them: labels stay horizontal.","scripts/build-exploded-examples.py in the repository builds every shipped example from this function and is the worked reference for the helpers below."]},{"h":"Layout conventions","items":["Parts: 2 to 5, listed bottom to top. Each part is a rounded prism (rect, thickness t) plus at most two levels of detail on its top face, because the top face is the one the reader sees.","Explode axis: Vertical by default. Parts move straight up, nothing rotates, and the bottom part stays at z = 0.","Levels: Parts that sit side by side in the assembled object share a level and explode together. A phone's logic board and battery sit next to each other inside the housing, so they lift as one level instead of stacking two gaps apart.","Gap: One gap between every pair of levels, gap = max(k x top-face height, 3 x thickness of the thickest solid part), rounded up to a multiple of 4. k = 0.5 is the floor; raise it to 0.75 when a tall part would hide the focal part below it. Top-face height is (w + d) / 2 of the largest footprint. Containers (a housing, a box) do not count toward thickness.","Clearance: If a leader would cross another part, or two labels would sit closer than 36px, raise the gap in steps of 4 until neither happens. Two parts on one level that collide cannot be fixed by the gap: move one of them in plan.","Paint order: Bottom level first. Inside a level, parts farther back (smaller x + y) paint first. A container is split: its back half (silhouette, rim, cavity, floor) paints before the parts that sit inside it, and its outer walls and front rim paint after them. This is the only way an assembled frame shows the parts inside a tray correctly, and it stays correct throughout an explode.","Frame: The canvas is 1000 wide. The object and a 240px label column are centred together; the viewBox height follows the exploded object plus a 40px top margin. Nothing is clipped at the closed frame either, because the closed object fits inside the exploded one."]},{"h":"Optional motion","items":["An exploded view may open as the assembled object and explode once, because watching the parts lift shows how they fit together. Use the pinned controller from assets/template-motion.html in reveal mode, per animation.md:","The source file is the exploded frame. Every part group carries data-motion-item, a data-step counted from the top level down (top level lifts first), and style=\"--lift:Npx\" where N is the part's exploded z minus its assembled z. In this projection a straight-up move in model space is a straight-up move on screen, so one translateY(var(--lift)) is the whole explode.","The bottom level does not move. Its label and the trace lines arrive together as the last step.","Each part's label hides at the closed frame and fades in after its part settles. Hide instantly and delay only the reveal, or labels pile up on the closed object for the first half second.","No JavaScript, prefers-reduced-motion: reduce, print, ?motion=static, and export all show the exploded frame.","The lift is the one scoped exception to the 24px translation limit in animation.md, recorded in the repository as ADR 0013. Nothing else in the figure moves."]},{"h":"Metadata contract","items":["scripts/verify-exploded.py reprojects each part from what it declares:","The figure: one <g data-exploded data-origin=\"ox oy\" data-gap=\"g\"> wrapping every part.","Each part: a <g> with data-part (key), data-name (the label text), data-rect=\"x0 y0 x1 y1 r\", data-z, data-t, data-level, optional data-kind=\"housing\" for a container and data-focal for the focal part. Animated parts add data-closed-z.","Inside each part: the first <path data-role=\"silhouette\"> is the part's outline at its declared box, and a <g data-role=\"label\"> holds a <line data-role=\"leader\"> and a <text data-role=\"name\">. Its complete text, including inline <tspan> descendants, must match the part's data-name.","Trace lines carry data-role=\"trace\".","The silhouette verifier accepts signed decimal and scientific-notation coordinates within the existing absolute M/L/A/Z path contract. Every operand must be finite; projected vertices, corner radii, and arc flags are still checked. This does not add relative path commands."]},{"h":"Anti-patterns","items":["Hand-placed coordinates, or a CSS transform standing in for geometry.","Outline-only parts with no face shading.","Parts that rotate, slide sideways, or explode along two axes in one figure.","Unequal gaps, or a gap shrunk to fit the canvas. Raise k or cut a part.","Labels on the parts, angled with a face, or spread across two columns.","Numbered callouts with a key underneath.","More than one part in the accent, or the other parts faded to show which one matters.","Blurred contact shadows, gradients on solid faces, or glow.","An exploded view of something with no physical sense of parts. If the layers are just a list, use the layer stack."]}]},{"slug":"fishbone","title":"Fishbone / Ishikawa (root-cause)","bestFor":"structured root-cause analysis. One observed effect, causes grouped by category, sub-causes hanging off each category. The standard artefact of an incident post-mortem — use it when a reader needs to see what was investigated, not just the conclusion.","lead":"","zh":"鱼骨图","example":"example-fishbone.html","sections":[{"h":"Layout conventions","items":["Spine. A horizontal line (ink, 1.2px) runs left→right at the vertical centre CY, terminating with an arrowhead into an effect box at the right head — the node-box pattern from SKILL.md §6 (primitives-core.md), the observed-effect statement inside.","Bones. Category lines are straight diagonals at a fixed 60° to the spine, alternating above and below, evenly spaced along it. Each bone carries its category name at the outer end in a small tag-style box (rx=4, not a pill) — node-name role, 12px, weight 600.","Sub-causes. Short horizontal ticks (32px, soft) branch off each bone at fixed points along its length, each with a sub-cause label in the sublabel role at 9px sitting past the open end of the tick.","Diagonal exemption. SKILL.md §6 rule 1 (mandatory rounded right-angle elbows) does not apply to the 60° bones — they are this type's defining grammar. The exemption covers bones and sub-cause ticks only; any other connector in a fishbone diagram (e.g. a callout leader, a cross-reference arrow) still uses rounded right-angle elbows.","Focal rule. Exactly one bone is the confirmed root cause: its line is accent, and its category tag uses accent-tint fill + accent stroke. The effect box is styled the same way (accent-tint fill, accent stroke) since it's the diagram's headline. That pair — root-cause bone and effect box — is the full 2-accent budget; every other bone, tag, and tick stays ink / muted / soft.","Drawing order: background → spine → bones → sub-cause ticks → category tag boxes → effect box → legend. Lines before boxes, so box fills cap the line ends cleanly."]},{"h":"Math","items":["For a spine at y = CY with the effect box's left edge at x = HEAD, bone k (1-indexed, k = 1..6) attaches to the spine at:","Bones alternate above (k odd) and below (k even) the spine. A bone's far endpoint — where the category tag sits — is the integer-rounded 60° offset from its attach point:"]},{"h":"Complexity budget","items":["Limit · Rule","Max categories (bones) · 5 at HEAD=1200. A 6th requires a widened canvas — see Geometry","Max sub-causes per bone · 3","Max sub-causes total · 18","Max accent elements · 2 (root-cause bone+tag, effect box)"]},{"h":"Anti-patterns","items":["More than 5 bones on the default canvas. The 6th tag clips the viewBox. Widen HEAD and the viewBox width together and deliberately, or split by subsystem into two fishbones.","Sub-causes that restate the category. A \"Deploy\" bone with a sub-cause labeled \"deployment issue\" adds a node without adding information.","A bone with zero sub-causes. An empty category is a placeholder, not a finding — delete the bone or don't draw it until there's something under it.","Accenting more than one root cause. If two categories are both confirmed, that's two diagrams (or a merged cause) — not two accent bones. The 2-accent budget is load-bearing for the \"this is the answer\" signal.","Using fishbone for a sequence of failures. A chain of things that happened in order is a timeline or sequence diagram — fishbone is for causes of one effect, not a chronology.","Pasting in the classic 6M template (Man/Machine/Material/Method/Measurement/Environment) with empty categories. Name categories from the actual investigation, not a generic checklist waiting to be filled in later.","Effect box phrased as a solution. \"Add a p99 alert\" is a fix, not an observed effect. The box states what was seen — a symptom, a measurement, an incident — never the remedy."]}]},{"slug":"flowchart","title":"Flowchart","bestFor":"decision logic, algorithms, user-facing branching flows (\"Should I…?\"), onboarding routing, support-triage trees.","lead":"","zh":"流程图","example":"example-flowchart.html","sections":[{"h":"Layout conventions","items":["Shape carries type, not color:","Oval (rx=20) — start / end","Rectangle (rx=6) — step / action","Diamond — decision (≤3 exits)","Small filled ink dot (r=4) — merge point where branches rejoin","Flow runs top→down. From a diamond, conventional exits: Yes to the right, No below — but label every outgoing arrow regardless.","Use coral on the happy path or on the single most consequential decision — never on every decision.","If two arrows must cross, use a small arc jump on one so the crossing is readable."]},{"h":"Anti-patterns","items":["Using fill color to signal node type (shape does that).","Decision diamond with 4+ exits — refactor into nested diamonds.","Unlabeled decision branches."]}]},{"slug":"gantt","title":"Gantt Chart","bestFor":"project plans and roadmaps — tasks with explicit start and end dates, grouped into phases. Use when the reader needs to see temporal overlap, parallel tracks, and milestone sequencing at a glance.","lead":"","zh":"甘特图","example":"example-gantt.html","sections":[{"h":"Layout conventions","items":["Left label column: x=20–200 (180px). Task names in the node-name role at 11px 600. Phase labels as eyebrow 7px above each group.","Timeline area: x=200–960 (760px). Time axis runs left→right.","Row height: 40px per task. Each bar occupies h=24px centered in the row (8px top padding).","Time axis: arrow-label role 8px week/month labels at x=200+i×pitch, y=56 (just above first task row). A hairline separator at y=64.","Phase grouping: a subtle zone rect (same pattern as architecture zone) behind each phase's rows, with an eyebrow label in the top-left margin. Use ink @ 0.02 fill, ink @ 0.10 stroke.","Focal task bar: 1 bar in accent fill/stroke (the key deliverable or critical path task). All others: muted fill @ 0.15, muted stroke.","Today / milestone marker: optional vertical dashed line in muted at the current week x-position."]},{"h":"Anti-patterns","items":["More than 12 tasks (splits into sub-plans or collapses into phase-level view).","More than 5 parallel tracks per phase (illegible overlap).","Dependency arrows between tasks in v1 (add only when essential; use the annotation primitive for labels).","Start/end dates in the bar label (put them in the x-axis or tooltip comment instead).","Equal visual weight for all bars (the focal task must stand out)."]}]},{"slug":"heatmap","title":"Heatmap","bestFor":"cross-tabulated data where which row × column combination stands out is the story. Use when the reader needs to scan a full matrix at once — not compare individual bars or trace a trend line — and one cell (or a cluster of cells) is editorially distinct from the field. Common uses: CI failure rate by service and sprint, support ticket volume by team and week, confusion matrix for a classifier, correlation coefficients across many variables.","lead":"The CSS geometry guard ignores comments; active transform declarations still fail.","zh":"热力图","example":"example-heatmap.html","sections":[{"h":"Layout conventions","items":["Plot area: left 160px (row labels), top 64px (column labels), right 40px, bottom 120px (legend area); inside 0 0 1000 500 viewBox.","Cell size: 116px wide × 56px tall, gap 4px. Maximum grid: 6 columns × 5 rows within the viewBox; smaller grids scale the cells up to fill the space.","Row count: 3–7. Fewer → a table says it with less ink; more → the cells shrink below readability at the minimum viewBox width.","Column count: 3–8. Same constraint: 8 × 116 = 928px exceeds the available 800px at this viewBox, so either reduce columns or reduce cell width proportionally (minimum cell width 80px).","Axes: row labels right-aligned in the left gutter (sublabel role 9px, text-anchor=\"end\", x=148); column labels centered above each column (sublabel role 9px, text-anchor=\"middle\"); axis titles in the eyebrow role 7px small-caps rotated/positioned in the margins.","Value text (optional): arrow-label role 8px centered inside each cell. Flip text color to paper when fill opacity ≥ 0.40 (the ink ramp becomes dark enough to carry white); keep ink text below that threshold."]},{"h":"The fill ramp","items":["One ink ramp, one accent. Non-focal cells use a single tonal ramp: rgba(INK, opacity) where opacity is a non-decreasing function of the data value. The shipped example uses opacity = max(0.07, value / max_non_focal × 0.65). Any monotone formula (linear, sqrt, log) passes the verifier as long as opacity never decreases with value.","One focal cell only. The accent marks the editorially focal cell — the one whose combination of row and column is the figure's argument. It is not the automatically highest value; choose the cell whose story the title is about. data-focal=\"true\" is required; scripts/verify-heatmap.py counts all accent-fill and data-focal cells and fails if more than one is found.","Ramp bounds: the lowest-value non-focal cell should land at ≥ 0.05 opacity (the cell must be visually distinct from the paper background) and the highest-value non-focal cell at ≤ 0.70 (the ramp must not bleed into the focal accent's territory)."]},{"h":"Anti-patterns","items":["A hue per row or per column — hue is not a continuous variable; it maps \"which series\" (slopegraph contract), not \"how much\". The ramp carries quantity; the label carries category identity.","A multi-hue diverging ramp (e.g. blue–white–red) — these read as two variables (negative and positive deviation from center) and are only honest when the data is signed and the center is meaningful. For unsigned rates or counts, the single ink ramp is the honest encoding.","Focal accent on more than one cell — if two cells are both focal the figure needs a different title; hue-coding two things is a palette decision masquerading as an editorial one.","A value axis (color bar with a continuous legend) instead of a discrete ramp strip — the ink ramp is not a gradient legend; it encodes comparative reading (\"S4 is much darker than S3\"), not precise magnitude retrieval. If readers need the exact value, the number printed inside the cell carries it.","Rows or columns dropped because they made the pattern less clean — omitted rows and columns are invisible to the reader and look like \"the services that didn't have this problem\". Name everything included and say in the footnote if anything is excluded.","A transform on a cell, its underlay, or an ancestor <g>. The verifier reads raw x/y/width/height attributes; a transform silently moves the rendered mark off the verified position."]},{"h":"Honest-data rule","items":["Row × column labels are complete and stated. A heatmap that quietly drops a service with a high rate is a filtered view the reader cannot see. State every included row and column; note any exclusions in the footnote or source line.","The ramp scale is declared. The legend strip shows the range the ramp covers for non-focal cells, stated as \"LOW\" to \"HIGH\" rather than a continuous scale — because the ramp's job is comparative, not absolute. If the footnote states bounds, those bounds must match the actual minimum and maximum non-focal values in the figure.","The focal cell is excluded from the ramp's scale. Its value (often an outlier) would collapse every other cell into near-identical opacity if included. The footnote must state the focal cell's value explicitly. scripts/verify-heatmap.py checks that the focal cell carries data-focal=\"true\" and that no non-focal cell uses accent fill."]},{"h":"Declaring the values","items":["The verifier accepts either matching quote delimiter for SVG attributes.","Every drawn cell is bound to its row, column, and value. Declared data values are finite and nonnegative; unsigned counts may exceed one billion. NaN, infinity, and negative values are rejected rather than weakening grid completeness. The paper underlay carries nothing. The data rect carries all three.","Binding · Without it","data-row on the data rect · A row cannot be identified during verification; a swapped row passes silently.","data-col on the data rect · A column cannot be identified; a shuffled column is invisible to the verifier.","data-value on the data rect · The fill cannot be verified as monotone; any opacity passes.","data-focal=\"true\" on the focal rect · The focal cell is counted as a non-focal cell with an unexplained accent fill.","scripts/verify-heatmap.py enforces the complete rows × cols grid, the monotone fill ramp on non-focal cells, and at most one focal cell. It does not verify cell geometry (position, width, height) because both axes are categorical — position encodes \"which row/column\", and that is carried by the label, not by a scale the checker can measure against.","Focal-text contrast measurement accepts finite unitless and explicit px coordinates. Unsupported relative units or malformed lengths produce a named measurement finding, never a traceback; this does not add a quantitative cell-geometry check.","Focal-text contrast composites translucent foreground text against the resolved focal-cell fill before measuring WCAG AA. The 4.5:1 minimum applies to that foreground/background pair in both themes.","No transform on any verified element. Bake any coordinate offsets directly into x/y attributes."]}]},{"slug":"high-level","title":"High-Level","bestFor":"end-to-end data stack overviews — ingestion → storage → query → analytics → visualization — deployed on a container orchestrator (Kubernetes, ECS, Nomad). Combines a phase chevron banner, deployment boundary, orchestration bar, identity footer, and (optionally) a right-side vertical chevron strip for cross-cutting concerns (Orchestration, Security, Observability).","lead":"This type is parametric. The diagram is fully determined by a small list of inputs (chevrons, sources, components, connections). The formulas below tell you exactly where every shape lands given those inputs — two generations from the same inputs must produce visually identical SVG.","zh":"高层概览","example":"example-high-level.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Before drawing, collect these from the user (or accept them as a YAML/JSON block). Everything in this reference is derived from these inputs. Don't invent geometry on the fly.","Reserved chevron names (always vertical, even if vertical: true is omitted): Orchestration, Security, Observability, Governance, Backup.","Reserved kind values:","node — a standard box inside the cluster (default).","bar — a horizontal strip spanning the cluster top. Typically one (Orchestration); see §5 for the pairing rule.","cross-cutting — a horizontal strip spanning the body width (stops at the strip margin), stacked below the cluster. Zero or more allowed; each stacks 44 px below the previous (§2.5) and pairs 1:1 with a vertical chevron (§5).","Optional color (per component, hex string): tints the component's container and content while leaving connectors untouched. See §3.4. Use sparingly — a custom color is a semantic flag (e.g., red = security concern), not decoration.","Source type values → icon mapping (use references/primitive-icons.md):","db → database","ftp → bucket or upload arrow","web → internet","legacy → server","api → api","Any explicit icon name in primitive-icons.md is also accepted."]},{"h":"2. Layout formulas — deterministic geometry","items":["Every coordinate below is derived from the inputs. No hardcoded numbers in examples that aren't justified here."]},{"h":"3. Connector rules (mandatory)","items":["These are non-negotiable. Pick the style automatically from the topology — do not let the user override style on focal-touching or bar-originating edges.","style · Stroke · Width · Dash · Marker · When required","primary · accent · 1.2 · — · arrow-accent · Every edge whose endpoint is the focal node.","secondary · muted · 1.0 · — · arrow · Default for source→component and component→component when neither endpoint is focal.","trigger · muted · 1.0 · 4,3 · arrow-sm · Every edge originating from a kind: bar component.","query · ink @ 0.30 · 1.0 · 4,3 · arrow · Read-back edges (e.g., focal ↔ Trino).","Defs block (required, exactly these four markers):"]},{"h":"4. Block branching rules (fan-out)","items":["The single biggest reproducibility hazard. Fix these rules and the diagram becomes predictable."]},{"h":"5. Vertical chevrons — semantics","items":["Reserved names Orchestration, Security, Observability, Governance, Backup always render in the right strip (§2.9). Any chevron with vertical: true is treated as a reserved-style vertical regardless of name. The rules:","Pairing rule (mandatory, 1:1): every vertical chevron pairs with exactly one cross-spanning component, and every cross-spanning component pairs with exactly one vertical chevron. The two component kinds that pair:","If the inputs declare a vertical chevron without a paired component (or vice versa), halt and ask the user — the diagram is incomplete.","Count constraint: len(verticals) == len(bars) + len(crosscuts). The right strip is split evenly among all verticals (§2.9), so visual alignment between a chevron and its bar/row is approximate — the label is what matters, not the y-pixel match.","Ordering convention: declare verticals top-down in the order: bar-paired first (Orchestration), then crosscut-paired in the same order the crosscuts appear below the cluster. This keeps the visual reading order consistent.","No edges: vertical chevrons emit no connectors themselves. They are labels for a column of cross-cutting concern.","No node placement: no kind: node may be assigned to a vertical chevron. Nodes always belong to a horizontal phase.","Right strip presence: if any vertical chevron exists, the right strip is reserved (effective_w = 964) and all horizontal chevron widths and cluster geometry shrink accordingly. Do not draw a vertical chevron on top of the cluster.","The visual contract: the vertical chevron's column visually \"owns\" the bar/cross-cutting row at its approximate y-band. Orchestration (top of strip) ↔ Airflow bar (top of cluster). Security ↔ Identity bar. Observability ↔ monitoring bar (below identity). And so on."]},{"h":"6. Dark mode","items":["paper, ink, muted, and accent invert with the skin: take their values from the dark column in style-guide.md. Every derived value in this reference is a role at an opacity, so ink @ 0.18 resolves to dark ink on light paper and light ink on dark paper with no extra handling.","Only these differ between modes:","Element · Light · Dark · Why it differs","Muted text · muted · ink @ 0.65 · Dark mode softens secondary text by opacity rather than by hue","Dashed border · ink @ 0.20 · ink @ 0.22 · A hairline needs marginally more presence on dark paper","Node fill · #ffffff (white) · ink @ 0.06 · White is opaque; on dark paper the node lifts off the ground instead","Node stroke · ink @ 0.25 · ink @ 0.20 · Light ink on dark paper reads stronger at equal opacity","Focal fill · accent @ 0.08 · accent @ 0.12 · ditto","Phase bands · band-1 / band-2 · band-2 / band-3 · The alternation shifts one step lighter (§6.1)","Unchanged across modes: cluster border ink @ 0.18, dot pattern ink @ 0.10, focal stroke accent, accent connector accent, and the chevron label, which is always band-label."]},{"h":"7. Reproducibility checklist (the taste gate)","items":["Before emitting SVG, verify every item. If any fails, fix it — don't ship.","Every cluster node.cx equals its chevron's cx (§2.2 + §2.7). This is what makes the chevron banner a real legend.","Every chevron width is a multiple of 4 and ≥ 120.","The reserved right strip (28 px) exists iff any vertical chevron is declared. If yes, effective_w = 964; if no, effective_w = 1000.","Exactly one focal node. If focal is unset in inputs, default to the first kind: node under chevron \"Storage\".","Every edge whose endpoint is the focal node uses style: primary (accent stroke + arrow-accent marker).","Every edge originating from a kind: bar component uses style: trigger (dashed + arrow-sm).","The cross-cutting bar (if any) emits no edges.","No node has > 3 outgoing edges, or if it does, it is the declared focal / hub.","All <path> and <line> connectors are emitted before any node <rect> (z-order).","Each vertical chevron pairs 1:1 with exactly one bar or cross-cutting component (§5 pairing rule). len(verticals) == len(bars) + len(crosscuts).","viewBox_h = max(540, strip_y_bot + 112) — grow the canvas when multiple crosscuts are declared so the legend still fits.","Custom component colors (§3.4) apply only to container + icon + name; connectors stay topology-driven. Cap at 2 custom-colored components in addition to the focal.","The diagram passes SKILL.md §9 (4-px grid; ≤ 2 accent elements; mono only for technical content; hairlines; no shadows; no rounded-2xl)."]},{"h":"8. Anti-patterns","items":["Chevron banner omitted — it's the key that maps visual columns to functional phases.","Node x-center off-chevron (§7 #1) — breaks the \"banner-as-legend\" contract.","Vertical chevron drawn on the cluster (overlay) instead of in a reserved right strip.","More than one focal node — MinIO/S3 (or whichever storage hub) is the focal point.","External zone with solid border — dashed border is the signal that these components are outside the cluster.","Identity bar inside the cluster boundary — it applies to all components and must span the full canvas width.","Vertical chevron without a paired bar/cross-cutting component — see §5 pairing rule.","Bar-component edges drawn solid — orchestration triggers must be dashed.","Source fanning out to >3 components without a hub."]}]},{"slug":"it-state","title":"IT current-state","bestFor":"documenting the before picture of a modernization proposal — the legacy IT landscape grouped by phase or department (Collection → Processing → Dissemination, or Frontend / Backend / Storage, or Survey → Analysts → Reports), with pain-points flagged, file-based hand-offs labelled (CSV / Excel / Email / Copy), and pre-platform tooling visible. The companion to type-dp-integration.md: this type shows the gap that a data-platform proposal is going to close.","lead":"Use when stakeholders need to see the friction in the current setup — siloed scripts, manual file shuffles, missing version control, single-points-of-failure — and the path from those to a target platform topology. This type is parametric — the inputs schema in §1 drives every coordinate via the formulas in §2. The rule shape mirrors type-dp-integration.md (zones + cross-cutting footer bars), type-process.md (rounded right-angle connectors), and type-medallion.md (per-element color override) so the focal rule, color override, dark mode, and reproducibility checklist read identically across types.","zh":"IT 现状","example":"example-it-state.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved field semantics:","orientation — horizontal (zones run L→R, components stack vertically inside each zone) or vertical (zones stack T→B, components run L→R inside each zone).","zones[i].name — uppercase short label (≤ 14 chars). Rendered at the top-left of the zone box in the eyebrow role with letter-spacing 0.14em, on a paper-masked break in the zone border.","components[i][k].id — globally unique slug; referenced by connectors[].from/to.","components[i][k].name — node-name role (the human-readable label).","components[i][k].sub — sublabel role at 10px in muted (the technical sub-label; up to 2 lines via auto-wrap when component height grows to 72).","components[i][k].icon — any id from references/primitive-icons.md. If missing → no icon, the name shifts left. (Catalog has 41 icons; mail is currently missing — use icon: file as fallback for email hand-offs.)","components[i][k].kind — standard | focal | external. focal triggers the accent palette (§5); external switches to a 4-2 dashed stroke and muted ink to signal \"this is outside our scope.\"","components[i][k].color — optional per-component color override (§4). Ignored on kind: focal (accent wins).","connectors[k].from / connectors[k].to — refer to a component id. Cross-zone, cross-row, same-zone vertical, and same-zone horizontal all legal; routing chosen by §3.","connectors[k].label — uppercase short text (≤ 8 chars). arrow-label role at 9px, weight 600.","connectors[k].icon — optional inline icon to the left of the text. Same catalog as component icons.","connectors[k].style — neutral | link | accent. Drives stroke color + marker.","connectors[k].dashed — true | false.","footer[k] — optional cross-cutting bar. Spans full canvas width minus margins. No connectors drawn from a footer.","legend[k].swatch — link | accent | dashed | focal | neutral. Auto-curated based on what the diagram actually uses; user can re-order or rename."]},{"h":"4. Component color override (per-component color: \"#hex\")","items":["Per-component, same shape as every other parametric type in this skill.","Element · Light · Dark","Container fill · rgba(C, 0.06) · rgba(C_light, 0.10)","Container stroke · rgba(C, 0.45) (width 1) · rgba(C_light, 0.55)","Component name text · C · C_light","Icon glyph · inherits ink via currentColor (unchanged) · inherits ink (unchanged)","Sub-label · muted (unchanged) · muted (unchanged)","Connectors touching this component · unchanged — topology-driven · unchanged","C_light = the same hex lightened ~15 % for dark-mode contrast (e.g., #7a8c47 → #9aac67, #b85450 → #d97a78).","Rules:","Never on focal components. kind: focal always renders accent; color is silently ignored.","Never on connectors. Connector style is topology-driven; if you want a colored edge, pick style: accent / link / neutral, not a component color.","Cap: ≤ 3 custom-colored components per diagram (in addition to focal components). Above 3 the visual signal fragments.","Recommended cross-type palette (same as type-medallion.md / type-process.md / type-dp-integration.md / type-dp-security-matrix.md):","#b85450 rust-red — security / governance / pain-point that isn't focal","#5a7d9a slate-blue — observability / quality / monitoring gate","#7a8c47 olive-green — survivor system (the one tool the new platform keeps)","#c9a23a warm yellow — sandbox / dev / scratch"]},{"h":"5. Focal rule","items":["Auto-styling: accent stroke 1.4, accent-tinted fill 7 %, ink-bold node-name, accent line-1 sublabel.","Any connector with a focal endpoint automatically renders in style: accent; the YAML style: is ignored.","Custom color: \"#hex\" on a focal component is silently ignored — accent always wins.","If your diagram needs more than 2 focal components, you've collapsed two narratives. Split: one \"collection pain-points\" diagram + one \"dissemination pain-points\" diagram."]},{"h":"6. Dark mode","items":["Role · Light · Dark","paper · paper · ink","ink · ink · paper","muted · muted · muted","accent · accent · accent","link · link · link","zone background · ink @ 0.02 · paper @ 0.04","zone border · ink @ 0.10 · paper @ 0.14","standard component fill · #FFFFFF · paper @ 0.04","standard component stroke · ink · paper @ 0.32","focal fill · accent @ 0.07 · accent @ 0.12","focal stroke · accent · accent","external stroke · muted (dashed) · muted (dashed)","footer fill · ink @ 0.03 · paper @ 0.05","footer stroke · ink @ 0.18 · paper @ 0.20","label mask fill · paper · ink","custom-color components · C · C_light (≈ +15 %)"]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","Eyebrow + title + subtitle present at canonical y-positions (24 / 36 / 52); body padding 32 px.","2..4 zones; each has its uppercase label at the top-left of its zone box, on a paper-masked break in the border.","Every component has id, name. sub, icon, kind, color are optional.","≤ 2 components with kind: focal; focal styling auto-applied (accent fill 7 %, accent stroke 1.4, italic line-1 sub).","Every connector exits the right (or bottom) of source and enters the top (or left) of destination; rounded right-angle Q-bezier r=8 at every bend; marker triangle visibly touches the destination rectangle edge.","Connector labels sit at the start of the connector (not mid-segment) and are offset perpendicular to the line (5 px gap above for horizontal segments, 6 px gap to the right for vertical segments) — never overlapping the stroke. Paper-fill mask kept behind text; icon (when icon: is set) sits left of text inside the same mask.","≤ 3 custom-colored components; none on focal.","≤ 3 footer bars; each spans viewBox_w − 2*left_pad; no connectors emerge from any footer.","Legend at bottom: hairline separator + one swatch per style actually used.","arrow-label for connector labels, eyebrow for the page eyebrow and zone labels, title for the page title, node-name for the subtitle and component names, and sublabel for technical sub-labels.","Markers #arrow / #arrow-link / #arrow-accent defined once in <defs>; no inline marker definitions.","Dark variant: resolve every semantic token through its dark-mode value; custom colors are lightened ~15 %."]},{"h":"8. Anti-patterns","items":["Diagonal arrows. The NatStat replication has one (analyst → LegacyPortal). The new type forbids it — always rounded right-angle Q-bezier.","Marker not touching the target. Path ends at the centroid or stops short of the border.","Inline text connector labels without a mask rect. The connector line can bleed through the text and it becomes unreadable.","Labels sitting on top of the connector line, mid-segment. Labels belong at the start of the connector with a perpendicular margin (see §3.5) — burying them in the middle of the line hides the source-to-destination direction and forces the reader's eye to fight the mask.","Tiny text badges as icons. The source uses 7-px DB / APP / EXT badges; this type uses real 24-px catalog icons. Text badges are only acceptable as the label text, not as the component \"icon.\"","Custom color on a focal component. Focal always wins; user-set color silently ignored on kind: focal.","Footer bar wired to one component. Footer = cross-cutting layer-wide concern; a connector from a footer to a specific component is a category error (use type-dp-integration.md's AUTH-line pattern only when the footer service truly authenticates all components, and even then the line lands at the zone bottom edge, not at a specific tool).","> 16 total components or > 5 per zone. Density cap; split into two diagrams.","Mixing orientations within one diagram. Pick one — horizontal or vertical — and apply it to every zone.","Using kind: focal to flag every painful thing. Focal exists for ≤ 2 narrative pain-points; for \"this is bad but not headline-bad\", use color: \"#b85450\" rust-red instead."]},{"h":"10. Worked YAML — full inputs for example-it-state.html","items":["The complete inputs that map to the shipped canonical example. Every coordinate in that SVG is derivable from §2 applied to these inputs."]}]},{"slug":"journey","title":"User Journey Map","bestFor":"what a person does across the stages of an experience and how it feels at each one. The sentiment curve is the load-bearing element — without it this is just a process diagram with extra rows, so if you can't name a sentiment for every stage, use Process or Timeline instead.","lead":"Not this type: frontstage vs backstage on a shared stage grid, with a line of visibility → Service blueprint (type-service-blueprint.md). A blueprint is a census of what the customer can see versus what the service hides; it has no sentiment curve.","zh":"用户旅程","example":"example-journey.html","sections":[{"h":"Layout conventions","items":["Vertical stack, top to bottom, for one persona:","Stage headers — 5 equal columns, 200px wide, 24px gutters (max 6 stages). Each column: an eyebrow-role 8px uppercase tracked eyebrow (STAGE 1 … STAGE 5) over the stage name in the node-name role, 12px, weight 600, both centered on the column.","Sentiment band (the differentiator) — a 160px-tall plot area directly under the headers. 3 horizontal reference hairlines at rule 0.10 opacity mark the levels HIGH / NEUTRAL / LOW — eyebrow role 8px muted, anchored end in a 64px left margin. Never emoji, never writing-mode vertical text for these labels. A smooth muted 1.5px polyline runs through one r=5 dot per stage, each value snapped to one of five ordinal levels (HIGH, MED-HIGH, NEUTRAL, MED-LOW, LOW) — only the three that are actually used need a labeled hairline. The trough stage's dot and its incoming segment are accent; everything else on the curve is muted.","Content rows — up to 3 labelled bands below the sentiment band, each with an eyebrow-role 8px uppercase row label sitting in the left margin (same column as the sentiment level labels, never rotated):","ACTIONS — what the user does, node-name family 12px, one short line per stage.","TOUCHPOINTS — the surface the action happens on (email, app, docs…), sublabel role 9px muted.","An optional third row for a metric or owner, same treatment as touchpoints.","Rows are separated by hairlines that span the full plot width (from the left margin edge to the last stage's right edge).","Pain markers — on stages where sentiment drops, a small dashed-stroke tag box (rx=2, accent @ 0.50 stroke dashed 3,3, no fill or a faint accent tint) sits under that stage's actions cell, with an arrow-label-role 8px label naming the friction. Max 2 per diagram, and only on the trough — tagging every stage erases the signal.","Legend — horizontal strip at the bottom per the global rule (hairline separator above, 160–180px between entries): three keys, in order — the sentiment line, the trough-stage highlight, and the pain-marker tag. The trough key is not optional: the dip is the finding, so the reader needs the highlight named."]},{"h":"Connector note","items":["The sentiment polyline is a data curve, not a connector between nodes — §6 rule 1 (mandatory orthogonal elbows) does not apply to it. This exemption covers the sentiment curve only; any other connector in a journey map (there normally are none) still follows the standard connector rules."]},{"h":"Geometry","items":["Stage grid: left margin 64px, then 5 columns of 200px with 24px gutters (col_left = 64 + i·224).","Sentiment band: 160px tall. Hairlines at the top (HIGH), middle (NEUTRAL), and bottom (LOW) of the band, 80px apart.","Dot x = the horizontal center of its stage column. Dot y = the snapped level's hairline y (or the interpolated position for an unlabeled level).","Row height: enough for one line of text plus, in the ACTIONS row only, up to two stacked 16px-tall pain-marker boxes."]},{"h":"Focal rule","items":["Exactly 2 accent elements: the trough dot + its incoming curve segment (counts as one), and its pain marker(s) (counts as the other). Nothing else on the map is accent."]},{"h":"Complexity budget","items":["Max 6 stages · max 3 content rows · 5 sentiment levels (ordinal, named — never numeric) · max 2 pain markers · max 2 accent elements."]},{"h":"Anti-patterns","items":["No sentiment curve. If every stage feels the same, or you can't name a feeling, you're drawing a process — use Process or Timeline.","More than 6 stages. Split into two journeys (e.g. acquisition and retention) rather than cramming a wide funnel into one map.","Numeric sentiment axis (a 0–100 score). Sentiment here is ordinal — five named levels, not a chart of a continuous metric.","Emoji as sentiment markers. Use the named levels and hairlines; emoji don't localize, print, or hold up at small sizes.","Multiple personas on one map. Overlaying two sentiment curves erases both. One map per persona.","Pain markers on every stage. If nothing is un-marked, nothing is focal.","writing-mode vertical row labels. Horizontal only, in the left margin — same rule as every other type in this skill.","Using it for an internal system flow with no human in it. No person, no sentiment, no journey map — that's an architecture or data-flow diagram."]}]},{"slug":"kanban","title":"Kanban Board","bestFor":"a snapshot of work-in-progress by state — what is queued, what is moving, what is stuck, and where the WIP limit is being breached. This is a state census, not a flow: a kanban board has no connectors at all. That is exactly what separates it from swimlane (lanes plus a flow crossing them, with handoffs as the load-bearing edges) and from process (ordered steps with directional handoffs). If the diagram needs an arrow anywhere, it isn't a kanban board anymore — reach for swimlane or process instead.","lead":"","zh":"看板","example":"example-kanban.html","sections":[{"h":"Layout conventions","items":["Up to 5 vertical columns of equal width (240px), 32px gutters. Column background is ink @ 0.02; no column border.","Header band per column: column name in the node-name role, 12px, weight 600, anchored left. A right-anchored WIP chip — a rectangular tag (rx=2, never a pill) holding n/limit in the eyebrow role at 8px — or bare n on a queue or terminal column, which carries no limit. Every in-process column states one. A hairline rule separator sits directly under the header band, full column width.","Cards: the §6 node-box pattern (primitives-core.md) at rx=6, column width minus 16px padding on each side, 56px tall, 12px vertical gap between cards. Content: title in the node-name role, 12px, weight 600, and a sublabel-role 9px muted sublabel line for TICKET-ID · owner (e.g. AVA-214 · nadia).","Drawing order: background → column fills → header text + WIP chips → header rules → cards (each: box, then left accent bar if blocked, then title, then sublabel) → legend."]},{"h":"Card states — the type's semantic vocabulary","items":["Every card renders in exactly one of four states. Document and use all four when the board has enough cards to show them:","State · Fill · Stroke · Extra","default · white · ink · —","blocked · accent @ 0.05 · accent (full opacity) dashed 4,4 · 4px accent bar on the card's left edge","waiting / external · ink @ 0.02 · ink @ 0.20 dashed 4,3 · —","done · ink @ 0.05 · muted · —","These map directly onto the node-treatment table in style-guide.md (security → blocked, optional → waiting/external, store → done) — the board reuses the system's existing semantic fills rather than inventing new ones."]},{"h":"Over-limit column","items":["When a column's card count n exceeds its stated limit, the WIP chip's stroke and text go accent. That plus one blocked card is the full 2-accent budget for the diagram — don't spend the budget anywhere else."]},{"h":"Complexity budget","items":["Max 5 columns, max 4 cards per column, max 12 cards total.","Max 2 accent elements (the over-limit chip counts as one; a blocked card counts as one).","Over budget on a single column → aggregate the backlog into one count card (+14 more) rather than listing every item."]},{"h":"Anti-patterns","items":["Drawing arrows between cards. A board shows state, not flow — if the flow itself needs to be visible, use swimlane or process instead.","More than 4 cards in a column. Aggregate into a count card; don't let a column scroll off the canvas.","One card per person. That's an org chart wearing a kanban skin.","In-process columns without WIP limits. The limit is half the point of the type — a column work flows through with no stated limit can't show that it's over budget. The entry queue and the terminal column are the exception: nothing is constrained by holding more done work, so they show a bare count.","Accenting every blocked card. One or two blocked cards read as signal; a column full of accent reads as noise and erases the focal rule.","A \"Done\" column that grows without bound. Cap it and note the archive point in the sublabel or a footnote — an unbounded Done column just becomes a second Backlog.","Pill-shaped WIP tags. The chip is a rectangle at rx=2, matching the type-tag primitive in the §6 node box (primitives-core.md) — pills read as status badges from an unrelated design language."]}]},{"slug":"layers","title":"Layer Stack","bestFor":"OSI model, CSS cascade, context hierarchy, tech stack, abstraction layers, memory hierarchy.","lead":"","zh":"分层架构","example":"example-layers.html","sections":[{"h":"Layout conventions","items":["Horizontal bands stacked vertically. Each layer is a full-width rectangle (same x, same width). 4–6 layers total.","Layer height 56–72px, width typically 800–880px inside a 1000px viewBox.","Each row contains (left→right):","Index tag on the far left (L3, 07, APPLICATION) — eyebrow role, 8–9px.","Layer name slightly right of center-left — node-name role, 14–16px 600.","Sublabel / note on the far right — sublabel role, 9–10px, muted.","Border between layers: 1px hairline ink @ 0.12 (the rule role). Outer silhouette 1px ink or muted.","Fills: either alternating subtle shades (paper / paper-2) OR all paper with hairline dividers. Pick one and hold it.","Direction indicator on the LEFT margin (outside the stack): small up/down arrow + eyebrow-role label (abstraction ↑, packets ↓).","Coral on one focal layer (stroke + subtle tint fill) — the bottleneck, the pay-rent layer, the one under discussion."]},{"h":"Anti-patterns","items":["Layers that aren't actually hierarchical (use swimlane or architecture).","Skipped numbering (missing L4 between L3 and L5 without explanation).","Every layer a different color — hierarchy invisible.","Inconsistent layer heights without reason."]}]},{"slug":"line","title":"Line Chart","bestFor":"continuous trends over time or a sequential index — signups over weeks, revenue by month, latency over releases. Use when the direction and rate of change between points is the primary message.","lead":"","zh":"折线图","example":"example-line.html","sections":[{"h":"Layout conventions","items":["Plot area margins: left 80px, bottom 60px, top 40px, right 40px — inside 0 0 1000 500 viewBox.","Points: 4–12 data points. Fewer → consider a summary stat; more → aggregate into periods.","X-axis: evenly spaced time/index labels below the plot. Use the arrow-label role at 8px, centered on each point x.","Y-axis gridlines: 4–6 horizontals at regular intervals. Same faint treatment as bar chart.","Lines: <polyline> with fill=\"none\". Focal series stroke-width=\"1.8\", others \"1.2\".","Vertex dots: only on the focal series (r=4, filled). Other series: line only.","Area fill (optional): <polygon> closing back to y=420 (x-axis baseline) at 0.08 opacity. Use for the focal series only when the area meaning is important.","Multi-series: up to 5 series. Focal = accent. Others = series-1, series-2, series-3, series-4 from style-guide.md. Apply series palette in order — don't skip.","Legend: horizontal strip at the bottom. Swatch = 16×8px rect with the series fill/stroke. One entry per series."]},{"h":"Anti-patterns","items":["More than 5 series (visual mush — reduce or split).","Lines that don't start at a shared zero baseline unless explicitly annotated.","Smoothed/spline curves when the underlying data is sampled — polyline is honest.","Dots on every series when there are 4+ series (only focal gets dots).","Y-axis that doesn't include zero when the absolute magnitude matters.","Connecting discontinuous data segments without a visual gap."]},{"h":"Variants","items":["Slopegraph: exactly two states, several series, read as slope and rank change. Full spec below. Its shared quantitative scale must be finite and nonzero; a flat value axis cannot encode distinct values.","Ridgeline: one distribution per series, stacked with deliberate overlap on one shared amplitude. Full spec below.","Streamgraph: many periods, few layers, read as a total and its composition breathing. Full spec below.","Bump chart: rank movement across 3–6 ordered snapshots, position only. Full spec below."]}]},{"slug":"loop","title":"Loop","bestFor":"reinforcing cycles, flywheels, feedback loops, and operating loops — anything where the last step feeds the first and a shared hub accumulates state. Use Loop when the reader must see both motions at once: work advances clockwise around the ring, while each pass writes durable state back to one common center.","lead":"Prefer Flowchart when the path ends, branches toward an outcome, or never truly returns to its first step. Prefer Cycle when the center does not accumulate shared state. The dashed write-back spokes are the defining signal here: remove them and the figure is only a circular process. This type is parametric. The inputs in §1 determine station count, angles, edge intersections, connector paths, and viewBox bounds. Identical inputs should produce identical geometry.","zh":"循环模型","example":"example-loop.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Budget (hard): 5–8 stations plus exactly one hub. Above 8 stations, split the subject into an overview Loop and one or more detail diagrams. Exactly one hub — a loop with two hubs is two diagrams. At most one station may set focal: true; zero is allowed when no editorial gate deserves emphasis.","Station order is semantic. stations[0] is the top station, then entries proceed clockwise. The last station always connects back to station 0; if that return would be false, use a Flowchart instead."]},{"h":"2. Layout math — deterministic geometry","items":["Use SVG coordinates, where positive y points downward. Let the hub center be C = (cx, cy), station count be N, station ring radius be R, station half-size be a = station_w/2, b = station_h/2, and hub half-size be A = hub_w/2, B = hub_h/2."]},{"h":"3. Visual grammar","items":["Element · Treatment","Station · Standard node: paper fill, ink stroke, radius-md; name in node-name, sublabel in sublabel","Hub · The one dark element: ink fill, paper text; slightly larger than a station","Focal station · At most one: accent-tint fill, accent stroke; station name may use accent","Ring flow · Circular A R R 0 0 1 arcs on the station circle, solid muted stroke, default arrowhead at the destination; clockwise only","Write-back spoke · Dashed soft stroke at reduced emphasis, stroke-dasharray=\"5,4\", with a soft arrowhead","Spoke label · arrow-label role, soft, uppercase, paper mask, 6–10px clear of the connector","Draw in this order: paper or optional dot grid → ring arrows → dashed spokes → spoke-label masks and labels → station boxes → hub → text. The nodes mask microscopic connector overshoot, while every intended endpoint still lands on an edge.","The hub is not a seventh process step. It is accumulated state: memory, standards, evidence, policy, or a shared operating record. Keep its copy to one name plus one short sublabel."]},{"h":"4. Connector rules (mandatory)","items":["SKILL.md §6 applies in full except for the two Loop-specific connector primitives: circular ring arcs (§2.2) and straight radial spokes (§2.3). Like Medallion's promotion arcs, these replace §6 rule 1 for this diagram type:","Ring arrows are same-radius circular arcs, solid, and clockwise. Every path uses A R R 0 0 1; destination markers land on station edges and no connector ends at a center point.","Spokes are dashed and point inward. A solid spoke destroys the visual distinction between operating flow and write-back.","Labels use opaque masks and maintain a visible 6–10px connector gap. Never place text on the stroke.","No ring connector or spoke may overlap another connector. Ring paths remain outside the hub; spokes occupy distinct radial routes.","When two spokes must leave the same station edge, fan their attach points by the §6 formula with at least 12px separation. The normal Loop has one spoke per station; use a second only when the semantics cannot be merged.","If a ring route would cross the hub, increase R or split the diagram. Do not thread flow through shared state or substitute an orthogonal route."]},{"h":"5. Dark variant — token swap","items":["Apply the style-guide inversion rule; do not invent a second palette.","Role · Light · Dark","Canvas and station fill · paper · dark paper","Primary text and station stroke · ink · inverted ink","Hub fill / hub text · ink / paper · inverted ink / dark paper","Ring flow · muted · dark muted","Write-back spokes and labels · soft · dark soft","Focal fill / stroke · accent-tint / accent · dark accent-tint / brighter dark accent","Rule and dot grid · rule · inverted rule at the same opacity","The semantic relationship stays unchanged in dark mode: one ink-filled hub, one optional accent station, neutral solid ring arrows, and lighter dashed write-backs."]},{"h":"6. Reproducibility checklist","items":["Station count is 5–8 and hub count is exactly one.","Station 0 is at -90deg; all others use equal 360/N steps clockwise.","Every solid ring arrow connects adjacent stations with A R R 0 0 1, using the same R; the last returns to the first.","Every ring marker lands on a station edge, not its center.","Every dashed spoke begins on a station's inner edge and stops marker_gap before the hub stroke.","Ring connectors stay outside the hub; spokes do not cross or overlap.","At most one station uses accent-tint + accent; the hub alone uses the dark ink fill.","Spoke labels, if present, use arrow-label, an opaque mask, and a 6–10px gap.","The viewBox includes station boxes, strokes, curves, markers, and margins without clipping."]},{"h":"7. Anti-patterns","items":["Anti-pattern · Why it fails / correction","Two hubs · Two accumulated states create two systems. Draw two diagrams.","Solid spokes · They look like primary flow and kill the dashed return signal. Use dashed soft write-backs.","Stations at uneven angles without reason · The ring stops reading as one operating cadence. Use equal 360/N spacing unless a documented phase grouping requires a deliberate gap.","Mixed arc + orthogonal ring segments · The ring becomes a rounded rectangle. Every segment must be a circular arc of the same radius so the ring reads as one continuous circle.","Connectors crossing the hub · Flow becomes confused with state. Route the ring outside or enlarge the radius.","Accent on multiple stations · The editorial gate disappears. Keep one focal station at most.","More than 8 stations · Labels and spokes crowd the hub. Split into overview + detail.","A cycle that never actually returns · That is a Flowchart arranged in a circle. Use Flowchart and show the real endpoint."]}]},{"slug":"medallion","title":"Medallion","bestFor":"documenting a multi-tier data-storage layout where each tier is a distinct quality / access level of the same dataset — typically raw landing zone, anonymised, staging/cleaned, aggregated business indicators, and cold archive. Used when the reader needs to see at a glance what each bucket contains, who writes it, with what tool and format, and how data is promoted between tiers.","lead":"Prefer Process if the subject is a workflow with role lanes. Prefer High-Level if the subject is the cluster architecture rather than the storage tier organisation. This type is parametric — the inputs schema in §1 drives every coordinate via the formulas in §2. Two generations from the same inputs must produce visually identical SVG. The rule shapes mirror type-process.md and type-data-flow.md so color override, focal rule, and reproducibility checklist read identically across types.","zh":"数据分层","example":"example-medallion.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved field semantics:","tiers[i].style — one of outer, default, focal, cold. Drives the card's fill/stroke palette (§2.4).","tiers[i].focal: true — exactly one tier may declare this. Overrides style to focal and switches the promotion arrow into this tier to focal automatically.","tiers[i].fields — {tool, format, writer, example}. example is a 1- or 2-item list; the section heading uses example_label.","tiers[i].color — optional \"#hex\" per-tier color override. See §4.","promotions[].style — normal | focal | lifecycle. The connector rule (§3) binds each style to fixed stroke / dash / marker.","paths — 0–2 entries. When 0 entries, the bottom row is omitted and viewBox_h shrinks accordingly."]},{"h":"3. Connector rules (mandatory)","items":["Three styles, bound to topology. Mirror §3 of type-process.md so the rule reads identically.","Add a new <marker> for each color override used in the diagram. Naming convention: arrow-{semantic} (e.g., arrow-yellow, arrow-slate, arrow-red) — matches the recommended palette so the marker id reads cleanly in source.","Z-order: promotion arcs draw before any tier card rect, so the cards layer on top and any arc overshoot is masked inside the cards.","Arc shape rule: medallion promotions are always cubic arcs over the top of the tier strip, anchored at the top-center of source and target tiers; control points directly above anchors at y=0. No horizontal \"through the gap\" lines — the arc-over-top is what makes connector + label both clearly visible."]},{"h":"4. Component color override","items":["Any tier or path entry accepts an optional color: \"#hex\". Mirrors type-process.md §4 / type-data-flow.md §4."]},{"h":"5. Focal rule","items":["Exactly one focal tier per diagram. Defaults to the tier marked focal: true in inputs; if none is marked, defaults to the analytical pivot tier (typically Aggregated or whichever tier downstream consumers query).","The focal tier:","Uses style: focal (accent fill + stroke 1.6 + accent header band).","Renders bucket text and example-value lines in accent.","Has its incoming promotion arrow auto-promoted to style: focal (accent).","Has its outgoing promotion arrow (if any) — typically into the cold archive — kept at the user-declared style (usually lifecycle dashed).","If zero or >1 tiers carry focal: true, halt and ask the user."]},{"h":"6. Dark mode","items":["Token · Light · Dark","Paper · paper · ink","Ink · ink · paper","Muted · muted · soft","Accent · accent · accent","Fog (cold tier fill) · paper-2 · paper @ 0.06","White (default card fill) · #FFFFFF · paper @ 0.04","Card stroke ink (default style) · ink · paper @ 0.30","Header band ink-tint · ink @ 0.06 · paper @ 0.08","Header band muted-tint · muted @ 0.10 · soft @ 0.16","Header band cold-tint · muted @ 0.18 · soft @ 0.24","Header band accent-tint · accent @ 0.14 · accent @ 0.20","Custom component colors · C · C_light (lighten ~15%)"]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","viewBox = \"0 0 {viewBox_w} {viewBox_h}\" derived via §2 (5 tiers + 2 paths → 1040 × 548).","Each tier card at (tier_x(i), 80) size 172 × 380, rx=6.","Tier header band fills (tier_x(i), 80, 172, 40) plus a 10-px extension under the band.","Exactly one focal tier; its incoming arc auto-styled to focal.","Promotion arcs render as cubic Béziers over the top of adjacent tiers; anchors at (tier_cx(i), 80) → (tier_cx(i+1), 80), controls at y=0. Label inside the arc at (arc_peak_x, 50), no mask.","Bottom path row only present when len(paths) > 0. Cards at y=476, height 56.","Custom component colors ≤ 2 in addition to the focal tier. Never on arrows.","All promotion arrows + label masks emitted before any tier rect (z-order rule — cards mask the line ends inside the cards).","The focal tier's bucket text and example values render in accent; the rest stay muted."]},{"h":"8. Anti-patterns","items":["More than one focal tier — focal exists to mark the central analytical surface; >1 erases the signal.","Cold styling on a non-archive tier — the dashed fog look is reserved for retention/archive tiers.","Bidirectional promotion arrows — promotions always flow left → right. Backflow (e.g., an aggregate writing back to raw) is wrong for this type; use a different diagram.","Custom-colored arrows — connectors are topology-driven; color on a tier never spreads to its edges.","Path cards explaining tier semantics — paths describe write methods (how data moves between tiers), not what each tier holds. If you find yourself writing \"Raw stores …\" in a path card, that content belongs in the Raw tier's fields.","Missing example_label content — every tier should show a concrete example payload (quarterly survey rows, customer records, claims, …). Without it the diagram becomes abstract and stops earning its space.","Promotion arrow label longer than the tier-gap label mask — keep labels to ≤ 14 chars in the uppercase arrow-label role. Long verbs (\"CALCULATE & SUMMARIZE\") break the rhythm; shorten to \"AGGREGATE\" or split into two diagrams."]},{"h":"10. Worked YAML","items":["The YAML in §1 is the complete inputs definition for the shipped example-medallion.html. Every coordinate in that file's SVG is derivable from §2 applied to those inputs. The same YAML is embedded as a top-of-file HTML comment inside example-medallion.html so source view shows the parametric inputs immediately above the SVG."]}]},{"slug":"nested","title":"Nested Containment","bestFor":"hierarchy through containment — scope boundaries, trust zones, folder nesting, blast radius. Outer = broader, inner = more specific.","lead":"","zh":"嵌套结构","example":"example-nested.html","sections":[{"h":"Layout conventions","items":["3–5 rounded rectangles (rx=8), nested with consistent inset padding (24–32px horizontal, 32–36px vertical recommended).","Each level labeled at the top-left in the eyebrow role (7–8px, letter-spacing 0.14em). Labels sit on a paper-colored mask rect over the ring's top border.","Stroke hierarchy: outer rings faint (rgba(..,0.30–0.45)), progressing to muted, to ink, to coral at the innermost focal.","Fills step up in opacity from outer to inner: rgba(..,0.015) → rgba(..,0.025) → accent-tint on the innermost.","Optional file-icon glyph (folded-corner rect) inside each level hints at scope content.","Italic callout-role asides (see references/primitive-annotation.md) — 1–2 max."]},{"h":"Anti-patterns","items":["More than 6 levels (information disappears inward).","Irregular padding between levels — unaligned nesting looks accidental.","Content inside rings that isn't part of the hierarchy — use a sibling diagram.","Coral on multiple levels — hierarchy collapses."]}]},{"slug":"org-chart","title":"Org Chart / Responsibility Map","bestFor":"human teams, agent teams, support escalation maps, role ownership, routing maps, and any hierarchy where the reader needs to know who owns what rather than just parent → child structure.","lead":"Use Org Chart instead of Tree when the nodes are people, agents, teams, roles, or accountable owners. A tree shows generic hierarchy. An org chart shows responsibility, invocation paths, and coverage gaps.","zh":"组织架构","example":"example-org-chart.html","sections":[{"h":"Layout conventions","items":["Root owner or front door at top center. Use one coral focal node for the person/team/agent that receives ambiguous work.","Tier 1 nodes are departments, pods, queues, or primary routing buckets. Keep them horizontally aligned.","Tier 2 nodes are responsible owners or specialists. If there are more than 8 specialists, group them under pod nodes instead of making one giant row.","Use orthogonal connectors: vertical drop from parent → horizontal bus → vertical drops to children. No diagonal lines.","Each node should answer three questions when space allows:","Name — human-readable role/person/agent in the node-name role.","How to invoke — Slack handle, queue, issue prefix, or trigger in the sublabel role.","Scope — 2–4 terse ownership words, not a paragraph.","Show non-Slack / not-yet-live owners with dashed optional styling rather than hiding them. Missing routes are operationally important.","Put escalation / approval rules in a small side callout or footer strip, not as extra org nodes."]},{"h":"Node treatments","items":["Front door / command center: focal treatment (accent-tint + accent).","Team / pod / department: backend treatment (white + ink).","Individual agent / owner: store or external treatment depending on whether it is active in the system.","Gap / needs setup: optional dashed treatment.","Approval gate: security treatment, separate from reporting hierarchy."]},{"h":"Complexity budget","items":["Max visible org nodes: 12. If more, create an overview org chart plus separate detail charts per pod.","Max depth: 4 tiers.","Max direct reports under one parent: 5. If there are more, introduce grouping nodes.","Max coral nodes: 1. The org chart's job is clarity, not highlighting everything.","Max side callouts: 2."]},{"h":"Anti-patterns","items":["Using a swimlane when the user's real question is \"who does what?\" Swimlanes explain process; org charts explain ownership.","Drawing every person/agent as an identical box. It hides the front door, specialists, gaps, and escalation paths.","Cramming full job descriptions into nodes. Keep scope phrases short and move detail to summary cards below.","Showing unavailable / not-yet-wired agents as normal active owners. Use dashed optional styling so gaps are visible.","Repeating Slack handles in body paragraphs when a node sublabel can carry the invocation path.","Floating legends in the org area. Use the standard bottom legend strip."]}]},{"slug":"polar","title":"Polar Chart","bestFor":"one quantitative series across 4–8 categories whose clockwise order is meaningful.","lead":"","zh":"极坐标图","example":"example-polar.html","sections":[{"h":"Input contract","items":["Validation rules:","scale.min is exactly 0; truncated radial scales are invalid.","scale.max is finite and greater than 0.","Every value is finite and satisfies 0 <= value <= scale.max.","Category labels are unique after trimming and category count is 4–8.","At most one category is focal.","Categories retain input order; sorting by value would destroy circular meaning.","Missing values are out of scope for the first version. The agent must stop and ask whether to omit the category or supply a value; it must not coerce missing data to zero."]},{"h":"Quantitative encoding","items":["For category i of N, value v, center (cx, cy), and outer radius R:","Angles are expressed in radians for calculation; start_angle is supplied in degrees and defaults to -90, placing the first category at twelve o'clock. clockwise_sign is +1 for the default clockwise order and -1 otherwise.","The value ray is the line segment from (cx, cy) to (x_i, y_i). Its visible length is exactly proportional to v. Endpoint circles have constant radius and encode no additional quantity. No filled sector may sit behind or beneath a value ray, because its area would compete with the declared radius encoding.","The element carrying data-polar-chart must be the chart's root <svg>. Its descendants are limited to <g>, <line>, <circle>, <rect>, <text>, <title>, and <desc>; nested SVGs, paths, polygons, external references, images, and every other element are rejected. Duplicate attributes, mismatched markup, URL-valued SVG references, transforms, CSS loading through @import/url(), and geometry-affecting CSS are forbidden. Chart elements carry neither class nor inline style; document styles may not use selectors capable of matching the chart, except the canonical root svg layout rule. The only external stylesheet allowed is Google Fonts. Every line carries exactly one of data-polar-spoke, data-polar-ray, or data-polar-rule and uses the role's declared stroke width; spoke and ray geometry is verified within min(0.75 px, 5% of R). The five grid circles carry data-polar-ring, use fill=\"none\", a 0.8 px stroke, the chart center, and the 20% through 100% radius intervals exactly once. Every endpoint circle carries data-polar-marker and uses the declared 4 px radius, or 5 px for the focal category, with a 1.2 px stroke. The optional full-canvas background is the only rectangle and carries data-polar-background. This fail-closed allowlist prevents contributors from bypassing the radius-only encoding with an unannotated or falsely annotated filled shape."]},{"h":"Layout conventions","items":["Version 1 supports:","one quantitative series;","4–8 equally spaced categories in a meaningful clockwise order;","a shared linear scale with min = 0 and max > 0;","five circular grid rings at 20%, 40%, 60%, 80%, and 100%;","one optional focal category rendered with the accent token;","minimal light, minimal dark, and full-editorial examples;","horizontal, upright category labels outside the outer ring;","one numeric value label per category.","Version 1 excludes:","DISC, personality, competency, and role-profile wheels whose sectors are qualitative;","arbitrary point placement within sectors;","filled quantitative wedges, gradient bands, or donut hubs;","multiple series, negative values, logarithmic scales, unequal sector angles, and more than eight categories;","animation or interaction.","Use Radar for multiple entities scored across common criteria, Line for more than eight ordered time buckets, and Bar when circular order adds no meaning."]},{"h":"Geometry","items":["All three examples use viewBox=\"0 0 1000 520\", center (500, 230), and R = 160.","Grid rings: r = 32, 64, 96, 128, 160.","Category spokes: center to R, 0.8 px rule stroke, no arrowhead.","Non-focal value rays: 2 px muted stroke; endpoint marker radius 4.","Focal value ray: 2.4 px accent stroke; endpoint marker radius 5.","Ring labels: 0.2 × max through 1.0 × max on the first axis only, arrow-label role 8 px; the example therefore shows 20, 40, 60, 80, 100.","Category labels: at R + 28, node-name role 11 px semibold, horizontal and upright.","Numeric labels: at R + 44, arrow-label role 8 px, including the unit in the chart subtitle rather than repeating it eight times.","Label anchor: middle within 15 degrees of vertical, start on the right half, and end on the left half.","Drawing order: background, rings, spokes, scale labels, non-focal rays, focal ray, endpoint markers, category labels, numeric labels, legend/source note.","The minimal examples use the full 1000×520 canvas. The full-editorial example places the same chart in the existing editorial frame and adds summary cards without changing chart geometry."]},{"h":"Visual treatment","items":["One accent category maximum. All other value rays use the muted token.","Circular rings and spokes are structural grid marks, never category colors.","Endpoint markers are constant-size lollipop heads, not bubbles.","Category labels remain horizontal; tangent rotation is intentionally excluded because it lowers scanability and belongs to the rejected qualitative wheel direction.","The chart must remain understandable in grayscale: position and numeric labels carry the data; accent only directs attention.","The SVG accessible description names the peak category, the scale, and the clockwise category order without narrating geometry."]},{"h":"Complexity budget","items":["4–8 categories.","Exactly one quantitative series.","At most one focal category.","Five grid rings and one numeric value label per category. Numeric labels must be visible through their ancestors: ancestor display=\"none\" and zero opacity suppress descendants, while an explicit child visibility=\"visible\" can restore inherited hidden visibility.","Static output only; split or change type rather than adding interaction or another encoding."]},{"h":"When not to use","items":["Multiple series → use Radar.","Non-cyclic categories → use Bar.","More than eight ordered time buckets → use Line.","Qualitative profiles, arbitrary sector placement, negative values, or logarithmic scales → choose a truthful non-polar representation."]},{"h":"Anti-patterns","items":["Donut hubs or any non-zero inner baseline.","Filled wedges, sectors, or gradient bands that imply area encodes magnitude.","Tangent or rotated category labels.","Multiple series on the same polar chart.","Truncated scales whose minimum is not zero.","Categories sorted by value instead of retaining their meaningful circular order.","Treating a missing value as zero."]}]},{"slug":"process","title":"Process","bestFor":"sequential business processes with multiple actors/divisions where the reader needs to see who does what, what data enters and leaves each step, and which tools are used — not just the step order. Covers responsibility audits, data-quality gate reviews, cross-divisional handoff maps, and end-to-end workflow documentation.","lead":"Prefer swimlane (simpler) when the data types and tools don't matter. Prefer process when each step's input/output payload and responsible team must be legible at a glance. Prefer Service blueprint (type-service-blueprint.md) when the claim is onstage vs offstage across stages — a line of visibility, not sequential handoffs. This type is parametric — the inputs schema in §1 drives every coordinate via the formulas in §2. Two generations from the same inputs must produce visually identical SVG. The rule shapes mirror type-data-flow.md so color override, IN/OUT chip semantic, and reproducibility checklist read identically across types.","zh":"过程图","example":"example-process.html","sections":[{"h":"1. Inputs — the parameter contract","items":["Reserved field semantics:","lanes[k].key — the 3-letter role badge text shown inside every node in that lane.","lanes[k].name — 1 or 2 line lane label; uppercase mono.","steps[j].focal: true — exactly one step may declare this. Header chip renders in accent.","nodes[i].focal: true — exactly one node may declare this. Renders with accent border (§5).","nodes[i].chips — {in: \"<CODE>\", out: \"<CODE>\"} object (either side null to omit). Codes from §8. Skip the input chip on the first step's nodes, skip the output chip on the last step's nodes (no upstream / downstream).","nodes[i].color — optional per-node color override. Any valid \"#hex\" string; the §4 palette is recommended for cross-diagram consistency."]},{"h":"3. Connector rules (mandatory)","items":["Three styles, bound to topology. Connectors drawn before all node rects (z-order rule).","style · Stroke · Width · Dash · Marker · When required","normal · muted · 1.0 · — · arrow · Standard data hand-off between steps or actors. Unlabelled.","focal-in / focal-out · accent · 1.2 · — · arrow-accent · Every edge whose endpoint is the focal node (focal-in) or origin is the focal node (focal-out).","trigger · muted · 1.0 · 4,3 · arrow-sm · Orchestration trigger (scheduler → tool, manual override → upstream step). Unlabelled.","Defs block (required, three markers):","Resolve {ink @ 0.10}, {muted}, and {accent} against the active skin in style-guide.md before emitting."]},{"h":"4. Component color override","items":["Any node, lane, or step accepts an optional color: \"#hex\". Mirrors type-data-flow.md §4 and type-high-level.md §3.4 so the rule reads identically across types."]},{"h":"5. Focal rule","items":["The process diagram has three focal slots, exactly one entry each:","One focal step (steps[j].focal: true) — typically the analytical or decision pivot (Test, Approve, Validate). Header chip and legend chip render in accent.","One focal node (nodes[i].focal: true) — the node that receives the critical handoff. Accent border + accent role chip + ink title (title text stays ink so it's still readable; only the border + role chip carry the accent).","One focal arrow set (style: focal-in and focal-out) — edges into and out of the focal node. Accent solid strokes.","If zero or >1 of any focal slot are declared, halt and ask the user."]},{"h":"6. Dark mode","items":["paper, ink, muted, soft, and accent invert with the skin: take their values from the dark column in style-guide.md. Every derived value in this reference is a role at an opacity, so most need no dark-mode handling: ink @ 0.12 resolves to dark ink on light paper and light ink on dark paper.","Only these differ between modes, and only in opacity:","Element · Light · Dark · Why it differs","Lane tint · ink @ 0.018 · ink @ 0.025 · A wash needs slightly more presence on dark paper","Label col divider · ink @ 0.20 · ink @ 0.22 · ditto","Focal chip fill · accent @ 0.20 · accent @ 0.22 · ditto","Focal node fill · accent @ 0.08 · accent @ 0.12 · ditto","Default node fill · #ffffff (white) · ink @ 0.04 · White is opaque; on dark paper the node lifts off the ground instead","Default node stroke · ink @ 0.25 · ink @ 0.20 · Light ink on dark paper reads stronger at equal opacity","Unchanged across modes: dot pattern ink @ 0.10, dividers ink @ 0.12, default chip fill ink @ 0.12, focal node stroke accent, and custom component colors (C light → C_light, lightened ~15%)."]},{"h":"7. Reproducibility checklist (taste gate)","items":["Before emitting SVG, verify every item:","viewBox = \"0 0 {viewBox_w} {viewBox_h}\" derived via §2.","Header strip at y=0..36; legend strip at y=legend_y_top..viewBox_h (legend_y_top = 36 + n_lanes * 80).","Every node at (step_cx(j) - 50, lane_y_top(k) + 8) size 100×64.","Empty cells render nothing — no placeholder rect, no text.","Exactly one focal step (steps[j].focal: true).","Exactly one focal node (nodes[i].focal: true).","Focal-touching arrows use style: focal-in / focal-out (accent).","All other arrows style: normal (muted solid) or style: trigger (muted dashed). Unlabelled by default.","All arrows emitted before any node rect (z-order rule).","Single-bend right-angle routing only — exit right, enter top/bottom. No diagonals. Q-bezier r=8 at each bend.","Custom component colors ≤ 3 (in addition to the focal pair). Arrows never recolored by component color.","Subtitle and tool labels stay muted regardless of any component color. Input chip skipped on first step's nodes, output chip skipped on last step's nodes."]},{"h":"8. Data-type chips reference (input + output)","items":["Same catalog as type-data-flow.md §8.","Input chip at (node_x+4, node_y+54) — bottom-left. Payload entering the node.","Output chip at (node_x+80, node_y+54) — bottom-right. Payload leaving the node.","Either chip may be omitted (first/last step, unknown payload)."]},{"h":"9. Legend (3- or 4-row strip)","items":["Each row introduced by a category label at x = label_col_w + 4 (= 144). The default legend has 3 rows (STEPS / DATA TYPE / FLOW); when one or more nodes carry a color override (§4), add a 4th CONCERN row and grow legend_h to 100.","Row 1 — STEPS at y = legend_y_top + 16: repeat the header chips with their labels. Focal step keeps accent fill.","Row 2 — DATA TYPE at y = legend_y_top + 37: one swatch per chip type actually used in the diagram. Append a small sub-hint in muted mono: left chip = input · right chip = output.","Row 3 — CONCERN (only when color overrides are present) at y = legend_y_top + 58: one mini-rect per custom color used, with its semantic label.","Row 4 — FLOW (position depends on whether CONCERN row exists): one segment per arrow style actually used, with marker + label."]},{"h":"10. Complexity budget","items":["Dimension · Max","Lanes (actors) · 6","Steps · 12","Nodes per lane · Nodes = active steps only — empty cells are invisible","Labelled arrows · 0 by default (label only for non-step concepts)","Data-type chips per node · 2 (input + output)","Custom-colored elements (§4) · 3 (in addition to focal node + focal step)","Above 6 lanes or 12 steps: split into two diagrams (overview + detail)."]}]},{"slug":"pyramid","title":"Pyramid / Funnel","bestFor":"hierarchy of needs, prioritization ranks, value pyramids, conversion funnels, content importance stacks.","lead":"","zh":"金字塔","example":"example-pyramid.html","sections":[{"h":"Two orientations — pick one","items":["Pyramid (point up) — narrow apex = most important / rarest / most valuable. Base is broadest / foundational.","Funnel (point down) — narrow end = conversion (smallest group). Top is widest / audience.","Don't mix orientations on one diagram."]},{"h":"Layout conventions","items":["4–6 layers. Each layer is a trapezoid built from an SVG <polygon> with 4 points.","Consistent layer height (56–72px).","Widths decrease linearly from base to apex (pyramid) or top to bottom (funnel). When showing real funnel data, widths must be honest (proportional to count/percentage).","Each layer has:","Name label centered inside the trapezoid — node-name role, 12–14px 600.","Sublabel below or beside the name — sublabel role, 9–10px.","Side annotation (right or left) — optional. For funnels: drop-off percentage here (−40%).","Fill: subtle graded tints OR all paper-2 with hairline dividers (cleaner). Pick one.","Stroke: 1px hairline between layers; outer silhouette 1px muted or ink.","Coral on ONE layer only: apex of pyramid, conversion layer of funnel, or critical bottleneck.","Optional left-margin axis arrow + eyebrow-role label (rarer ↑, drop-off ↓)."]},{"h":"Anti-patterns","items":["7+ layers (illegible — compress or split).","Pyramid for non-hierarchical data (use a tree or bar chart).","Dishonest widths (fake equal spacing when drops are unequal).","Coral on the base layer (dilutes the \"apex = rare\" signal)."]}]},{"slug":"quadrant","title":"Quadrant","bestFor":"prioritization (Impact × Effort), positioning (Reach × Frequency), portfolio maps, 2×2 decision frames.","lead":"","zh":"四象限","example":"example-quadrant.html","sections":[{"h":"Layout conventions","items":["2×2 grid. Axis lines: 1px ink cross through the center.","Axis labels: Jobs-minimal. One single word at each arrow tip — no glyphs baked into the label (no ↑ / → / ← / ↓), no parentheticals, no \"HIGH / LOW\" modifiers. eyebrow role at 9px regular weight, tracked 0.18em, uppercase. Flank the arrow tips — never sit labels on top of the axis line. Shorten the arrow enough (~60–80px inside the viewBox edge) to leave breathing room for the labels beyond the tips.","Never label at the midpoint.","Items: small labeled dots (r=4) positioned in the quadrants. Labels 8–10px away; don't let labels cross axis lines.","Coral on the \"do first\" item (typically top-right).","Limit to ~12 items; cluster or split beyond that."]},{"h":"Anti-patterns","items":["Four filled quadrants in different colors — position + label does the work; color noise weakens it.","Items placed on axis lines (ambiguous quadrant).","Missing axis names."]},{"h":"Consultant special (2×2 scenario matrix)","items":["A layout variant of the standard quadrant — same house skin (warm paper, dot pattern, title serif, mono eyebrows, one accent focal). The grammar shifts: axes hold a range rather than a measurement; cells hold named scenarios rather than positioned items.","Use when: you're framing four futures, archetypes, or strategic options across two independent drivers — classic scenario planning, positioning frames, or 2×2 strategy decks (BCG/McKinsey territory). The reader should come away with four named bets, not a point cloud.","Do not use for prioritization, density maps, or anything where the position inside a cell carries meaning — that's the standard quadrant above."]}]},{"slug":"radar","title":"Radar / Spider","bestFor":"comparing 3–5 entities across 3–5 quantitative criteria on a single normalized 0–N scale. Capability matrices, product or backend evaluations, framework/team scorecards. Where a comparison table starts running out of horizontal room, radar makes the shape of each option legible at a glance.","lead":"","zh":"雷达图","example":"example-radar.html","sections":[{"h":"Layout conventions","items":["N axes (3–5). Equally spaced on a regular polygon-N. First axis at the top (-90°), going clockwise. Above 5 → split or use a comparison table.","Five concentric grid rings at fractions 0.2 / 0.4 / 0.6 / 0.8 / 1.0 of the radius. Drawn as closed polygons connecting the axis vertices at that fraction. Inner four at rule 0.10 opacity, outer ring at rule-solid 0.20 (a hint stronger to anchor the chart).","Axis spokes from center to each outer vertex. rule-solid 0.20 opacity. No arrowheads.","Axis labels: one word per spoke (Jobs-minimal). node-name role 11px weight 600. Place 16px outside the outer ring along the axis vector. Top/bottom = text-anchor=\"middle\"; right side = start; left side = end.","Scale ticks (e.g. 2 4 6 8 10) only on the first (top) axis — putting numbers on every spoke clutters the chart fast. arrow-label role 8px, muted, anchored end at cx − 6.","Series polygon: stroke 1.5px at the series color, fill the same color at 0.18 opacity (0.22 in dark). Stroke 1.8px on the focal series — a subtle weight bump.","Vertex dots: only on the focal series, r=4 filled with the series color. Non-focal series are stroke-and-fill only. This is the load-bearing rule that keeps the chart readable at 4–5 series.","Drawing order: dots-pattern bg → grid rings → axis spokes → axis labels → scale ticks → non-focal series (smallest area first) → focal series → focal vertex dots → legend.","Legend: horizontal strip at the bottom (per the global rule). Swatch is a 16×8 rectangle (matches the polygon stroke+fill, not a circle), then the entity name. ~140px between entries. Optional italic tail on the right with the rationale (\"One coral. Position is the signal — color reserved for the recommended option.\")."]},{"h":"Math","items":["For axis i (0-indexed) of N, value v on scale S, center (cx, cy), outer radius R:","A series with values [v0, v1, ..., v(N-1)] becomes a <polygon> with points=\"x0,y0 x1,y1 ...\"."]},{"h":"Series palette","items":["The skill's \"1-focal\" rule still holds: accent is reserved for the focal series, and a small editorial palette (series-1 through series-5, defined in style-guide.md) covers the non-focal series. Don't reach for free-form colors.","Slot · Token · Hue","Focal · accent · the skin's accent","1 · series-1 · sage","2 · series-2 · dusty-blue","3 · series-3 · mustard","4 · series-4 · rust-brown","5 · series-5 · slate","Light and dark values for every slot live in style-guide.md § Series palette."]},{"h":"Anti-patterns","items":["More than 5 series → mush. Split into two charts (e.g. \"best by latency\" + \"best by ops\") or switch to a comparison table.","Axes on inconsistent native scales (one 0–100, another 0–1) without normalization. Always normalize to 0–N first — radar polygons compare shapes, not absolute values.","Zero-baseline tricks — starting the inner ring at v=5 to amplify differences. The grid starts at 0; if differences look small, that's the truthful reading.","Dots on every series. Only the focal carries dots. Adding them to all 4–5 series turns the chart into a bead curtain.","Radar with 2 series — a comparison bar chart or a 2-row table is clearer.","Non-quantitative axes. All axes must be measurable on the same normalized scale. \"Speed\" + \"color\" + \"year\" mixes don't belong on a radar.","Mono-font axis labels. Names go in the node-name sans family (the global rule). Mono is for technical sublabels only.","Rainbow palette. Even with the new series-* tokens, you don't need all 5 in one chart — use only as many as you have non-focal entities."]}]},{"slug":"requirement-traceability","title":"Requirement traceability","bestFor":"answering which identified requirements come from a source, have a design element that satisfies them, and have a test or inspection that verifies them. The fixed source × requirement × design × verification trace makes an absent link visible. Use it only when the IDs and relationships come from supplied sources. An illustrative example must say so.","lead":"Not this type: A generic package dependency graph has no required requirement or verification column; use Dependency graph for that. Use Heatmap when each cell encodes a value rather than a cited element ID and a typed relationship. Use UML class for type structure and inheritance.","zh":"需求追溯","example":"example-requirement-traceability.html","sections":[{"h":"Layout conventions","items":["One row per requirement, in a stable source order. Four fixed columns: Source, Requirement, Satisfied by, Verified by. The latter two headings state the relationship direction without relying on arrow placement.","Each source cell prints a source ID and citation. Each requirement cell prints a stable ID and short statement. Each linked cell prints its element ID and short name. Its relationship type is visible in the column heading and in the cell label.","Keep the three cells on the same horizontal row. Separate rows with a solid neutral rule. Do not draw links across rows or rely on color alone to imply coverage.","If a relationship is absent in real input, show No linked element or No verification in its cell. Do not invent a link or turn a missing relationship into an empty box.","Preserve one focal row at most. Accent may mark a coverage gap or an important requirement, but the text must name the condition."]},{"h":"Complexity budget","items":["At most 6 requirement rows, each with one primary design link and one primary verification link in this overview. Split complex many-to-many trace data into an overview and a detail or use a table.","At most one focal row. Do not shrink text to fit more rows."]},{"h":"Anti-patterns","items":["Anonymous boxes, untyped lines, or a design-to-test arrow presented as proof that a test verifies the requirement.","A green status that hides a missing test ID or source reference.","Repeating one test across requirements without checking that it actually verifies each requirement.","Treating an illustrative specimen as evidence of a real system's compliance."]}]},{"slug":"sankey","title":"Sankey / Flow-Quantity","bestFor":"showing where a quantity goes as it splits and merges across a small number of stages — CI compute budgets, funnel-adjacent volume flows, cost or headcount allocation. This is the one type where band thickness carries data; if the reader doesn't need to compare magnitudes, use process or pyramid instead.","lead":"Printed node quantities preserve their complete numeric token, including finite decimal or scientific notation before the unit suffix. A quantity must be positive for a visible node bar; signs and exponents must not be discarded while checking its scale. The resulting pixels-per-unit scale and relative comparisons must also be finite; a quantity outside that arithmetic range is rejected rather than certified.","zh":"桑基图","example":"example-sankey.html","sections":[{"h":"Layout conventions","items":["Exactly 3 stage columns, left → right. No more, no less — above 3 stages, split into two linked diagrams.","Nodes are vertical bars, width=12, solid ink fill, no stroke. Height is proportional to the quantity passing through, rounded to the nearest 4px so it stays on-grid — the rounding is a rendering step, not a data change; the true value still prints in the quantity sublabel.","Flows are filled ribbons, not stroked lines: a single closed <path> per flow. Top edge is a cubic Bézier from the source node's top-offset to the target node's top-offset; bottom edge is the same curve run in reverse from target-bottom back to source-bottom. Both control points sit at the horizontal midpoint between the two columns, each at the y of the end it belongs to: C midX,y0 midX,y1 targetX,y1. That is what makes the band leave and arrive horizontally, so it plugs into each bar square-on. Putting the second control on the target's x instead (C midX,y0 targetX,y1 targetX,y1) collapses it onto the endpoint, the arrival tangent degenerates, and every ribbon meets its bar at a visible slant — it looks like the band is not attached.","No arrowheads, ever. Direction is implied by the left-to-right column order. This is a deliberate, explicit exemption from SKILL.md §6's orthogonal-elbow-and-arrowhead rule: ribbons are area encodings, not connectors, and a marker on a filled band reads as clutter, not information.","Ribbon fill: muted at 0.18 opacity for ordinary flows. The one editorial focal path (see below) uses accent at 0.28 opacity. A focal path may span more than one ribbon segment (e.g. two flows that both feed the same downstream node as halves of one story) — accenting every ribbon that belongs to that single path still counts as one focal element, not one per ribbon. Never per-flow rainbow coloring — color is reserved for the one path that deserves attention.","Node ordering minimizes crossings. Order nodes within each column so that flows converging on (or diverging from) the same node stay in a consistent top-to-bottom sequence across columns. If two ribbons still cross more than once, reorder the nodes — don't let them tangle.","Labels: node name in the node-name role 12px 600, quantity directly under it in the sublabel role 9px muted. Placement is column-specific: column 1 sits outside the bar, text-anchor=\"end\"; column 2 sits in the gutter above its bar, text-anchor=\"middle\", vertically centred in that gutter rather than flush to the top, or the cap line grazes the bar above; column 3 sits outside the bar, text-anchor=\"start\".","Centring the column-2 label in its gutter is what makes it legible: the gutter is the gap the bands themselves leave between two nodes, so a centred label sits on clean paper and needs no backing at all. Don't reach for a mask rect here — over a filled band it reads as a hole punched in the diagram, and if the label already sits on paper it is solving nothing. If a label genuinely has nowhere clear to sit, the column is over budget: drop a node or split the diagram.","Column headers: eyebrow role 8px, uppercase, tracked, centered above each column — \"CI COMPUTE BUDGET / TEST STAGE / OUTCOME\" style eyebrows, not full sentences.","Drawing order: background → column headers → ordinary ribbons → the accent path's ribbon(s) (painted last among ribbons so they read on top) → node bars → node labels → legend.","Legend: horizontal strip at the bottom per the global rule, viewBox extended ~60–100px to fit it (a Sankey's ribbons need more bottom clearance than a typical diagram because node stacks run tall). Swatches are 16×8 rectangles matching each ribbon treatment, plus an optional italic aside stating the editorial read."]},{"h":"Scale rule","items":["Pick one px-per-unit constant k for the whole diagram and apply it to every node and ribbon thickness — never a different scale per column. Round each resulting thickness to the nearest 4px (grid compliance) and reconcile the rounding at the node level, not the flow level, so a node's outgoing ribbons still sum exactly to its (rounded) height.","When you control the numbers, choose ones that land on the grid. At k, a 4px step is 4/k units; pick quantities that are whole multiples of it and the drawn area is then exactly the printed number. Rounding is the fallback for real data you cannot choose, and it is a real cost: at k = 0.02 a 4px step is 200 minutes, so a rounded bar can misstate its own label by up to 100. In a chart whose entire premise is that area encodes quantity, a bar that disagrees with the number printed beside it spends credibility to buy grid compliance. Never let the rounding exceed one 4px step, and never round a flow so far that a node's ribbons no longer sum to its bar.","Minimum rendered ribbon thickness: 4px. Anything that would round to less gets folded into an \"other\" band rather than drawn as an invisible hairline — a Sankey ribbon the reader can't see isn't communicating anything."]},{"h":"Complexity budget","items":["Limit · Rule","Max stage columns · 3","Max nodes · 8","Max flows (ribbons) · 12","Max accent elements · 2 (a focal path's ribbons count as one, regardless of how many segments it spans)","Over budget → split into two linked Sankeys (e.g. an overview stage-1→stage-2 diagram plus a detail stage-2→stage-3 diagram) rather than cramming a fourth column or a ninth node into one canvas."]},{"h":"Anti-patterns","items":["Ribbons that meet the bar at a slant. The single most common way to get this type wrong, and it is a control-point mistake, not a layout one: both controls belong on the midpoint x. A band arriving at an angle reads as detached from its node, which undermines the one thing the diagram is asserting — that this quantity flows into that node.","An opaque mask rect behind a column-2 label. Over a filled band it reads as a hole punched in the diagram, and it erases any bar it overlaps. Centre the label in the gutter instead, where it sits on clean paper and needs nothing behind it.","Column-2 labels flush to the top of their gutter. Centre them, or the cap line touches the bar above and the label looks like it belongs to the wrong node.","A bar whose height disagrees with the number printed beside it. See the scale rule: choose grid-friendly quantities when the data is yours to choose.","Ribbons crossing more than once. Reorder the nodes in the offending column; a Sankey with a tangle in the middle is unreadable.","Ribbons thinner than 4px. Merge them into an \"other\" band instead of drawing a sliver no one can see.","Per-flow rainbow coloring. One muted treatment for ordinary flows, one accent treatment for the flow that carries the editorial point — never a distinct hue per ribbon.","Using Sankey for a simple funnel. A single narrowing quantity with no splits or merges is a pyramid/funnel, not a Sankey.","Using Sankey for a plain step sequence. If nothing splits, merges, or varies in thickness, it's a process diagram — the whole point of Sankey is quantity that branches.","Stacking two flows at the same node-edge offset. Every flow gets its own offset range within the node's height, in a consistent top-to-bottom order — never two ribbons overlapping at the same attach point.","Percentages or quantities that don't sum to the source total. Every node's outgoing (or incoming) flows must sum to that node's own height. A Sankey that doesn't balance reads as an error, not a design choice."]}]},{"slug":"sbgn","title":"SBGN","bestFor":"a biological process as a bipartite species/process graph — carotenoid cleavage, a signalling cascade, a metabolic map — where each reaction is a process node, each molecule is a species node, and every arc has a role (consumption, production, reversible, modulation). Use when the reader must see what is consumed, what is produced, and inside which compartment.","lead":"Not this type: ","zh":"通路图 SBGN","example":"example-sbgn.html","sections":[{"h":"Layout conventions","items":["Bipartite. Every reaction is a process glyph (a 32×32 square). Every molecule is a macromolecule (a rounded rectangle). Never attach two species directly; never attach two processes directly.","Compartment first. Draw the enclosing compartment (cytosol, chloroplast, nucleus) as a zone rect before arrows and nodes. One compartment in the canonical budget. Label it on a paper mask on the top edge.","Primary flow left → right: substrates, then processes, then products. Fan-in to a shared product uses a dedicated vertical trunk; do not stack two productions on one y.","Orthogonal connectors with r=8 elbows (SKILL.md §6). Consumption and production take the filled arrow marker. A reversible pair is two-headed. Modulation takes the open-circle marker.","1 coral focal: the species or process the figure exists to show, at most two accent elements in all. In the worked fixture that is beta-carotene and its cleavage process v1; every arc stays in ink.","House style, SBGN shapes. Monochrome ink/muted, one accent. Keep SBGN's shape semantics (square process, rounded macromolecule, empty-set source/sink, circle-headed modulation) rather than colour-coding roles."]},{"h":"Budget","items":["≤7 macromolecules, ≤6 processes, ≤1 compartment, ≤2 source/sink glyphs, ≤16 arcs, 2 accent elements. This ceiling replaces SKILL.md §7's 9 nodes and 12 arrows rows for SBGN only (see layout-budget.md); the other universal rows still apply. That ceiling is the Bruno_JExpBot2016 fixture: seven carotenoid species, six cleavage reactions, one cytosol. More species → split the map (overview of the pools, then one cleavage family)."]},{"h":"Anti-patterns","items":["A species–species arrow with no process node — that is a flowchart, and it hides the reaction.","A database or architecture box used as a macromolecule.","Colour as the only distinction between consumption and modulation — the markers must differ, because greyscale still has to tell them apart.","Importing SBML or SBGN-ML in this skill — author from the prompt; an extractor is a later, separate surface.","Flattening the compartment into a caption (all of this is cytosol) — the compartment is a glyph."]}]},{"slug":"scatter","title":"Scatter Plot","bestFor":"correlation and distribution — two continuous variables plotted against each other. Use when the relationship (or lack of one) between variables is the message, or when you need to identify clusters, outliers, and high/low performers.","lead":"","zh":"散点图","example":"example-scatter.html","sections":[{"h":"Layout conventions","items":["Plot area margins: left 80px, bottom 60px, top 40px, right 40px — inside 0 0 1000 500 viewBox.","Point count: 5–30 points. Fewer → just describe the relationship in prose; more → bin into a density contour.","Axes: X at y=420 (baseline), Y at x=80. Both use arrow-label role 8px gridline labels. Gridlines 4–6 per axis at equal intervals.","Point shape: <circle> r=5 for standard points, r=6 for focal. Focal point in accent fill. Others in muted @ 0.20 fill + muted stroke.","Labels on points (optional): arrow-label role 8px next to a point. Use a paper-fill rect mask behind the label. Label at most 2–3 points; not all.","Trend line (optional): <line> from lower-left to upper-right, stroke ink @ 0.25 dashed 4,3. Never force a perfect fit — only add if the trend is visually obvious.","Quadrant dividers (optional): light dashed lines at the median x and y to split into quadrants. Label each quadrant in the arrow-label role at 8px, muted."]},{"h":"Anti-patterns","items":["More than 30 points without clustering (jitter/mush) — when the crowd itself is the story, hand it to the beeswarm variant below, which packs instead of jittering.","Forced trend line when the data is genuinely scattered — dishonest.","Point labels on every point (label the focal and 1–2 notable outliers only).","Ad-hoc bubble size encoding on a plain scatter. Size perception is unreliable enough that it earns its own contract: when the third value genuinely matters, use the bubble variant below, which pins area to the value and gates it with scripts/verify-bubble.py; when it doesn't, a third axis label or a focal choice says it cheaper.","Axes that don't include zero when the absolute position matters; axes that do include zero when the range is tiny and far from zero."]}]},{"slug":"sequence","title":"Sequence","bestFor":"request/response flows, protocol exchanges, multi-actor interactions over time, API call traces, incident reconstructions, auth/token refresh paths with branching.","lead":"","zh":"时序图","example":"example-sequence.html","sections":[{"h":"Layout conventions","items":["Actors as boxes in a horizontal row at the top.","Lifelines: dashed vertical lines descending from each actor to the bottom.","Messages: horizontal arrows between lifelines; time flows top→down.","Activation bar: narrow rectangle (w=8, muted fill, 0.8 hairline stroke) on a lifeline spanning the interval that actor holds control. Stack for nested calls.","Self-messages: short U-shaped loop returning to the same lifeline; label right of the loop.","Return messages: dashed stroke + filled marker (never open). Prefer muted; optionally match the originating call color when pairing multi-hop stacks. Headline success may use solid coral (see Message kinds).","Coral on the primary success response or headline message — one, maybe two. Actor focal strokes do not count toward the coral message budget.","When the flow branches (valid vs invalid token, retry, optional step), draw a combined fragment frame — do not invent free-floating if/else arrow clusters."]},{"h":"Message kinds","items":["Kind · Stroke · Marker · When","Call (sync) · solid muted or link-blue · filled · Request that expects a reply","Return · dashed muted (or match call color) · filled · Reply to a sync call — never solid","Async / fire-and-forget · dashed muted · open arrowhead · Beacons, events, one-way notify","Headline success · solid accent (≤1–2 messages) · accent filled · Primary happy-path response only"]},{"h":"Combined fragments (alt / opt / loop)","items":["Use a rectangular frame that spans only the lifelines participating in the branch. Operator label uses the eyebrow role, uppercase, in a small tab at the top-left of the frame. Time still flows top→down inside the frame."]},{"h":"Complexity budget (sequence-specific)","items":["Max lifelines: 5 (same as the §7 budget table in layout-budget.md).","Max messages (arrows): 12.","Max combined fragments: 1 (hard default); 2 only if each is a single-region opt/loop.","Max alt regions: 2.","Max fragment nesting depth: 1.","Max coral elements: 2 (prefer 1 for fragment diagrams).","If you exceed, split: overview (happy path) + detail (failure / refresh path)."]},{"h":"Anti-patterns","items":["Message arrow pointing upward (reverses time — never).","Activation bars that never close.","Labels sitting over another lifeline — shorten or shift y into a gap.","Swimlane-style lanes instead of lifelines (different grammar).","Drawing if/else as two free-floating arrow clusters with no fragment frame.","Nested alt inside alt (split into two diagrams).","Fragment operator label in the node-name sans family — must be mono (eyebrow): ALT / OPT / LOOP.","Coral on both alt branches.","Frame that covers actors with no messages inside the fragment.","Filled arrowhead on async fire-and-forget (use open marker).","Open arrowhead on return messages (returns stay filled + dashed)."]}]},{"slug":"service-blueprint","title":"Service Blueprint","bestFor":"showing how a service actually runs across a few stages — what the customer does, what they can see, and what stays hidden. The line of visibility is the load-bearing element: customer and frontstage actions sit above it, backstage and support sit below it, on one shared stage grid. Use it when the reader needs to see that a failure is a billing job, a queue, or a fraud check even though the customer row still looks like a simple retry.","lead":"Not this type: ","zh":"服务蓝图","example":"example-service-blueprint.html","sections":[{"h":"Layout conventions","items":["Orientation: stages as equal columns (left → right in narrative order), layers as labeled rows (top → bottom). No connector arrows in this version — that is swimlane territory.","ViewBox: 0 0 1280 720 for the minimal examples. Full editorial keeps the same SVG and adds cards.","Left margin: 96px for layer labels. Geist Mono 8px, uppercase, horizontal, text-anchor=\"end\" at x=88. Never writing-mode: vertical.","Stage grid: 4–6 columns. The worked example is 5 × 208px with 16px gutters (col_x = 96 + i·224). Each header carries data-stage on a rect at the column origin; every cell in that column uses the same x.","Layer order, top to bottom:","Physical evidence (optional) — 48px","Customer actions (required) — 64px","Line of interaction (hairline)","Frontstage actions — onstage staff or the visible product (required) — 64px","Line of visibility (load-bearing; heavier than the other lines)","Backstage actions (required) — 64px","Line of internal interaction (hairline)","Support processes (optional) — 48px","Hairlines: 8px band including stroke. Interaction and internal-interaction are 1px rule (data-role=\"interaction\" / data-role=\"internal-interaction\"). Visibility is 2px ink at 0.55 opacity (data-role=\"visibility\"), which must clear 3:1 on paper — 0.45 fails that bar on light paper, so do not go thinner.","Cells: one action per stage per layer. Geist 12px, one line, centered on the column. A second muted mono line is allowed for a system or wait (dunning-job · 4h). Empty required cells are allowed only with an explicit — or Not applicable as data-name and as the printed text.","Fills: customer and frontstage are paper/white with ink stroke. Backstage and support take a light ink tint so the below-the-line band reads as hidden work, not another onstage row.","Focal cell (≤1, optional): the failure, wait, or handoff the figure exists to show — usually on or below the visibility line. Accent fill rgba(191,69,32,0.12) (dark: rgba(240,138,89,0.18)), accent stroke, data-focal=\"true\".","Legend: horizontal strip after a hairline rule, three keys in this order — visibility line, backstage layer, focal cell."]},{"h":"Anti-patterns","items":["No visibility line, or a line that sits in the wrong gap (not between frontstage and backstage). Without the line this is just a table of rows.","Sentiment curve on a blueprint. That is a journey; split the figures.","Arrows crossing layers. That is a swimlane.","Accent on every failing cell. One focal cell; the rest of the grid is census.","Empty required layers with no — / Not applicable mark.","More than 6 stages; more than two lines of cell text.","writing-mode vertical layer labels. Horizontal only, in the left margin."]},{"h":"Honesty rules","items":["The grid is a census, not a flow chart. Stage order is the sequence. Wait times and system names are cell text, not edges.","Required layers are complete. Every stage has a customer cell, a frontstage cell, and a backstage cell. An empty slot still occupies its column and says so.","The visibility line is checkable. It spans the plot, sits in the frontstage/backstage gap, and its stroke clears 3:1 against paper.","Printed text matches data-name. A cell that draws \"Retry payment\" and declares another action is two stories.","These rules are executable: scripts/verify-service-blueprint.py reads the declarations and fails on layer order, visibility, grid, census, focal, budget, printed-label, contrast, or CSS-moved marks. scripts/test-verify-service-blueprint.py proves both polarities — the shipped examples pass, and each mutation class above fails with a named finding."]}]},{"slug":"state","title":"State Machine","bestFor":"finite state logic — order status, auth state, connection lifecycle, form wizard, job queue status — and the Lifecycle phase map pattern when one subject's progress, waits, retries, cancellation, and outcomes are the story.","lead":"","zh":"状态机","example":"example-state.html","sections":[{"h":"Routing distinctions","items":["Use Sequence for time-ordered messages between actors, including request/message lifecycles.","Use ordinary State Machine for dense transition logic where events, guards, and legal transitions dominate.","Use the Lifecycle phase map semantic pattern for one subject moving through 4–5 primary phases with separate wait/recovery and terminal-outcome bands."]},{"h":"Layout conventions","items":["States are rounded rectangles (rx=8), labeled in the node-name role.","Start: filled ink dot (r=6). End: ringed dot (outer r=8 outline, inner filled r=5).","Transitions: curved arrows labeled in the arrow-label role as event [guard] / action (omit sections you don't need).","Self-loops curve above the state.","Orient along the dominant flow direction (left→right or top→down); rearrange before crossing transitions.","Coral on the state the reader should notice — typically the error state, or \"happy completion\"."]},{"h":"Anti-patterns","items":["More transitions than states × 2 → likely two state machines.","\"From any state\" transitions drawn from every state — use a single annotation (* → Error on timeout) instead.","Unlabeled transitions (the whole point is what triggers this)."]}]},{"slug":"steps","title":"Steps","bestFor":"a short, ordered sequence of stages where the order is the claim and each stage needs a number, a compact visual cue, a title, and one brief explanation. Use it for methods, playbooks, onboarding paths, launch checklists, and “how it works” explainers.","lead":"Prefer Timeline when spacing encodes real elapsed time, Flowchart when the route branches, Swimlane when ownership and handoffs matter, and Process when each stage must expose actors, tools, or input/output payloads. Steps has one rail, no branches, no time scale, and no actor lanes.","zh":"步骤图","example":"example-steps.html","sections":[{"h":"1. Inputs","items":["Rules:","steps contains 3–7 entries. Fewer than three is a list; more than seven needs grouping or a second diagram.","Exactly one step is focal: true. It is the decision, transformation, or risk the figure exists to emphasize.","number is two digits for fewer than 100 steps (01, 02, …) so the rail scans evenly.","description is one or two short lines, each no longer than 26 characters at the standard ramp. Rewrite rather than shrink.","icon is optional and must come from primitive-icons.md. Omit icons from every step if a coherent set is unavailable; never mix line icons, emoji, and brand marks."]},{"h":"2. Layout grammar","items":["The canonical doc-wide canvas is 1280×720. All structural coordinates sit on the 4px grid.","This yields a 224px stage for 3–5 steps, 184px for 6, and 160px for 7. Keep stage_w on the 4px grid, center the combined rail, and preserve at least 24px between description columns. If copy does not fit the narrower six- or seven-stage columns, widen the canvas or rewrite the copy; do not reduce the type ramp."]},{"h":"3. Focal and color rules","items":["One step is focal. Treat its number, guide, rail segment, medallion outline/icon, and title as one visual unit. All remaining steps stay neutral.","Do not assign a different hue to every step. The familiar five-color infographic treatment turns sequence into a legend-reading task and conflicts with the global 1–2 accent rule. If stages genuinely encode categories rather than order, use a chart or another type whose color carries data."]},{"h":"4. Legend","items":["Use a bottom strip only when the focal state needs explanation. The canonical examples show:","neutral outlined medallion — Stage","accent outlined medallion — Focal stage","italic note — Equal spacing shows order, not elapsed time.","If the title or subtitle already names the focal stage and the distinction is obvious, remove the legend."]},{"h":"5. Reproducibility checklist","items":["Step count is 3–7 and exactly one entry is focal.","Step origins, segment widths, medallion centers, and copy anchors derive from §2.","The rail is contiguous; there are no gaps, arrowheads, or diagonal connectors.","Every medallion has an opaque paper mask beneath its outline.","Every step either has one icon from primitive-icons.md or all icons are omitted.","Titles stay at 12px and descriptions at 9px; long copy is rewritten, not shrunk.","The focal step is the only accent-bearing stage.","The SVG uses the accessible SVG contract and the wrapper owns horizontal scrolling."]},{"h":"6. What verify-steps.py requires","items":["The checker reads attributes, so every mark binds itself to its stage and draws exactly what it states.","Bindings. Each stage has one rail <rect data-role=\"rail\">, one medallion <circle data-role=\"medallion\"> and one number <text data-role=\"number\">, all with the same unique data-step. Rails also carry data-index 1..n in left-to-right order. Exactly one rail and its medallion carry data-focal=\"true\".","Geometry. Rails share y, width and height and touch end to end. Medallions are centered on their segment with one shared radius; numbers are centered on it at x and print the two-digit index. Every mark stays inside the viewBox.","Allowed attributes. A rail may carry only x y width height fill fill-opacity, a medallion only cx cy r fill stroke stroke-width, a number only x y fill font-size font-weight font-family text-anchor, plus their data-* bindings. No style, class, id, transform, dx/dy, opacity or anything else. A number contains only its text.","Groups. Marks sit only inside plain <g> groups of the one root <svg>, never inside defs, a nested svg or any other element. A group above a mark may carry only aria-hidden fill stroke stroke-width stroke-linecap stroke-linejoin font-family font-size font-weight letter-spacing text-anchor. No attribute may appear twice on any element.","Paint and type. The first <rect> in the SVG is the paper (#f5f5f5 light, #2d3142 dark). Rails fill with a non-paper house ink above zero alpha. Medallion outlines and numbers use a house ink at 0.4 alpha or more. Numbers resolve to font-size 8 or more, a font family starting with Geist, Geist Mono or Instrument Serif, and text-anchor=\"middle\". Strokes are at most 4 wide.","Page and CSS. Style marks with presentation attributes. Stylesheet rules that can reach the SVG may set only box-sizing, margin, padding and custom properties; nothing may move or hide the diagram. CONTRIBUTING.md lists the page rules in full.","A minimal three-stage figure that passes, with the second stage focal:"]},{"h":"7. Anti-patterns","items":["Rainbow stage bands with no categorical meaning.","Using Steps for dated events, branching decisions, actor handoffs, or feedback loops.","Paragraphs under each stage; two short lines is the ceiling.","A different icon style per stage, emoji mixed with line icons, or icons that repeat the title without adding recognition.","Arrowheads between every adjacent segment. The left-to-right rail already says “next.”"]}]},{"slug":"story-map","title":"User Story Map","bestFor":"the Jeff Patton user story map — it answers \"what is the whole story, and where do we cut the first release?\" Narrative order runs left to right; priority runs top to bottom. The release cut is the editorial point of the diagram: a map without one is just a backlog in a grid.","lead":"This is neither Kanban nor User journey, and the distinction is load-bearing: Kanban shows state — columns are Todo/Doing/Done, there is no narrative order and nothing to slice. User journey shows one persona's feelings across stages via a sentiment curve. A story map has neither state nor sentiment. Its columns are narrative order and its rows are release slices. If you aren't slicing releases, use one of those two instead.","zh":"故事地图","example":"example-story-map.html","sections":[{"h":"Layout conventions","items":["Vertical stack, top to bottom:","Backbone — up to 5 activities in left-to-right narrative order, as wide header cards (200px, rx=6, ink @ 0.05 fill, muted stroke). Each card: the activity name in the node-name role, 12px, weight 600, above an eyebrow-role 8px uppercase tracked eyebrow (ACTIVITY 1 … ACTIVITY 5). 24px gutters between cards.","Walking skeleton row — directly under each activity, its user steps as smaller cards (rx=4, 32px tall, white fill, ink stroke), node-name family 12px. One or two per activity; reserve room for two so every activity's row bottom aligns even when it only has one step.","Release slices — horizontal bands below the skeleton row, each a full-width lane with an eyebrow-role 8px uppercase tracked label (MVP, RELEASE 2, LATER) sitting in a 96px left margin. Band background alternates ink @ 0.02 / none. Inside each band, story cards (rx=4, 48px tall) sit in their activity's column: story title in the node-name role, 12px, weight 600, plus a sublabel-role 9px estimate/ticket sublabel (e.g. RPT-114 · 3pt). Whenever any slice has a gap (an activity with no card in that row), add rule hairline column separators (0.8px, dashed 4,4, 0.10 opacity) running from just under the backbone down to the bottom of the last slice, drawn before the cards — without them, a gappy grid reads as scattered rather than mapped to its activity.","The release cut line — a full-width horizontal accent rule (1.5px) immediately under the MVP band, with a masked arrow-label-role 8px label RELEASE CUT at its right end. This is accent element one.","Legend — horizontal strip at the bottom per the global rule (hairline separator above): one swatch for the default story card, one for the highest-risk treatment, one for the release-cut line."]},{"h":"Focal rule","items":["Exactly 2 accent elements: the release cut line with its RELEASE CUT label (counts as one), and the single riskiest story card — drawn with accent @ 0.05 fill, accent dashed 4,4 stroke, and a small rectangular RISK tag (rx=2, matching the type-tag primitive) — counts as the other. Nothing else on the map is accent."]},{"h":"Complexity budget","items":["Max 5 activities, max 3 release slices, max 12 story cards total, max 4 cards per slice.","Max 2 accent elements (the release cut counts as one; the riskiest card counts as the other).","Over budget on a single activity or slice → split into one map per activity, or collapse a slice into a count card rather than listing every item."]},{"h":"Anti-patterns","items":["No release cut. A map with no cut line is a backlog in a grid, not a map — the cut is the whole point.","Columns ordered by priority instead of narrative sequence. The backbone is a story, left to right, in the order the user experiences it — not a ranked list.","Story cards that are features, not user-visible outcomes. \"Add a chart\" is a story; \"Refactor the charting service\" is not — it belongs in a backlog ticket, not the map.","Slices named by date instead of by outcome. MVP / RELEASE 2 / LATER describe scope; Q3 / Q4 describe a calendar and drift the moment the schedule slips.","More than 3 slices. Beyond MVP, next, and later, nobody believes the ordering — collapse the tail into \"Later.\"","Mixing two personas in one map. One map per persona, same as user journey.","Adding state columns. That turns it into a kanban board — this type has no state.","Adding a sentiment curve. That turns it into a user journey — this type has no feelings axis."]}]},{"slug":"swimlane","title":"Swimlane","bestFor":"cross-functional processes, RACI-style flows, vendor handoffs, multi-team shipping workflows.","lead":"Not this type: what the customer sees vs what stays hidden, on one shared stage grid → Service blueprint (type-service-blueprint.md). A blueprint has no arrows; stage order is the sequence.","zh":"泳道图","example":"example-swimlane.html","sections":[{"h":"Layout conventions","items":["Horizontal lanes (or vertical columns) — one per actor/team. Label each lane in the left margin (or top) with an eyebrow-role label.","Lane dividers: 1px hairlines.","Process steps are rectangles placed inside the lane of the actor performing them; arrows show flow.","Handoffs (arrows crossing lane boundaries) are the most important edges — consider coral on the handoff that introduces the most coupling or latency.","Don't force equal step count per lane; a lane with one step is fine."]},{"h":"Anti-patterns","items":["Lanes without labels.","A step drawn across two lanes (pick one owner).","Arrows that snake back and forth — reorder steps so the flow is mostly straight."]}]},{"slug":"timeline","title":"Timeline","bestFor":"release history, project milestones, incident timelines, roadmaps, changelog visualizations.","lead":"","zh":"时间轴","example":"example-timeline.html","sections":[{"h":"Layout conventions","items":["Horizontal hairline baseline across the middle (stroke-width=1).","Tick marks at time boundaries (quarters, months, sprints) with date labels below in the arrow-label role.","Events: small filled circles (r=4) on the baseline. Labels alternate above and below to prevent collision, connected to the circle with a 1px hairline drop.","Major milestones: accent circle (r=6) + bold node-name-role label.","Time scale must be honest: if intervals are non-equal, space the circles non-equally. Don't fake linear spacing for aesthetics. Break the axis visibly if a region is too dense."]},{"h":"Anti-patterns","items":["Equal-spacing events that aren't equally spaced in time.","Missing axis labels (\"what unit is this?\").","Crowded labels without vertical offset — illegible."]}]},{"slug":"tree","title":"Tree / Hierarchy","bestFor":"org charts, dependency trees, taxonomy, file trees, decision breakdowns, skill trees. For hierarchical, ID-addressable block decomposition with per-block I/O, constraints, and implementation traceability, load semantic-patterns.md § Traceable block decomposition first — it specializes this layout without changing it.","lead":"","zh":"树状图","example":"example-tree.html","sections":[{"h":"Layout conventions","items":["Root at top, children fan out below (or root at left, children to right).","Nodes are small labeled rectangles (rx=6), node-name role 12px 600 name + optional sublabel role 9px. Width 120–180px, height 40–52px.","Connectors are orthogonal (elbow-style), never diagonal. Parent drops a short vertical line, then a horizontal bus connects siblings, then each child has a short vertical drop into its top edge. 1px muted stroke.","Leaf indicator: thinner stroke (0.8) or different fill — OR let terminal position do the work.","Max depth: 4 (root + 3 tiers). Max breadth per level: 5.","Coral on one node: root OR critical leaf. Not both.","Draw connectors before nodes."]},{"h":"Anti-patterns","items":["Tree 5+ levels deep on a single page (illegible — split).","Nodes of wildly varying widths — pick 2 widths max.","Diagonal connector lines.","Skipped levels (parent connected to grandchild with no middle).","Coral on root AND a leaf."]}]},{"slug":"treemap","title":"Treemap","bestFor":"part-of-whole where the relative sizes are the story — disk and bundle usage, budget or spend breakdowns, market share, population, time allocation. Use when a single total decomposes into parts and the reader's question is \"what dominates, and by how much?\"","lead":"Not for: ranked lists where exact values matter more than proportion (use a bar chart), containment or scope relationships with no quantity (use nested), or a hierarchy you need to trace parent-to-child (use a tree).","zh":"矩形树图","example":"example-treemap.html","sections":[{"h":"Layout conventions","items":["Plot area: x 40 → 956, y 40 → 420 inside a 0 0 1000 500 viewBox — the same vertical rhythm as bar, line and scatter, so the legend block sits where a reader of those types already expects it (rule at y=462, LEGEND at 478, keys at 488).","Squarified layout (Bruls et al., 2000): sort descending, lay each row against the shorter side of the remaining rectangle. Aspect ratios stay near 1, which is what makes two areas comparable by eye. Never lay cells out in simple stripes — long thin cells cannot be compared.","Cell count: 4–8. Past 8, the tail becomes unlabelable slivers — group the tail into a single explicit \"Other\" cell and name what it contains in the source line.","4px grid: cell edges snap to the grid like everything else, with a 4px gutter between cells. Snapping and gutters both move area, so check the result — and check it as relative error ((drawn − true) ÷ true), not percentage points. A 0.1pp slip is nothing on a 59% cell and a quarter of a 0.5% cell; absolute error hides exactly the mistake you need to catch. Keep every cell within a few percent of its true share — the shipped example is within 2.7%, its worst case being the sliver, where the grid cannot do better — and state the encoding in the source line (AREA = POPULATION). scripts/verify-treemap.py gates this.","Fill: a rank-ordered ink opacity ramp (e.g. 0.16 → 0.04), so the non-focal order survives greyscale printing and colour-blind readers. One accent cell only — the editorially focal one, not automatically the largest. Note what this does not buy you: the focal cell is painted off-ramp, so in greyscale it lands wherever its tint happens to fall, not at its rank. Identify it by the accent stroke, and never let tone carry meaning the area doesn't already carry. ink is a role, not a colour: it resolves near-black on light paper and near-white on dark, so one ramp of opacities composites darker as it strengthens in the light skin and lighter in the dark one. The opacities are identical in both; only their lightness flips.","Stroke: 1px ink @ 0.30 hairline on every cell; the focal cell takes a 1.5px accent stroke.","Labels sit inside the cell, top-left, 16px in from the edge: name in the node-name role 12–14px 600, value in the sublabel role 9px on the next line. Three tiers by cell size:","large — name + value + share (4.78B · 59% of world)","medium — name + value","small — a 3-letter mono abbreviation, if one reads honestly","sliver — no text. When the cell is at least 12×12px, use a filled ink disc, r=5, centred in the cell, carrying a paper-coloured i, with the cell's name and share spelled out in the legend. Below 12px on either axis, omit the in-cell mark and identify the sliver by position in the legend; a fixed-size disc must never cross the cell boundary. scripts/verify-treemap.py checks marker containment. Resist rotating a label to make it fit: a single sideways word among five upright ones reads as a mistake before it reads as data, and its centring is a trap — text-anchor=\"middle\" centres along the baseline, which a quarter-turn maps to the cell's long axis, leaving nothing centring the cap-height band across the narrow one.","Never shrink a cell to fit its label. The cell size is the data; the label is commentary.","Contrast: compute the ceiling against the token you actually ship. The 9px value line is muted, not ink, and muted needs a lighter cell than ink does: measured against the composited fill, the top of the ramp can go to 0.16 on light paper and 0.14 on dark before it drops under 4.5:1. (ink would tolerate 0.20 — which is exactly the number you will write down if you check the wrong token.) A mid-tone fill — solid accent, or 50% ink — fails against both light and dark text; use the tint-plus-stroke pattern instead. The source line takes muted too: soft measures 3.48:1 on paper and never reaches AA anywhere on this ramp.","Legend: the house block (rule, LEGEND, keys), naming the focal cell, the direction of the ink ramp, and any cell carrying an info mark. Name that direction by contrast against the paper — stronger contrast is larger — never by lightness. darker is larger is true only on light paper; ship it in the dark variant and the legend states the opposite of what the reader sees, because the ramp's lightness inverts with the skin while its opacity does not. Named by contrast, one sentence serves all three variants and cannot rot apart. scripts/verify-skin-polarity.py gates this, checking every directional tone claim against the ramp composited on that file's own paper. HTML comments are not visible legend copy, including comments between text fragments; contradictory or unverifiable visible wording still fails. Explicit fill-opacity and opacity presentation attributes multiply the fill color's alpha before that comparison; CSS rules and inherited/group opacity are not resolved by this source checker. Ranked cells with zero effective opacity remain in the comparison at paper contrast. The source line rides the same row as LEGEND, right-aligned in mono 8px, stating what area encodes plus the dataset and its date. Archived closing tags inside an inline comment cannot truncate the surrounding visible claim.","Commented-out SVG geometry does not contribute to verified cell area or annotation containment.","Both matching SVG attribute quote delimiters are supported by the geometry verifier.","Parseable numeric label positions and font sizes must be finite, and font sizes must be positive, so invalid annotations cannot bypass containment comparisons. Unsupported SVG length formats retain the existing conservative skip; they are not certified by this source checker."]},{"h":"Honest-data rule","items":["Area is the only encoding. Never clip, floor, or log-scale a cell to make it visible, and never drop a cell because it is small — a treemap claims to show a whole, so an omitted part makes the picture a lie. A part too small to label gets a legend entry and, only when the cell can contain it, an info mark; parts too small to draw get merged into one honest, named \"Other\". If several cells are invisible at the target size, the data wants a bar chart.","Watch the smallest cell hardest: it is the one that grid snapping and gutters distort most, and the one nobody checks. Beware, too, the rounding you display: six values each rounded up can sum past the total you printed underneath them. Either carry enough precision that the parts reconcile, or say plainly in the source line that they don't (PARTS ROUNDED, MAY NOT SUM)."]},{"h":"Anti-patterns","items":["More than 8 cells without an \"Other\" bucket (unlabelable slivers).","A stated total the cells contradict by more than display rounding — or rounding that is never disclosed. Rounded parts that miss the total by a hair are honest once the source line says so; silently printing figures that don't reconcile is not.","Stripe layout instead of squarified — defeats area comparison.","Rainbow fills: one hue per cell destroys the rank reading and the one-accent rule.","Nesting more than two levels deep in a static diagram; a second level needs a heavier border and its own label tier, and a third is unreadable without interaction.","3-D or shadowed cells — area is already the message."]},{"h":"Variants","items":["Marimekko: the same area encoding on a grid — column width is the category's share, segment height is the series' share within it, so area is the joint share. Full spec below."]}]},{"slug":"uml-class","title":"UML Class Diagram","bestFor":"the static structure of an object model — classes, what they own, what they inherit, and what they merely depend on. The distinguishing content is the operations compartment and the typed relationship vocabulary (the arrowheads carry meaning). ER cannot express either — use this type only when operations or the inheritance/composition vocabulary are the point of the diagram, and type-er.md when the story is entities and cardinality.","lead":"Other UML diagrams — route elsewhere. UML is a family; only the class diagram gets its own grammar here:","zh":"UML 类图","example":"example-uml-class.html","sections":[{"h":"Layout conventions","items":["Each class is a single box (rx=6), divided by full-width hairlines into up to three compartments. Compartment heights follow content — never pad to a uniform height.","Name — class name in the node-name role, 12px, weight 600, centered. An interface carries an eyebrow-role 8px «interface» stereotype line above the name. An abstract class sets the name in italic.","Attributes — one line each, sublabel role 9px, left-aligned: + name: Type. Visibility markers: + public, - private, # protected.","Operations — one line each, sublabel role 9px, left-aligned: + method(arg): Return.","Omit a compartment entirely when a class has no members in it (an interface with no attributes skips that compartment).","Attribute/operation lines are a single combined string, not the two-column field/type layout ER uses — that visual distinction keeps the two types from reading the same.","Coral (accent) is reserved for the class being implemented or extended (the focal type) — accent-tint fill, accent stroke. Its inbound inheritance/realization edges count as one additional accent element (treated as a group), for 2 accent elements total per diagram."]},{"h":"Relationship vocabulary","items":["Define every marker used in <defs> and show all six in the legend, even the ones not used in the diagram body — the legend is this type's complete grammar reference.","Relationship · Line · Ending (at the target/owner end)","Inheritance (extends) · solid · large hollow triangle — paper fill, ink stroke","Realization (implements) · dashed 5,4 · same hollow triangle","Composition (owns, cascades) · solid · filled diamond at the OWNER end, ink fill","Aggregation (has, independent) · solid · hollow diamond at the OWNER end","Association · solid · plain open arrowhead, multiplicity at BOTH ends","Dependency (uses) · dashed 4,3 · plain open arrowhead","Multiplicities (1, 0.., 1..) sit in the arrow-label role at 8px, 10–12px off the box edge, on an opaque mask over the line — same convention as ER cardinality labels."]},{"h":"Connector rules","items":["All six SKILL.md §6 connector rules apply in full — orthogonal rounded elbows (r=8), no diagonals, bridge/hop for unavoidable crossings, fanned attach points ≥12px apart when several relationships share an edge, masked labels with the 6–10px gap, connectors drawn before boxes. Prefer laying classes out so relationships resolve to straight lines or single-elbow routes; a class diagram with every edge bridging is over budget — split by package instead."]},{"h":"Complexity budget","items":["Max 7 classes, max 8 relationships, max 5 members per compartment (overflow becomes a sublabel-role … line), max 2 accent elements. Over budget → split by package.","Seven is the ceiling rather than the target. Three compartments per box makes a class diagram dense fast, so treat 4–5 classes as the normal size; the shipped example uses all seven only because it doubles as the legend for the full relationship vocabulary."]},{"h":"Anti-patterns","items":["Getters and setters listed as operations — they're noise; show behavior that matters.","Every attribute and method dumped in — a class diagram is an argument, not a header file.","Composition and aggregation used interchangeably — the filled diamond means the part dies with the whole. Say so, or use the hollow diamond.","Association arrows with no multiplicity.","Drawing a class diagram when there's no inheritance and no operations — that's ER.","Stereotype guillemets on everything, not just the interfaces/abstracts that need them.","Boxes padded to equal height."]}]},{"slug":"unit-grid","title":"Unit Grid","bestFor":"one bounded whole expressed as equal, discrete units: completion, capacity, survey responses, inventory, or a checklist. Use the canonical waffle form when the reader needs to see an exact count out of 100.","lead":"Not for: category-by-category comparison (use a bar chart), a part-of-whole with unequal pieces (use a treemap), continuous change (use a line chart), or a matrix where row and column positions carry meaning (the future punch-card variant).","zh":"单元网格","example":"example-unit-grid.html","sections":[{"h":"Input contract","items":["Validation rules:","Version 1 is a 10 by 10 grid with exactly 100 cells.","total is exactly 100; filled is an integer from 0 through 100.","Every cell represents one unit. Do not use fractional cells, scaled cells, or merged cells.","At most one completed cell is focal. Accent is editorial emphasis, never a larger unit.","Cells fill in reading order, left to right and top to bottom. A different order needs an explicit future variant.","Rows and columns carry no category meaning in the canonical waffle form."]},{"h":"Layout conventions","items":["Use a 10 by 10 grid of equal 20px cells with a 4px gutter. The shipped examples begin at (382, 86), making the grid 236px square inside a 1000 × 390 viewBox.","Every chart root carries data-unit-grid=\"true\", data-unit-total=\"100\", data-unit-filled, data-unit-rows=\"10\", and data-unit-columns=\"10\".","Every cell is a <rect> with data-unit-cell=\"filled\" or data-unit-cell=\"empty\" and a unique data-unit-index from 0 through 99. scripts/verify-unit-grid.py checks count, geometry, indices, the declared filled value, and printed labels.","Use one ink fill for completed cells, a quieter paper-relative fill for remaining cells, and no more than one accent completed cell. The count, not color, carries the value. Set each cell's literal fill on the <rect> (or a parent <g>): completed cells must match the page's :root --ink or --accent, and remaining cells share one other fill well away from both. Cells sit directly in the chart <svg> or in plain <g>/<a> groups with no style, transform or conditional attributes; cell strokes stay at or under 2px and corner radii at or under a quarter of the cell. The verifier rejects opacity, visibility, display, filter, mask, clip-path, paint-order and mix-blend-mode on cells or their ancestors, paint, stroke or hiding rules in <style> (after decoding escapes), @import, any linked stylesheet but Google Fonts, SMIL animation, and any element drawn after the first cell whose box touches the grid or cannot be computed from plain numeric attributes. It does not see HTML wrappers around the SVG or scripts.","Mark the percentage text with data-unit-percent=\"true\" and the count text with data-unit-count=\"true\". They must read 64% and 64 complete · 36 remaining for filled: 64; both are checked against data-unit-filled. Each label is plain visible <text> inside the chart SVG (no child elements, no hiding or style attributes), painted --ink or --muted, at least 8px, and inside the viewBox.","Do not apply transforms to cells or their SVG/group ancestors, or move geometry through CSS. Bake movement into the coordinates so the verifier checks the rendered positions.","Put the exact count in text near the grid and state the unit in the source line. The grid must remain understandable in grayscale.","Keep the legend block below the grid. Label the focal cell as editorial emphasis, so it cannot be mistaken for a special unit."]},{"h":"Honest-data rule","items":["A unit grid claims that one mark equals one unit. Never round a 63.4% result to 64 filled cells without saying that the display is rounded. Never use a partial fill, larger focal cell, gradient, or area-sized mark to recover precision. If the denominator is not naturally bounded to 100, choose a number of whole cells that makes the unit honest or choose a different chart."]},{"h":"Complexity budget","items":["Exactly 100 cells in a 10 by 10 grid.","One count and one optional focal completed cell.","One legend and one source note.","Static output only.","No categorical row or column axes in version 1."]},{"h":"Anti-patterns","items":["Partial, merged, oversized, or differently shaped cells.","Rainbow status fills or multiple accent cells.","Using the grid for a denominator other than 100 without an explicit future variant.","Treating rows and columns as categories. That is the later punch-card variant, not this canonical waffle form.","Gradients, heatmap ramps, 3-D treatments, or shadows.","Filling in a non-reading order without explaining that order."]}]},{"slug":"venn","title":"Venn / Set Overlap","bestFor":"intersection of concepts/domains, shared attributes between categories, \"where A meets B\", ikigai-style frames (desirable × feasible × viable).","lead":"","zh":"韦恩图","example":"example-venn.html","sections":[{"h":"Layout conventions","items":["Prefer 2 or 3 circles. Avoid 4+ (unreadable — use a matrix instead).","Circle stroke: 1px hairline, color per-set (ink, muted, soft).","Circle fill: very low-opacity tint — ink @ 0.04 for the ink set, muted @ 0.05 for the muted one. Tints compound naturally in overlap regions.","Radii: equal when sets are comparable in size; proportional when sets are meaningfully different. Don't fake equal sizes for aesthetics.","Set labels placed outside the circle, NEVER crossing the stroke. node-name role 12–14px 600 for the set name, optional sublabel role 9px.","Intersection labels placed inside the overlap region, node-name role 12px 600, centered. For small overlaps, use a leader line to a label in clear space.","Coral accent on the ONE focal intersection — the \"sweet spot\". Either an accent label stroke OR a clipPath-bounded accent @ 0.10 fill tint.","Circle centers and radii divisible by 4."]},{"h":"Anti-patterns","items":["Unlabeled regions — reader can't tell which set is which.","Circles that don't overlap when overlap is the point.","Equal-sized circles when sets are obviously different (dishonest).","Coral on multiple overlap regions (focal signal dies).","Labels sitting on top of circle strokes (illegible).","4+ circles where 2–3 would do."]}]},{"slug":"wardley","title":"Wardley Map","bestFor":"positioning the components of a value chain against how evolved (commoditised) each one is, so a reader can see what to build, what to buy, and what is about to move. A strategy artefact, not an architecture diagram — it says nothing about how components connect at runtime, only where each one sits on the genesis-to-commodity curve.","lead":"","zh":"沃德利地图","example":"example-wardley.html","sections":[{"h":"Layout conventions","items":["Y axis — value chain. Visible to the user at the top, down to Invisible at the bottom. Label the axis as stacked separate <text> lines flanking the axis endpoints — never writing-mode to rotate a label vertically. Axis line rule-solid at 0.20 opacity.","X axis — evolution. Four bands separated by three vertical hairlines: Genesis | Custom-built | Product | Commodity. Band separators are rule at 0.10 opacity, dashed 4,4. Band labels sit along the bottom axis: eyebrow role 8px, uppercase, tracked, muted. Axis line rule-solid at 0.20 opacity.","Components are a small circle r=6, filled paper with an ink 1px stroke. Label in the node-name role, 12px, weight 600, placed 12px above the dot, text-anchor=\"middle\". An optional sublabel-role 9px muted sublabel can sit under the dot for a technical qualifier — use sparingly.","Dependency links are thin muted 0.8px straight lines from a component down to the component it depends on. These are the one documented exemption from §6 rule 1 (mandatory orthogonal elbows) — dependency links only. A component's y/x position on this map is the data; forcing it onto an axis to make an elbow route work would misplace it. No arrowhead — the line itself states the dependency.","Movement — a component that is evolving carries a short right-pointing arrow: accent, dashed 5,4, marker-end=\"url(#arrow-accent)\", running from the dot's edge toward the next band. The arrow needs no on-arrow text label: the legend's \"Evolving\" swatch (accent dot + dashed accent arrow) already names what accent + dashes mean, and since arrows on this map can only ever point right (see Anti-patterns — a left-pointing movement arrow is a contradiction, not a design choice), the direction itself already says \"toward commodity.\" A bare word like COMMODITISING restates what shape and color already signal — apply §1's remove test: can I remove this label, does color or shape already carry it? Here it does, so the label is the thing that goes, not its position.","An on-arrow label is legitimate only when it qualifies something the arrow can't express on its own — a timeframe (BY Q3), a driver (VENDOR LOCK-IN) — never a restatement of direction. If you add one, mask it, arrow-label role 8px, 6–10px clear of the stroke, same masking rule as any arrow label (§6 rule 2), and confirm there's runway for the mask first: the space directly around a component's dot is usually the most congested spot on the map, because that's also where its own dependency links fan out. Worked example — the moving component in example-wardley.html sits at (420,156) with links fanning to (620,220) and (680,252); at the mandatory 6–10px gap band below the arrow (y=164–176), those two lines cross at x=441.7–482.5 and x=445–482.5 respectively — almost the full width of the arrow's own span (x=428–504), leaving no clear pocket wide enough for a label. Above the dot is no better: the component's own name label already occupies that band per the 12px-above-dot convention. Check both bands for interference before adding a movement label; if neither is clear, don't add one — the legend already covers it.","Focal rule: the 2 accent elements on this type are the moving component's dot (accent-tint fill, accent stroke) and its movement arrow — or two moving components sharing those 2 accent slots with no other accent anywhere else on the map.","Legend: horizontal strip at the bottom, hairline separator above it, viewBox extended ~60px — same as every other type."]},{"h":"Complexity budget","items":["Limit · Rule","Max components · 9","Max dependency links · 12","Max movement arrows · 2","Max accent elements · 2"]},{"h":"Anti-patterns","items":["Treating the x axis as a maturity score. Evolution is four qualitative bands (genesis / custom-built / product / commodity), not a 0–10 slider. Don't plot a component at \"6.5\" — place it in a band.","A component with no dependency link. If nothing in the value chain depends on it and it depends on nothing, it isn't part of the chain — delete it or wire it in.","Arrows drawn right-to-left. Evolution only moves toward commodity. A left-pointing movement arrow is a contradiction, not a design choice.","Using the map as an architecture diagram. No request/response direction, no protocols, no runtime topology — that's the architecture type. This type answers \"what's worth building vs. buying,\" not \"how does traffic flow.\"","Numbering the y axis. Value-chain visibility is ordinal (more visible to the user, less visible), not a quantity. Numeric ticks imply a measurement that doesn't exist.","More than 2 movement arrows. Beyond that the map stops making a single point and turns into a forecast nobody can act on.","writing-mode vertical axis text. Stack the words as separate horizontal <text> lines instead — see Layout conventions above."]}]},{"slug":"waterfall","title":"Waterfall Chart","bestFor":"showing how a start total becomes an end total through signed contributions — a budget bridge (FY25 baseline → FY26 plan), headcount deltas (starting roster ± hires ± attrition), conversion leak/gain, P&L walk. Use when the running total is the story: every bar either anchors the total or bridges one running level to the next, and the reader traces the path from start to end.","lead":"Not this type: ","zh":"瀑布图","example":"example-waterfall.html","sections":[{"h":"Layout conventions","items":["Orientation: vertical columns only, left → right in narrative order: start total, then each signed bridge, optional subtotal, end total. A horizontal waterfall reads as a Gantt.","Plot area: left 80px (y-axis labels), bottom 60px (category labels), top 40px, right 40px — inside a 0 0 1000 500 viewBox, same frame as the bar chart. Plot band x 80→960, y 40→420.","Bar count: 3–8 bars total, including both totals and at most one subtotal. More contributions than that → merge the tail into one named \"Other\" bridge (disclose what it contains) or split the walk into two charts.","Bar width / pitch: equal-width bars on an even pitch, bar ≥ 50% of the pitch. Six bars fit as width=96 on a 144px pitch starting at x=112.","Totals anchor, bridges float. The start total, any subtotal, and the end total are drawn from the domain floor (the x-axis baseline) up to their value. Bridge bars span exactly the running total before and after their contribution — an increase rises from the previous level, a decrease falls from it.","Carry rules (the bridge grammar). A horizontal connector line carries the running total across each gap between adjacent bars, drawn at the shared level: from the right edge of one bar to the left edge of the next, ink @ 0.55 at 1px on light paper (ink @ 0.40 on dark) — the dumbbell's connector weight, because the carry is load-bearing and must clear 3:1, not the 0.25 axis hairline. Each carry declares the running total it transports in data-carry.","Machine-readable data contract. Every bar rect declares data-role (total, delta, or subtotal), data-value (totals unsigned, deltas explicitly signed +/-), and data-name. scripts/verify-waterfall.py reads these and fails the build when the drawing and the declaration disagree — see the honesty rules below.","Sign is encoded by fill weight, not hue. Increases take the bar family's default tint (muted @ 0.15 fill, muted stroke). Decreases are hollow — paper fill, same muted stroke — so the two directions survive greyscale and colour-vision deficiency without leaning on the accent. The geometry (which end of the bar meets the carry) and the signed printed value are the second and third encodings of the same fact.","Totals are the heaviest marks: ink @ 0.08 fill with a 1px ink stroke. The reader's eye should land on the two anchors first, then walk the bridges.","Focal bridge (≤1, optional): the one contribution the chart exists to show gets the bar family's focal treatment — accent @ 0.12 fill, accent stroke, accent value label. It replaces that bar's sign fill; the signed label and geometry still carry the direction.","Value labels: arrow-label role 8px. Totals and increases print above the bar top (baseline top − 8); decreases print below the bar bottom (baseline bottom + 12), because the space above a decrease is where its carry arrives. Deltas print with an explicit sign (+64, −38); totals print unsigned.","Gridlines / axes: identical to the bar chart — 4–6 faint horizontal gridlines ink @ 0.08 0.8px, y-axis line and x-axis baseline ink @ 0.25 1px, tick labels arrow-label role 8px muted right-aligned at x=72, rotated y-axis title eyebrow role 7px tracked.","Category labels: centered under each bar at y=440, node-name role 11px 600 ink; the focal bar's label may take accent.","Legend: horizontal bottom strip after a hairline rule, one key per treatment used: total, increase, decrease, focal."]},{"h":"Anti-patterns","items":["A floating bar with no carry. The connector is the claim that the total is conserved across the gap; without it the chart is bars at odd heights.","Sign by hue alone (green up / red down, or accent on every decrease). Hue is the one channel that does not survive greyscale or CVD; fill weight and geometry carry the sign here, and the accent stays editorial.","A truncated value axis. The domain follows the data's range, never its observed extremes — the same rule, cases, and all-zero fallback as the dumbbell (type-bar.md § Dumbbell honesty rules). A waterfall on a clipped domain inflates every bridge.","More than one subtotal. A walk that needs several resting points is two walks; split it.","Mixing units mid-walk. Every bar is in the start total's unit or the reconciliation is fiction.","3-D, shadows, rounded bridge bars — same editorial rules as every chart here."]},{"h":"Waterfall honesty rules","items":["Decimal declarations conserve exactly. Fractional budgets use exact decimal arithmetic for totals, carries, and printed-value identity; geometry retains its pixel-rounding allowance. A binary floating point accumulation error must not reject a reconciled dollar-and-cent walk, and an actual decimal discrepancy is still a failure.","The running total must conserve. Start + every signed bridge = each subtotal and the end total, exactly — the declared data-values must reconcile before geometry is even considered. A waterfall that doesn't add up is not approximately right, it is wrong.","Bridges span exactly their two running levels. Each bar's drawn top and bottom must sit where the shared scale puts the running totals before and after it (±0.75px for integer rounding). Stretching one bridge \"for legibility\" moves money that doesn't exist.","Every carry sits at the level it transports, spanning its full gap, and declares that value. A carry drawn at the wrong height reconnects the walk to a different total.","Every bar prints its value, deltas with an explicit sign. An unsigned bridge asks the reader to infer direction from geometry alone; print +/−.","Zero bridges are dropped, never drawn. A zero-height bar is invisible ink that still occupies a column; state it in prose or the source line instead.","A degenerate start (zero or negative total) is a named failure, not a silently rescaled chart — the scale is derived from the start anchor.","These rules are executable: scripts/verify-waterfall.py reads each bar's declaration, recomputes the running totals, refits the shared scale from the start anchor, and fails on any conservation, geometry, carry, label, or sign-treatment drift. scripts/test-verify-waterfall.py proves both polarities — the shipped examples pass, and each mutation class above fails with a named finding."]}]}];
|
|
7
12
|
/* PREVIEWS:BEGIN - generated by scripts/embed-previews.mjs, do not edit */
|
|
8
13
|
var PREVIEWS = {
|
|
@@ -153,7 +158,9 @@ window.__ModuleLoader__.load({
|
|
|
153
158
|
var size = (props && props.size) || 18;
|
|
154
159
|
return h('svg', {
|
|
155
160
|
width: size, height: size, viewBox: '0 0 20 20', fill: 'none',
|
|
156
|
-
stroke: 'currentColor', strokeWidth: 1.3, strokeLinecap: 'round', strokeLinejoin: 'round'
|
|
161
|
+
stroke: 'currentColor', strokeWidth: 1.3, strokeLinecap: 'round', strokeLinejoin: 'round',
|
|
162
|
+
'data-dsh-diagram-entry': 'dsh-diagram-leapavid',
|
|
163
|
+
onClick: function () { requestListView(); }
|
|
157
164
|
},
|
|
158
165
|
h('rect', { x: 2.2, y: 3.2, width: 6.2, height: 4.6, rx: 1.2 }),
|
|
159
166
|
h('rect', { x: 11.6, y: 3.2, width: 6.2, height: 4.6, rx: 1.2 }),
|
|
@@ -308,6 +315,11 @@ window.__ModuleLoader__.load({
|
|
|
308
315
|
if (!submitter.current) submitter.current = new Submit(ctx);
|
|
309
316
|
var pageRef = React.useRef(null);
|
|
310
317
|
var fs = React.useState(false), flush = fs[0], setFlush = fs[1];
|
|
318
|
+
React.useEffect(function () {
|
|
319
|
+
var reset = function () { setSlug(null); };
|
|
320
|
+
viewReset = reset;
|
|
321
|
+
return function () { if (viewReset === reset) viewReset = null; };
|
|
322
|
+
}, []);
|
|
311
323
|
React.useEffect(function () {
|
|
312
324
|
var el = pageRef.current;
|
|
313
325
|
if (!el) return;
|
|
@@ -354,6 +366,17 @@ window.__ModuleLoader__.load({
|
|
|
354
366
|
return {
|
|
355
367
|
inject: ['slots', 'layout', 'uiWorkspace', 'sessions'],
|
|
356
368
|
apply: function (ctx) {
|
|
369
|
+
try {
|
|
370
|
+
var onEntryClick = function (event) {
|
|
371
|
+
var target = event.target;
|
|
372
|
+
var row = target && target.closest ? target.closest('button') : null;
|
|
373
|
+
if (row && row.querySelector('[data-dsh-diagram-entry="dsh-diagram-leapavid"]')) requestListView();
|
|
374
|
+
};
|
|
375
|
+
document.addEventListener('click', onEntryClick, true);
|
|
376
|
+
ctx.effect(function () {
|
|
377
|
+
return function () { document.removeEventListener('click', onEntryClick, true); };
|
|
378
|
+
}, 'diagram entry click');
|
|
379
|
+
} catch (e) { /* host effect is optional */ }
|
|
357
380
|
ctx.slots.inject('main', function* () {
|
|
358
381
|
yield ctx.slots.register({ name: 'main', key: 'dsh-diagram-leapavid' }, function StudioPanel() {
|
|
359
382
|
return h(Studio, { ctx: ctx });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-diagram-leapavid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Diagram LeapAvid — browse 50 editorial diagram templates and prepare a prompt that opens a new DSH conversation to generate a single-file HTML diagram.",
|
|
6
6
|
"author": "LeapAvid",
|