A WireViz file has three sections: connectors, cables, and connections. Edit the YAML on the left and the diagram plus bill of materials refresh after 600 ms. The snippets below show one section at a time. Full syntax reference: wireviz/docs/syntax.md.
Connectors
Each connector needs pins. Give pincount, or a list of pinlabels (pin count is inferred). type and subtype are free text shown in the header.
connectors:
X1:
type: D-Sub
subtype: male
pinlabels: [VCC, GND, TX, RX]
Cables & wires
Set wirecount with a color_code (DIN, IEC, TEL, T568A/B…), or list colors directly. gauge accepts mm2 or AWG; show_equiv: true prints the conversion.
cables:
W1:
wirecount: 4
gauge: 0.25 mm2
show_equiv: true
color_code: DIN
length: 0.5
Connections
A connection set alternates connector → cable → connector. Items line up in parallel; 1-4 expands to a range. Reference pins by number or label, wires by number.
connections:
- - X1: [1-4]
- W1: [1-4]
- X2: [1-4]
Colours
Two-letter IEC codes: BK RD OG YE GN BU VT GY WH BN (plus PK, TQ, SL, CU…). Concatenate for stripes, e.g. WHBU. Use color_mode in options to switch labels to full names or hex.
cables:
W1:
colors: [RD, BK, WHBU, GNYE]
Shields & bundles
shield: true adds a shield you connect using wire id s. category: bundle renders a dashed outline and generates one BOM line per wire instead of one for the cable.
cables:
W1:
wirecount: 3
color_code: DIN
shield: true
B1:
category: bundle
colors: [RD, BK, YE]
Part numbers & BOM
Any connector or cable can carry pn, manufacturer, mpn, supplier, and spn. Those columns appear in the BOM only when used. Quote numeric part numbers to keep leading zeros.
connectors:
X1:
type: Molex KK 254
pincount: 4
manufacturer: Molex
mpn: "22013047"
supplier: Digikey
spn: "455-1119-ND"
Additional components
Attach extra BOM items (crimps, screws, labels) to a part. qty_multiplier scales quantity: pincount/populated for connectors, wirecount/length/terminations for cables.
connectors:
X1:
pincount: 4
additional_components:
- type: Crimp
qty_multiplier: populated
manufacturer: Molex
mpn: "0008500030"
Images
Point src at a URL or a data: URI (browser file paths won't resolve). Optional width/height in px, plus a caption. Cross-origin images display but may not embed in a downloaded SVG.
connectors:
X1:
pincount: 2
image:
src: https://upload.wikimedia.org/wikipedia/commons/3/30/RCA_Connector.jpg
width: 200
caption: Front view
Mates & arrows
Join connectors with arrows instead of a cable. Single arrows (--, -->) mate pin-to-pin; double arrows (==, ==>) mate whole connectors.
connections:
- - X1: [1-2]
- [--, --]
- X2: [1-2]
- - X1
- ==>
- X2
Loops
Short two pins on the same connector. Each loop is a pair of pin ids.
connectors:
X1:
pincount: 4
loops: [[1, 4]]
Harness part number & description
Give the whole loom a part number and description via metadata. Loomvizr draws them as a title block on the diagram; the Part no. / Description boxes at the top edit these same fields. It stays WireViz-compatible: standard WireViz reads metadata for its HTML output.
metadata:
pn: HRN-0042-A
description: RS-232 to Molex adapter loom, rev A
title: Optional heading above the part number
Options & metadata
Global settings and document info. color_mode: SHORT, FULL, hex, ger (upper/lowercase toggles case). Background colours accept the same colour codes.
options:
color_mode: FULL
bgcolor: WH
metadata:
title: My harness
description: Cable assembly rev A