Skip to content

Auto-Generated Diagrams

SpiceBook can generate a schematic diagram from any SPICE cell. Click the Schematic button in the cell toolbar, and the backend parses the netlist into a circuit diagram rendered as an inline SVG.

The schematic generator:

  1. Parses the netlist to identify components (resistors, capacitors, inductors, voltage sources, current sources) and their node connections
  2. Determines layout by walking the circuit graph and positioning components to minimize wire crossings
  3. Renders SVG with standard electrical engineering symbols — IEEE zigzag for resistors, parallel plates for capacitors, coil for inductors, ± symbols for sources
  4. Labels components with their reference designator (R1, C1, V1) and value

The result is a clean, readable diagram that matches what you’d draw by hand.

ComponentNetlist PrefixSymbol
ResistorRIEEE zigzag (with optional color bands)
CapacitorCParallel plates
InductorLCoil
Voltage sourceVCircle with ±
Current sourceICircle with arrow
Groundnode 0Standard ground symbol

The schematic endpoint returns a component_map alongside the SVG, listing each component and its type:

{
"svg": "<svg ...>...</svg>",
"success": true,
"component_map": {
"R1": "resistor",
"V1": "voltage_source",
"C1": "capacitor"
}
}

This is useful for programmatic tools that need to know what’s in the circuit without parsing the SVG.

Generate schematics programmatically:

Terminal window
curl -X POST https://spicebook.warehack.ing/api/notebooks/{id}/cells/{cell_id}/schematic

The cell must be type spice. No request body is needed — the cell’s source netlist is used directly. See the Waveforms & Schematics API reference for the full response format.