{
  "schemaVersion": 1,
  "id": "example_electrical",
  "title": "DC power and indicator circuit",
  "diagram": {
    "adapter": "flowchart",
    "direction": "LR",
    "nodes": [
      {
        "id": "supply",
        "kind": "voltage",
        "label": "12 V supply",
        "ports": [
          {
            "name": "+",
            "side": "top",
            "position": {
              "x": 0.5,
              "y": 0
            },
            "id": "supply:+"
          },
          {
            "name": "−",
            "side": "bottom",
            "position": {
              "x": 0.5,
              "y": 0.64
            },
            "id": "supply:−"
          }
        ],
        "fields": {
          "tag": "PS1",
          "description": "",
          "voltage": "12 VDC"
        }
      },
      {
        "id": "fuse",
        "kind": "fuse",
        "label": "Supply protection",
        "ports": [
          {
            "name": "A",
            "side": "left",
            "position": {
              "x": 0,
              "y": 0.35
            },
            "id": "fuse:A"
          },
          {
            "name": "B",
            "side": "right",
            "position": {
              "x": 1,
              "y": 0.35
            },
            "id": "fuse:B"
          }
        ],
        "fields": {
          "tag": "F1",
          "rating": "250 mA",
          "description": ""
        }
      },
      {
        "id": "switch",
        "kind": "switch",
        "label": "Enable switch",
        "ports": [
          {
            "name": "A",
            "side": "left",
            "position": {
              "x": 0,
              "y": 0.35
            },
            "id": "switch:A"
          },
          {
            "name": "B",
            "side": "right",
            "position": {
              "x": 1,
              "y": 0.35
            },
            "id": "switch:B"
          }
        ],
        "fields": {
          "tag": "S1",
          "description": "",
          "state": "Closed"
        }
      },
      {
        "id": "limit",
        "kind": "resistor",
        "label": "Current limit",
        "ports": [
          {
            "name": "A",
            "side": "left",
            "position": {
              "x": 0,
              "y": 0.35
            },
            "id": "limit:A"
          },
          {
            "name": "B",
            "side": "right",
            "position": {
              "x": 1,
              "y": 0.35
            },
            "id": "limit:B"
          }
        ],
        "fields": {
          "tag": "R1",
          "description": "",
          "resistance": "1 kΩ"
        }
      },
      {
        "id": "led",
        "kind": "led",
        "label": "Power indicator",
        "ports": [
          {
            "name": "A",
            "side": "left",
            "position": {
              "x": 0,
              "y": 0.35
            },
            "id": "led:A"
          },
          {
            "name": "K",
            "side": "right",
            "position": {
              "x": 1,
              "y": 0.35
            },
            "id": "led:K"
          }
        ],
        "fields": {
          "tag": "D1",
          "color": "Green",
          "description": ""
        }
      },
      {
        "id": "return",
        "kind": "junction",
        "label": "Return junction",
        "ports": [
          {
            "name": "N",
            "side": "top",
            "position": {
              "x": 0.5,
              "y": 0.05
            },
            "id": "return:N"
          },
          {
            "name": "E",
            "side": "right",
            "position": {
              "x": 0.85,
              "y": 0.35
            },
            "id": "return:E"
          },
          {
            "name": "S",
            "side": "bottom",
            "position": {
              "x": 0.5,
              "y": 0.65
            },
            "id": "return:S"
          },
          {
            "name": "W",
            "side": "left",
            "position": {
              "x": 0.15,
              "y": 0.35
            },
            "id": "return:W"
          }
        ],
        "fields": {
          "tag": "0V",
          "description": ""
        }
      },
      {
        "id": "ground",
        "kind": "ground",
        "label": "Reference ground",
        "ports": [
          {
            "name": "GND",
            "side": "top",
            "position": {
              "x": 0.5,
              "y": 0.05
            },
            "id": "ground:GND"
          }
        ],
        "fields": {
          "tag": "",
          "description": ""
        }
      },
      {
        "id": "cap",
        "kind": "capacitor",
        "label": "Supply decoupling",
        "ports": [
          {
            "name": "+",
            "side": "left",
            "position": {
              "x": 0,
              "y": 0.35
            },
            "id": "cap:+"
          },
          {
            "name": "−",
            "side": "right",
            "position": {
              "x": 1,
              "y": 0.35
            },
            "id": "cap:−"
          }
        ],
        "fields": {
          "tag": "C1",
          "description": "",
          "capacitance": "100 nF"
        }
      }
    ],
    "connectors": [
      {
        "id": "example_electrical_edge_0",
        "from": {
          "nodeId": "supply",
          "portId": "supply:+"
        },
        "to": {
          "nodeId": "fuse",
          "portId": "fuse:A"
        },
        "label": "12 V"
      },
      {
        "id": "example_electrical_edge_1",
        "from": {
          "nodeId": "fuse",
          "portId": "fuse:B"
        },
        "to": {
          "nodeId": "switch",
          "portId": "switch:A"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_2",
        "from": {
          "nodeId": "switch",
          "portId": "switch:B"
        },
        "to": {
          "nodeId": "limit",
          "portId": "limit:A"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_3",
        "from": {
          "nodeId": "limit",
          "portId": "limit:B"
        },
        "to": {
          "nodeId": "led",
          "portId": "led:A"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_4",
        "from": {
          "nodeId": "led",
          "portId": "led:K"
        },
        "to": {
          "nodeId": "return",
          "portId": "return:E"
        },
        "label": "Return"
      },
      {
        "id": "example_electrical_edge_5",
        "from": {
          "nodeId": "return",
          "portId": "return:W"
        },
        "to": {
          "nodeId": "supply",
          "portId": "supply:−"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_6",
        "from": {
          "nodeId": "return",
          "portId": "return:S"
        },
        "to": {
          "nodeId": "ground",
          "portId": "ground:GND"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_7",
        "from": {
          "nodeId": "supply",
          "portId": "supply:+"
        },
        "to": {
          "nodeId": "cap",
          "portId": "cap:+"
        },
        "label": ""
      },
      {
        "id": "example_electrical_edge_8",
        "from": {
          "nodeId": "cap",
          "portId": "cap:−"
        },
        "to": {
          "nodeId": "return",
          "portId": "return:N"
        },
        "label": ""
      }
    ],
    "groups": []
  },
  "layout": {
    "supply": {
      "x": 40,
      "y": 180,
      "width": 150,
      "height": 130,
      "color": "#ffe4e6"
    },
    "fuse": {
      "x": 300,
      "y": 40,
      "width": 220,
      "height": 150,
      "color": "#f0edfa"
    },
    "switch": {
      "x": 560,
      "y": 40,
      "width": 170,
      "height": 105,
      "color": "#e0e7ff"
    },
    "limit": {
      "x": 820,
      "y": 40,
      "width": 180,
      "height": 105,
      "color": "#fef3c7"
    },
    "led": {
      "x": 820,
      "y": 290,
      "width": 220,
      "height": 150,
      "color": "#f0edfa"
    },
    "return": {
      "x": 520,
      "y": 290,
      "width": 120,
      "height": 105,
      "color": "#e2e8f0"
    },
    "ground": {
      "x": 510,
      "y": 520,
      "width": 140,
      "height": 100,
      "color": "#e2e8f0"
    },
    "cap": {
      "x": 270,
      "y": 290,
      "width": 160,
      "height": 112,
      "color": "#e0f2fe"
    }
  },
  "presentation": {
    "steps": [
      {
        "id": "example_electrical_focus",
        "type": "focus",
        "targetId": "supply",
        "duration": 3,
        "caption": "A tagged DC supply with protection, switching and an indicator."
      },
      {
        "id": "example_electrical_trace_0",
        "type": "connection",
        "targetId": "example_electrical_edge_0",
        "duration": 2,
        "caption": "Follow the supply wire through the fuse."
      },
      {
        "id": "example_electrical_trace_1",
        "type": "connection",
        "targetId": "example_electrical_edge_1",
        "duration": 2,
        "caption": "Follow the connection → Enable switch"
      },
      {
        "id": "example_electrical_trace_2",
        "type": "connection",
        "targetId": "example_electrical_edge_2",
        "duration": 2,
        "caption": "Follow the connection → Current limit"
      },
      {
        "id": "example_electrical_trace_3",
        "type": "connection",
        "targetId": "example_electrical_edge_3",
        "duration": 2,
        "caption": "Follow the connection → Power indicator"
      },
      {
        "id": "example_electrical_trace_4",
        "type": "connection",
        "targetId": "example_electrical_edge_4",
        "duration": 2,
        "caption": "Return → Return junction"
      },
      {
        "id": "example_electrical_trace_5",
        "type": "connection",
        "targetId": "example_electrical_edge_5",
        "duration": 2,
        "caption": "Follow the connection → 12 V supply"
      },
      {
        "id": "example_electrical_trace_6",
        "type": "connection",
        "targetId": "example_electrical_edge_6",
        "duration": 2,
        "caption": "Follow the connection → Reference ground"
      },
      {
        "id": "example_electrical_trace_7",
        "type": "connection",
        "targetId": "example_electrical_edge_7",
        "duration": 2,
        "caption": "Follow the connection → Supply decoupling"
      },
      {
        "id": "example_electrical_trace_8",
        "type": "connection",
        "targetId": "example_electrical_edge_8",
        "duration": 2,
        "caption": "Follow the connection → Return junction"
      },
      {
        "id": "example_electrical_note",
        "type": "note",
        "text": "A connected conceptual circuit. Edit component references and values; Hanila does not solve the circuit.",
        "duration": 4
      }
    ]
  },
  "connectorStyles": {
    "example_electrical_edge_0": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_1": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_2": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_3": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_4": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_5": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_6": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_7": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    },
    "example_electrical_edge_8": {
      "routing": "curved",
      "pattern": "solid",
      "width": 1.8,
      "color": "#647888",
      "startArrow": "none",
      "endArrow": "none",
      "flow": {
        "enabled": false,
        "direction": "forward",
        "speed": 48
      }
    }
  }
}
