Schematex

Single-line diagram (SLD)

About single-line diagrams

A single-line diagram (also called a one-line diagram) represents the electrical power system of a facility or substation using a single line to stand in for all three phases of a three-phase AC system. Equipment — transformers, circuit breakers, buses, motors, loads — is shown with standardized symbols, and the power flow path connects them top-to-bottom from source to load. Electrical engineers, utility planners, and facility managers use SLDs as the primary reference document for every power system project: it is the first deliverable in any interconnection application, arc-flash study, or commissioning package.

Schematex follows IEEE Std 315 (ANSI Y32.2) graphic symbol conventions for equipment, extended with IEC 60617 winding-configuration notation for transformer variants. This page documents what the parser accepts today.

SLD·§ IEEE 315-1975
↘ preview
100%
13.8 kV Substation Single-line diagram with 10 nodes and 9 connections 13.8 kV Substation 138kV 138kV/13.8kV 13.8kV Grid 138 kV 138kV · HV Bus Δ Y Main Xfmr 15 MVA 138kV/13.8kV 13.8kV · MV Bus BKR-1 1200A BKR-2 1200A BKR-3 1200A Feeder 1 Feeder 2 Feeder 3
UTF-8 · LF · 20 lines · 646 chars✓ parsed·5.9 ms·7.3 KB SVG

1. Your first single-line diagram

The simplest SLD: a utility source, a transformer, a breaker, and a load.

SLD·§ IEEE 315-1975
↘ preview
100%
Simple feeder Single-line diagram with 5 nodes and 4 connections Simple feeder 13.8kV/480V 480V Utility 13.8kV xfmr 500 kVA 13.8kV/480V 480V · 480V Bus cb1 200A Panel LP-1
UTF-8 · LF · 10 lines · 288 chars✓ parsed·0.7 ms·5.1 KB SVG

Four rules cover 80% of usage:

  1. Start with sld, optionally followed by a quoted title.
  2. Declare each equipment item as id = nodeType [attributes] — one per line.
  3. Connect items with from -> to, optionally adding [cable: "…", label: "…"].
  4. IDs may contain letters, digits, underscores, and hyphens — but must start with a letter.

Comments may start with #, //, or Mermaid-style %% on their own line.


2. Node types

A node line is id = nodeType [attr: value, …]. The node type determines the symbol drawn.

2.1 Sources

TypeSymbolTypical use
utilityUtility source arrowInfinite bus / grid connection
generatorCircle with GDiesel, gas, or hydro genset
solarPV panel symbolPhotovoltaic array
windTurbine symbolWind turbine
upsBlock with batteryUninterruptible power supply
SLD·§ IEEE 315-1975
↘ preview
100%
Generation sources Single-line diagram with 5 nodes and 4 connections Generation sources Grid 115 kV G Diesel Gen 2 MW PV Array 500 kW Wind Turbine 1 MW UPS UPS System 100 kVA
UTF-8 · LF · 10 lines · 316 chars✓ parsed·0.7 ms·5.1 KB SVG

2.2 Transformers

TypeWinding configurationNotes
transformerGeneric two-windingNo winding spec
transformer_dyDelta → Wye grounded (Δ-Yg)Most common distribution
transformer_ydWye grounded → Delta (Yg-Δ)
transformer_yyWye-Wye (both grounded)
transformer_ddDelta-Delta
autotransformerSingle-winding with tapZigzag coil symbol
transformer_3windingThree-windingHV / MV / LV taps
SLD·§ IEEE 315-1975
↘ preview
100%
Transformer configurations Single-line diagram with 5 nodes and 4 connections Transformer configurations 138kV/13.8kV 138kV Grid Δ Y Δ-Yg (most common) 30 MVA 138kV/13.8kV Y Y Yg-Yg 10 MVA 138kV/13.8kV Autotransformer 50 MVA 138kV/69kV 3-Winding 40 MVA 138/13.8/4.16kV
UTF-8 · LF · 10 lines · 483 chars✓ parsed·0.7 ms·6.6 KB SVG

2.3 Buses and nodes

