Connections

Connections represent electrical conductors between components. They define how power flows through your system from sources to loads.

Manual connections

Create connections by dragging from one component's handle to another:

  1. Hover over a component to reveal connection handles (small circles or lines).
  2. Click and hold on a handle.
  3. Drag toward the target component.
  4. Drop on a target component's handle.
  5. The connection appears as a line between components.

Handles appear at connection points:

  • Top handles: Connections from above (source, upstream)
  • Bottom handles: Connections to below (load, downstream)
  • Left/right handles: Horizontal connections (less common)

Most electrical components use top and bottom handles following industry SLD conventions.

Connection handles

Different components have different handle configurations:

Simple handles (single connection per side):

  • Loads: Top only (power in)
  • Motors: Top only (power in)
  • Generators: Bottom only (power out)
  • Utility feeds: Bottom only (power out)

Pass-through handles (both top and bottom):

  • Breakers: Top (line side) and bottom (load side)
  • Fuses: Top (line side) and bottom (load side)
  • Cables: Both ends connect
  • Transformers: Top (primary) and bottom (secondary)

Dynamic handles (unlimited connections):

  • Buses: Creates handles dynamically as components connect
  • See Buses for bus-specific behavior)

Handles are invisible by default and appear when you hover over a component or during connection mode.

Auto-connection system

The auto-connect feature automatically connects components you drop near compatible existing components:

How auto-connect works:

  1. Drag a component from the toolbar.
  2. Position it within ~300px of an existing component.
  3. The target component highlights green if connection is valid.
  4. Drop the component.
  5. System automatically creates a connection between compatible handles.

Visual feedback:

  • Green highlight: Target component will auto-connect on drop
  • Green circle: Shows potential connection handle
  • Connection preview: Temporary line shows where connection will form

Auto-connect saves time when building typical power system configurations like:

  • Utility feed → Breaker → Transformer → Bus → Loads
  • Generator → Switchgear → Distribution panels

When auto-connect doesn't trigger:

  • Component dropped >300px from any existing component
  • No electrically compatible components nearby
  • Shift key held during drop (disables auto-connect)
  • Target component already has maximum connections

Proximity threshold (~300px)

Auto-connect activates when components are within approximately 300 pixels:

  • Within threshold: Green highlighting, auto-connect enabled
  • Outside threshold: No highlighting, manual connection required

The 300px threshold provides:

  • Generous range for quick diagram building
  • Prevents unwanted connections to distant components
  • Visual feedback through highlighting before you drop

If auto-connect attempts an unwanted connection, press Shift while dropping to disable auto-connection for that placement.

Shift key to disable auto-connect

To place a component near others without auto-connecting:

  1. Start dragging a component from the toolbar.
  2. Hold Shift key before dropping.
  3. Drop the component.
  4. Component places without creating connections.
  5. Manually connect later if desired.

This is useful when:

  • Building dense diagrams where components are close but shouldn't connect
  • Placing multiple components before connecting them
  • You want precise control over connection points

Connection validation rules

The system validates electrical compatibility before allowing connections:

Valid connections:

  • Source to bus (utility feed, generator to distribution bus)
  • Bus to load through protection (bus → breaker → load)
  • Transformer primary to upstream bus, secondary to downstream bus
  • Generator to switchgear to distribution
  • Cable/conductor between any compatible components

Invalid connections prevented:

  • Load to load (two sinks)
  • Generator to generator (two sources without bus)
  • Voltage-incompatible components (13.8kV to 480V without transformer)
  • Reverse connections (load side to line side)

Connection validation checks:

  • Component types are electrically compatible
  • Voltage levels are appropriate
  • Connection direction matches power flow
  • No duplicate connections between same components

If you attempt an invalid connection, the system rejects it and the connection does not form.

Connection direction and power flow

Connections follow electrical power flow direction:

Downstream (normal power flow):

  • Sources connect downward: Utility → Transformer → Bus → Loads
  • Top handles connect to bottom handles
  • Represents power flowing from source to load

Upstream (reverse connections for generation):

  • Generators can connect upward to buses
  • Bottom handles (generator output) connect to bus top handles
  • Represents power injection into the system

The visual layout matches electrical intent:

  • Power sources at top of diagram
  • Distribution in middle
  • Loads at bottom

This top-to-bottom flow is industry standard for single-line diagrams.

Disconnecting components

To remove a connection:

Method 1: Select and delete

  1. Click on the connection line to select it.
  2. The line highlights (typically blue).
  3. Press Delete or Backspace key.
  4. Connection removes immediately.

Method 2: Right-click menu

  1. Right-click directly on the connection line.
  2. Select Delete from the context menu.
  3. Connection removes immediately.

Deleting a component:

  • When you delete a component, all its connections delete automatically.
  • Prevents orphaned connection lines.

Undo:

  • Connection deletions support undo (Ctrl/Cmd+Z).
  • Accidentally deleted connections can be restored.

Multiple connections

Some components support multiple connections:

Buses:

  • Unlimited connections
  • Each connected component gets its own dynamic handle
  • Handles align vertically with connected components
  • See Buses

Transformers:

  • One primary connection (top)
  • One secondary connection (bottom)
  • Cannot parallel transformers with simple connections

Breakers and fuses:

  • One line side connection (top)
  • One load side connection (bottom)
  • Series protection only (no parallel paths)

Loads:

  • Typically one connection (radial feed)
  • Some loads may support backup feeds (future feature)

Connection display

Connection lines have visual states:

Normal state:

  • Thin gray line
  • Connects component handles
  • Straight or stepped path automatically routed

Selected state:

  • Blue highlighted line
  • Thicker stroke
  • Shows handles at both ends

Hover state:

  • Slightly thicker when mouse hovers over
  • Makes it easier to select among dense connections

Invalid state (validation failed):

  • Red dashed line (if validation errors exist)
  • Indicates electrical compatibility issue

Connection types

All connections in ekx are modeled as cables with electrical properties:

  • Resistance per km
  • Reactance per km
  • Capacitance per km (for long lines)
  • Length

Even a simple connection between a bus and breaker is represented as a short cable with impedance. This enables accurate power flow analysis.

To configure connection electrical properties:

  1. Select the connection line.
  2. Edit cable properties in the Properties panel.
  3. Set cable type, length, and size.

Editing existing connections

To change a connection:

Method 1: Delete and recreate

  1. Delete the existing connection.
  2. Create a new connection from different handles or to different component.

Method 2: Reconnect

  1. Click and hold the handle at one end of the connection.
  2. Drag to a new component or handle.
  3. Drop to reconnect.

Connection edits update power flow calculations automatically when you rerun analysis.

Connection labels

Connections can display labels showing:

  • Cable name or ID
  • Current flow (after power flow analysis)
  • Power transfer (MW, MVAR)

Labels appear near the connection line center. Toggle label visibility in view settings.

Best practices

For clean diagrams:

  • Route connections top-to-bottom to match power flow
  • Avoid crossing connection lines when possible
  • Use buses to organize multiple connections
  • Group related components to minimize connection length

For accurate analysis:

  • Set appropriate cable types and lengths for all connections
  • Verify voltage compatibility of connected components
  • Review validation warnings for connection issues
  • Ensure all components connect to the main power system (no isolated islands)

For efficient editing:

  • Use auto-connect when building typical configurations
  • Use Shift key to disable auto-connect in dense areas
  • Delete components with many connections carefully (deletes all connections)
  • Use undo if you accidentally delete connections