Skip to content
CircuitKitBy Crafter Lab
EditorGalleryLesson
← Back to collection
Example / transistor-switch / geist-darkExpectation matched

Author-named graph

A three-pin NPN switches the LED collector path. A separate base resistor/control node and supply-negative/emitter ground return remain explicit. Short author component/port IDs and a slash/tilde net name exercise role resolution and JSON pointer escaping, without changing topology.

multi-pinsharedgroundcontrolcollectordrawing-onlyIDsjson-pointer
Actual core output / SVGtransistor-switch/author-ids/geist-dark
Author-named graphAuthor-named graph. X1: dc-source, 5 V. X2: resistor, 10 kΩ. X3: resistor, 330 Ω. X4: led, LED. X5: npn, NPN. node/one~: X1.positive connected to X3.a. node2: X3.b connected to X4.anode. node3: X4.cathode connected to X5.collector. node4: X2.a connected to X6. node5: X2.b connected to X5.base. node6: X1.negative connected to X5.emitter connected to X7. Topology illustration, not a device simulation. Shared-ground low-side NPN topology. No gain, saturation, LED current or switching-time model.. Focus components: none. Focus nets: none.

Scroll horizontally on smaller screens to inspect legible nodes and labels. No simulation is performed.

The original input stays intact, including invalid fields.

Open in editorDownload JSONDownload SVG ↓
Expected vs. actual

An inspectable result.

These checks compare the renderer outcome with the declared case expectation. The stress test also checks determinism, geometry, and connectivity.

Expected
Successful SVG render
Actual
SVG rendered0 diagnostics
Case check
Passed
Recipe / theme
NPN low-side LED switchgeist-dark
The circuit graph, not its drawing

Electrical nodes & connectivity

Each net is one electrical node: the named endpoints below are connected. Component pins and external ports are endpoints. These counts are not the number of geometric junction dots or wire bends. No voltages, currents, or simulation results are inferred.

Components
5
Electrical nodes / nets
6
Component pins
11
External ports
2
Connected endpoints
13
Electrical nodes from normalized circuit.nets
Net / electrical nodeEndpointsConnected component pins and ports
node/one~2
  • X1.positive
  • X3.a
node22
  • X3.b
  • X4.anode
node32
  • X4.cathode
  • X5.collector
node42
  • X2.a
  • X6
node52
  • X2.b
  • X5.base
node63
  • X1.negative
  • X5.emitter
  • X7
Structured feedback

Diagnostics / 0

No diagnostics. The renderer accepted this source and produced the figure above.