TypeSymbolTypical use
busThick horizontal lineMain voltage bus bar
bus_tieBus-tie breakerLinks two parallel buses at the same voltage
hubWide rectangleMulti-feeder combining point

2.4 Switching and protection

TypeSymbolDevice number
breakerDiagonal + arc52 (AC circuit breaker)
breaker_vacuumDiagonal + V-oval52 vacuum type
switchDiagonal (no arc)89 (disconnect / isolator)
switch_loadLoad interrupter switch
ground_switchDiagonal + ground symbolGrounding disconnect
atsTransfer switch symbolAutomatic transfer switch
recloserDiagonal + arc + arrowAuto-reclosing breaker
sectionalizerDiagonal + SDistribution sectionalizer
fuseOval with diagonalExpulsion fuse cutout
fuse_clRectangle with diagonalCurrent-limiting fuse
SLD·§ IEEE 315-1975
↘ preview
100%
Switching and protection Single-line diagram with 6 nodes and 5 connections Switching and protection Source Recloser S Sectionalizer Fuse Disconnect Ground SW
UTF-8 · LF · 12 lines · 317 chars✓ parsed·0.5 ms·5.5 KB SVG

2.5 Protection and monitoring

TypeSymbolTypical use
ctSmall circle with line throughCurrent transformer
ptSmall circlePotential / voltage transformer
relaySmall circle with device numberProtection relay (ANSI number via device:)
surge_arresterArrow + groundLightning arrester
ground_faultGFI symbolGround-fault detector

2.6 Loads and equipment

TypeSymbolTypical use
motorCircle with MThree-phase motor
loadRectangleGeneric load or feeder
capacitor_bankTwo plates + switchPower factor correction
harmonic_filterLC symbolPassive harmonic filter
vfdRectangle with VFDVariable-frequency drive

2.7 Metering

TypeSymbolTypical use
watthour_meterCircle with WhEnergy meter
demand_meterCircle with DDemand meter
SLD·§ IEEE 315-1975
↘ preview
100%
Equipment types Single-line diagram with 10 nodes and 9 connections Equipment types 13.8kV/480V 480V Grid 13.8kV G Emergency Gen 500kW Δ Y Main TX 1000 kVA 13.8kV/480V ATS ATS-1 800A Main Breaker 2000A 480V · 480V MV Bus CT CT-1 PF Cap 150 kVAR M Pump Motor 100HP 51 Overcurrent Relay
UTF-8 · LF · 20 lines · 631 chars✓ parsed·0.8 ms·8.5 KB SVG

3. Node attributes

Attributes are written inside […] after the node type, comma-separated.

AttributeValuesEffect
label: "…"quoted stringDisplay name on the diagram
voltage: "…"quoted string, e.g. "13.8kV", "480V"Voltage level annotation
rating: "…"quoted string, e.g. "1000 kVA", "200A"Equipment rating annotation
device: "…"ANSI device number, e.g. "51", "87"Used with relay nodes
any other keyquoted stringStored as nameplate data (transformer kVA, %Z, etc.)

Example with all common attributes:

xfmr = transformer_dy [
  label: "Main Transformer",
  voltage: "13.8kV/480V",
  rating: "1000 kVA",
  impedance: "5.75%Z"
]

The attribute block may span multiple lines — the parser joins lines until the ] is balanced.


4. Connections

A connection line is fromId -> toId, optionally followed by [cable: "…", label: "…"].

bus1 -> cb1
bus1 -> cb1 [cable: "3#2/0 AWG"]
bus1 -> cb1 [cable: "3#2/0 AWG", label: "Feeder A"]

Rules:

  • Both IDs must be declared before or after the connection — all connections are validated at end of parse.
  • Only -> (directed, source-to-load) is accepted. The connection direction is used for layout.
  • An unknown node ID throws SLDParseError: Connection references unknown node "…".
SLD·§ IEEE 315-1975
↘ preview
100%
ATS backup with cable labels Single-line diagram with 8 nodes and 7 connections ATS backup with cable labels 480V Normal source Emergency source 3#2/0 AWG 3#4 AWG 3#4 AWG Utility 480V G Emergency Gen 500 kW ATS ATS-1 800A 480V · Critical Bus CB-1 200A CB-2 200A Server Room Life Safety
UTF-8 · LF · 16 lines · 580 chars✓ parsed·0.6 ms·6.7 KB SVG

5. Labels & comments

  • Title: sld "Substation One-Line" — first line only.
  • Node label: id = type [label: "…"] — the display name.
  • Connection label: A -> B [label: "…"] — appears alongside the connecting line.
  • Cable annotation: A -> B [cable: "3#2/0 AWG, 200ft"] — conductor specification.
  • Comments: # at the start of a line. Inline # on the same line as a node or connection is also stripped.
  • Residential aliases: IEC / REBT vocabulary such as mcb, rcd, rcbo, rccb, pia, iga, main_switch, consumer_unit, distribution_board, panel, and panelboard is accepted as input and mapped to existing SLD primitives.

6. Reserved words & escaping

Reserved at line start: sld (header).

Operator token — avoid -> inside node IDs. IDs may contain [A-Za-z][A-Za-z0-9_-]* — hyphens are valid (e.g. CB-101 is a legal ID).

Attribute block[…] brackets may span multiple physical lines. The parser joins continuation lines until the bracket depth reaches zero.

Duplicate IDs throw SLDParseError: Duplicate node id "…".


7. Common mistakes

You wroteParser saysFix
xfmr1 [type: transformer]SLDParseError: Cannot parse lineUse = assignment: xfmr1 = transformer [...]
id = battery [...]SLDParseError: Unknown node type "battery"No battery type — use ups or generator
id = breakerzSLDParseError: Unknown node type ... (did you mean 'breaker'?)Use the suggested canonical type or alias
A -- B (bidirectional)SLDParseError: Cannot parse lineOnly -> is accepted; use two -> lines if needed
A -> B -> C (chained)SLDParseError: Cannot parse lineEach connection is one -> per line
relay [label: "OC"] (no device number)Relay renders with blank numberAdd device: "51" for the ANSI device number
voltage: 480V (unquoted)Attribute value not recognizedQuote all values: voltage: "480V"
Node ID starting with digit: 2BUSSLDParseError: Cannot parse lineIDs must start with a letter: BUS2
Connection before node declaredSLDParseError: Connection references unknown node "…"Declare nodes before or after connections — validated at end of parse, so order is flexible

8. Grammar (EBNF)

document      = header NEWLINE ( blank | comment | node-def | connection )*

header        = "sld" ( WS quoted-string )? NEWLINE
quoted-string = '"' any-char-but-quote* '"'

node-def      = id WS "=" WS node-type ( WS "[" attr-list "]" )? NEWLINE
node-type     = "utility" | "generator" | "solar" | "wind" | "ups"
              | "transformer" | "transformer_dy" | "transformer_yd"
              | "transformer_yy" | "transformer_dd"
              | "autotransformer" | "transformer_3winding"
              | "bus" | "bus_tie" | "hub"
              | "breaker" | "breaker_vacuum" | "switch" | "switch_load"
              | "ground_switch" | "ats" | "recloser" | "sectionalizer"
              | "fuse" | "fuse_cl"
              | "ct" | "pt" | "relay" | "surge_arrester" | "ground_fault"
              | "motor" | "load" | "capacitor_bank" | "harmonic_filter" | "vfd"
              | "watthour_meter" | "demand_meter"
              | residential-alias

residential-alias
              = "mcb" | "mccb" | "rcd" | "rcbo" | "rccb"
              | "differential" | "diferencial" | "pia" | "iga"
              | "main_switch" | "isolator" | "disconnector"
              | "consumer_unit" | "distribution_board" | "panel" | "panelboard"

attr-list     = attr ( "," attr )*
attr          = key ":" WS quoted-string

connection    = id WS "->" WS id ( WS "[" conn-attrs "]" )? NEWLINE
conn-attrs    = conn-attr ( "," conn-attr )*
conn-attr     = "cable" ":" WS quoted-string
              | "label" ":" WS quoted-string