Original figure document · JSON
{
  "version": 1,
  "circuit": {
    "components": {
      "X1": {
        "type": "dc-source",
        "voltage": 5
      },
      "X2": {
        "type": "resistor",
        "resistance": 10000
      },
      "X3": {
        "type": "resistor",
        "resistance": 330
      },
      "X4": {
        "type": "led"
      },
      "X5": {
        "type": "npn"
      }
    },
    "ports": {
      "X6": {
        "kind": "terminal"
      },
      "X7": {
        "kind": "ground"
      }
    },
    "nets": {
      "node/one~": [
        "X1.positive",
        "X3.a"
      ],
      "node2": [
        "X3.b",
        "X4.anode"
      ],
      "node3": [
        "X4.cathode",
        "X5.collector"
      ],
      "node4": [
        "X6",
        "X2.a"
      ],
      "node5": [
        "X2.b",
        "X5.base"
      ],
      "node6": [
        "X5.emitter",
        "X1.negative",
        "X7"
      ]
    }
  },
  "layout": {
    "preset": "transistor-switch",
    "roles": {
      "supply": "X1",
      "baseResistor": "X2",
      "series": "X3",
      "led": "X4",
      "switch": "X5",
      "control": "X6",
      "ground": "X7"
    }
  },
  "presentation": {
    "title": "Author-named graph",
    "theme": {
      "preset": "geist-dark"
    },
    "highlight": {
      "components": [],
      "nets": []
    }
  }
}
Expected outcome & actual diagnostics · JSON
{
  "id": "transistor-switch/author-ids/geist-dark",
  "expectation": {
    "kind": "render"
  },
  "actual": {
    "ok": true,
    "diagnostics": []
  },
  "passed": true
}
Rendered bounds & renderer version · JSON
{
  "rendererVersion": "0.1.0",
  "bounds": {
    "x": 0,
    "y": 0,
    "width": 1500,
    "height": 1200,
    "labels": {
      "title": {
        "x": 64.68,
        "y": 57.86,
        "width": 319.124,
        "height": 29.647999999999996
      },
      "subtitle": {
        "x": 65.38,
        "y": 104.33500000000001,
        "width": 171.28499999999994,
        "height": 10.844999999999999
      },
      "formula": {
        "x": 64.8,
        "y": 1120.78,
        "width": 549.5200000000001,
        "height": 17.460000000000036
      },
      "assumption": {
        "x": 64.77,
        "y": 1155.836,
        "width": 615.6500000000004,
        "height": 12.432000000000016
      },
      "X1:id": {
        "x": 310.9,
        "y": 533.22,
        "width": 19.620000000000005,
        "height": 12.779999999999973
      },
      "X1:value": {
        "x": 311.44,
        "y": 556.96,
        "width": 41.04000000000002,
        "height": 17.423999999999978
      },
      "X6:port": {
        "x": 289,
        "y": 791.48,
        "width": 22,
        "height": 14.840000000000032
      },
      "X3:id": {
        "x": 1090.9,
        "y": 342.932,
        "width": 19.799999999999955,
        "height": 13.355999999999995
      },
      "X3:value": {
        "x": 1091.2,
        "y": 366.576,
        "width": 70.58399999999983,
        "height": 17.807999999999993
      },
      "X4:id": {
        "x": 1090.9,
        "y": 533.22,
        "width": 19.97999999999979,
        "height": 12.779999999999973
      },
      "X4:value": {
        "x": 1092.4,
        "y": 556.96,
        "width": 39.88799999999992,
        "height": 17.039999999999964
      },
      "X2:id": {
        "x": 590.1,
        "y": 761.932,
        "width": 19.799999999999955,
        "height": 13.067999999999984
      },
      "X2:value": {
        "x": 565.44,
        "y": 785.576,
        "width": 70.34399999999994,
        "height": 17.807999999999993
      },
      "X5:id": {
        "x": 1080.9,
        "y": 807.22,
        "width": 19.61999999999989,
        "height": 13.067999999999984
      },
      "X5:value": {
        "x": 1081.68,
        "y": 830.96,
        "width": 39.83999999999992,
        "height": 17.039999999999964
      },
      "X7:port": {
        "x": 750.85,
        "y": 1037.93,
        "width": 18.529999999999973,
        "height": 12.069999999999936
      }
    },
    "symbols": {
      "X1": {
        "x": 216.5,
        "y": 498.5,
        "width": 67,
        "height": 123
      },
      "X3": {
        "x": 984.5,
        "y": 308.5,
        "width": 31,
        "height": 123
      },
      "X4": {
        "x": 974.5,
        "y": 498.5,
        "width": 83,
        "height": 123
      },
      "X2": {
        "x": 538.5,
        "y": 824.5,
        "width": 123,
        "height": 31
      },
      "X5": {
        "x": 868.5,
        "y": 758.5,
        "width": 133,
        "height": 163
      },
      "X7": {
        "x": 679.5,
        "y": 1028.5,
        "width": 41,
        "height": 31
      }
    },
    "routes": {
      "node/one~": [
        {
          "x": 248.5,
          "y": 258.5,
          "width": 3,
          "height": 243
        },
        {
          "x": 248.5,
          "y": 258.5,
          "width": 753,
          "height": 3
        },
        {
          "x": 998.5,
          "y": 258.5,
          "width": 3,
          "height": 53
        }
      ],
      "node2": [
        {
          "x": 998.5,
          "y": 428.5,
          "width": 3,
          "height": 73
        }
      ],
      "node3": [
        {
          "x": 998.5,
          "y": 618.5,
          "width": 3,
          "height": 143
        }
      ],
      "node4": [
        {
          "x": 298.5,
          "y": 838.5,
          "width": 243,
          "height": 3
        }
      ],
      "node5": [
        {
          "x": 658.5,
          "y": 838.5,
          "width": 213,
          "height": 3
        }
      ],
      "node6": [
        {
          "x": 248.5,
          "y": 618.5,
          "width": 3,
          "height": 383
        },
        {
          "x": 248.5,
          "y": 998.5,
          "width": 753,
          "height": 3
        },
        {
          "x": 998.5,
          "y": 918.5,
          "width": 3,
          "height": 83
        },
        {
          "x": 698.5,
          "y": 998.5,
          "width": 3,
          "height": 33
        }
      ]
    }
  }
}
← Previous exampleAuthor-named graphgeist-lightNext example →Author-named graphgeist-print
CircuitKit · By Crafter Lab

A drawing tool, not simulation, electrical-safety approval, or a fabrication system.

Apache-2.0Source on GitHub ↗