id            = [A-Za-z] [A-Za-z0-9_-]*
key           = [A-Za-z] [A-Za-z0-9_]*
comment       = ( "#" | "//" | "%%" ) any NEWLINE

The attribute block […] may span multiple physical lines — the parser joins continuation lines until the bracket depth returns to zero.

Authoritative source: src/diagrams/sld/parser.ts. If this diverges from the parser, the parser wins — please open an issue.


9. Standard compliance

Schematex SLDs follow IEEE Std 315 (ANSI Y32.2) graphic symbol conventions for switching equipment, transformers, and sources. Transformer winding configuration variants (transformer_dy, transformer_yy, etc.) use IEC 60617 Δ/Y notation. Protection relay device numbers follow ANSI/IEEE C37.2.

What is implemented today:

  • ✅ All source types: utility, generator, solar, wind, UPS
  • ✅ Six transformer variants plus autotransformer and three-winding
  • ✅ Bus, bus-tie, hub
  • ✅ IEC / REBT residential vocabulary aliases mapped onto canonical primitives
  • ✅ Full switching set: breaker, vacuum breaker, switch, load switch, ground switch, ATS, recloser, sectionalizer, fuse, current-limiting fuse
  • ✅ Protection and monitoring: CT, PT, relay (with ANSI device number), surge arrester, ground-fault detector
  • ✅ Load equipment: motor, load, capacitor bank, harmonic filter, VFD
  • ✅ Metering: watt-hour meter, demand meter
  • ✅ Directed connections with cable and label annotations
  • label, voltage, rating, device node attributes; arbitrary nameplate data
  • ⏳ Bus-tie switching with open/closed state indicator
  • ⏳ Protection zones (dashed boundary lines enclosing relay + CT)
  • ⏳ Arc-flash label blocks (incident energy, PPE level, working distance)
  • ⏳ Voltage-level banding (automatic color-coded horizontal bands by kV level)

References:

  • IEEE Std 315-1975 / ANSI Y32.2-1975 — Graphic Symbols for Electrical and Electronics Diagrams
  • IEC 60617:2025 (BS 3939) — Graphical symbols for diagrams
  • ANSI/IEEE C37.2 — Electrical Power System Device Function Numbers

sld·§ IEEE 315
Utility + Generator Backup Single-line diagram with 8 nodes and 7 connections Utility + Generator Backup 480V 480V Utility 480V G Emergency Gen 500 kW 480V ATS ATS-1 800A 480V · Critical Load Bus CB1 200A CB2 200A Critical Load 1 100A Critical Load 2 100A
Generator + ATS backup power
Single-line diagram for a utility + emergency generator ATS transfer system feeding critical loads on a 480 V bus — per IEEE 315 for facility design review.
industrial & process
sld·§ IEEE 315
13.8 kV Substation Single-line diagram with 10 nodes and 9 connections 13.8 kV Substation 138 13.8 Grid 138 kV 138 · bus_hv xfmr1 kva: 15000 primary: 138 secondary: 13.8 13.8 · bus_mv brk1 brk2 brk3 Feeder 1 Feeder 2 Feeder 3
13.8 kV utility substation
13.8 kV distribution substation single-line diagram with 138 kV grid input, 15 MVA step-down transformer, and three feeder breakers per IEEE 315.
industrial & process

11. Roadmap

Planned — not yet parseable. Do not use these in generated DSL today; the parser will reject or ignore them.

  • Bus-tie open/closed statebus_tie with explicit open/closed attribute so the symbol renders in the correct switching position.
  • Protection zones — a zone: or boundary: block that draws a dashed rectangle around a set of nodes (relay + CT + breaker) to indicate a protection zone.
  • Arc-flash annotation blocksarc_flash: [incident_energy: "8 cal/cm²", ppe: "2", distance: "18in"] per IEEE 1584.
  • Voltage-level banding — automatic horizontal shading bands by kV level; nodes are placed in their voltage tier automatically.
  • Bidirectional connection (<->) — for bus-tie or normally-open tie paths where direction is undefined.

Track in the GitHub issues if you need any of these sooner.