schematex 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/ai-sdk.cjs +23 -23
- package/dist/ai/ai-sdk.d.cts +3 -3
- package/dist/ai/ai-sdk.d.ts +3 -3
- package/dist/ai/ai-sdk.js +18 -18
- package/dist/ai/index.cjs +29 -29
- package/dist/ai/index.d.cts +3 -3
- package/dist/ai/index.d.ts +3 -3
- package/dist/ai/index.js +18 -18
- package/dist/{api-BIqZjEDf.d.ts → api-DIJM_mqp.d.ts} +2 -2
- package/dist/{api-BXkOT7GL.d.cts → api-JaBtsUT8.d.cts} +2 -2
- package/dist/browser.cjs +24 -24
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +18 -18
- package/dist/{chunk-3C5DKCBJ.cjs → chunk-2SZJQVPN.cjs} +12 -12
- package/dist/{chunk-3C5DKCBJ.cjs.map → chunk-2SZJQVPN.cjs.map} +1 -1
- package/dist/{chunk-W3IXH6BN.cjs → chunk-34O3C6OC.cjs} +4 -4
- package/dist/chunk-34O3C6OC.cjs.map +1 -0
- package/dist/{chunk-RVHOCGHT.js → chunk-3GAPHXCE.js} +3 -3
- package/dist/{chunk-RVHOCGHT.js.map → chunk-3GAPHXCE.js.map} +1 -1
- package/dist/{chunk-HCBXTBFA.cjs → chunk-5FYPSIGD.cjs} +12 -12
- package/dist/{chunk-HCBXTBFA.cjs.map → chunk-5FYPSIGD.cjs.map} +1 -1
- package/dist/{chunk-B7ATOBL7.js → chunk-6NUAGU6O.js} +3 -3
- package/dist/{chunk-B7ATOBL7.js.map → chunk-6NUAGU6O.js.map} +1 -1
- package/dist/{chunk-WZ5QBGPZ.cjs → chunk-77GPD4YQ.cjs} +4 -4
- package/dist/{chunk-WZ5QBGPZ.cjs.map → chunk-77GPD4YQ.cjs.map} +1 -1
- package/dist/{chunk-S2CHBZ4A.cjs → chunk-BL57NQKN.cjs} +13 -13
- package/dist/{chunk-S2CHBZ4A.cjs.map → chunk-BL57NQKN.cjs.map} +1 -1
- package/dist/{chunk-EPKIJEH7.js → chunk-C7V57V6O.js} +54 -8
- package/dist/chunk-C7V57V6O.js.map +1 -0
- package/dist/{chunk-I6UJR4SG.cjs → chunk-DR3DDDQY.cjs} +4 -4
- package/dist/{chunk-I6UJR4SG.cjs.map → chunk-DR3DDDQY.cjs.map} +1 -1
- package/dist/{chunk-ZZHQBAC3.js → chunk-EVEPI423.js} +139 -5
- package/dist/chunk-EVEPI423.js.map +1 -0
- package/dist/{chunk-GV5QLYTW.js → chunk-HL5PS6MG.js} +3 -3
- package/dist/{chunk-GV5QLYTW.js.map → chunk-HL5PS6MG.js.map} +1 -1
- package/dist/{chunk-MKECYIWN.js → chunk-HPEAE3JM.js} +3 -3
- package/dist/{chunk-MKECYIWN.js.map → chunk-HPEAE3JM.js.map} +1 -1
- package/dist/{chunk-KPKGMOTS.js → chunk-JN6FHUC6.js} +3 -3
- package/dist/{chunk-KPKGMOTS.js.map → chunk-JN6FHUC6.js.map} +1 -1
- package/dist/{chunk-OANWVUBA.js → chunk-JTGTWBAD.js} +3 -3
- package/dist/chunk-JTGTWBAD.js.map +1 -0
- package/dist/{chunk-OHLNH7IO.js → chunk-K2D6VFLP.js} +3 -3
- package/dist/{chunk-OHLNH7IO.js.map → chunk-K2D6VFLP.js.map} +1 -1
- package/dist/{chunk-ZZFPXCAK.cjs → chunk-KGOZBABH.cjs} +12 -12
- package/dist/{chunk-ZZFPXCAK.cjs.map → chunk-KGOZBABH.cjs.map} +1 -1
- package/dist/{chunk-624UQ5R6.cjs → chunk-LDONE225.cjs} +1104 -442
- package/dist/chunk-LDONE225.cjs.map +1 -0
- package/dist/{chunk-XO7WW3I6.cjs → chunk-LPAWZYDU.cjs} +4 -4
- package/dist/{chunk-XO7WW3I6.cjs.map → chunk-LPAWZYDU.cjs.map} +1 -1
- package/dist/{chunk-IPEHLRTI.js → chunk-MPCSWRZC.js} +76 -14
- package/dist/chunk-MPCSWRZC.js.map +1 -0
- package/dist/{chunk-ROX5KEZM.cjs → chunk-NFZMNKOR.cjs} +15 -15
- package/dist/{chunk-ROX5KEZM.cjs.map → chunk-NFZMNKOR.cjs.map} +1 -1
- package/dist/{chunk-R5E2LSN2.cjs → chunk-NZT5P2XZ.cjs} +73 -2
- package/dist/chunk-NZT5P2XZ.cjs.map +1 -0
- package/dist/{chunk-GPC5BWLI.js → chunk-OFKRELZK.js} +3 -3
- package/dist/{chunk-GPC5BWLI.js.map → chunk-OFKRELZK.js.map} +1 -1
- package/dist/{chunk-XJJUJ2EF.cjs → chunk-QBS4F44Q.cjs} +517 -10
- package/dist/chunk-QBS4F44Q.cjs.map +1 -0
- package/dist/{chunk-SUIDD2C5.cjs → chunk-SHMG7BVF.cjs} +54 -8
- package/dist/chunk-SHMG7BVF.cjs.map +1 -0
- package/dist/{chunk-XEIVA2CT.js → chunk-T3FV73LM.js} +3 -3
- package/dist/{chunk-XEIVA2CT.js.map → chunk-T3FV73LM.js.map} +1 -1
- package/dist/{chunk-4THUHX2D.cjs → chunk-T5KHNJ67.cjs} +5 -5
- package/dist/{chunk-4THUHX2D.cjs.map → chunk-T5KHNJ67.cjs.map} +1 -1
- package/dist/{chunk-FXPOHPBE.cjs → chunk-TACTEF2N.cjs} +4 -4
- package/dist/{chunk-FXPOHPBE.cjs.map → chunk-TACTEF2N.cjs.map} +1 -1
- package/dist/{chunk-MI77LY6A.js → chunk-TRUJ4Q6V.js} +1044 -383
- package/dist/chunk-TRUJ4Q6V.js.map +1 -0
- package/dist/{chunk-BXNOXOE4.cjs → chunk-UHPGWO77.cjs} +77 -14
- package/dist/chunk-UHPGWO77.cjs.map +1 -0
- package/dist/{chunk-AORGFBEH.js → chunk-UK6HF6PE.js} +73 -3
- package/dist/chunk-UK6HF6PE.js.map +1 -0
- package/dist/{chunk-35XCP2E4.js → chunk-WAKRRGAV.js} +516 -10
- package/dist/chunk-WAKRRGAV.js.map +1 -0
- package/dist/{chunk-T3ZN5P32.cjs → chunk-WK36Z63Y.cjs} +141 -7
- package/dist/chunk-WK36Z63Y.cjs.map +1 -0
- package/dist/{chunk-LGFB4H5B.js → chunk-WU2N6ZVM.js} +3 -3
- package/dist/{chunk-LGFB4H5B.js.map → chunk-WU2N6ZVM.js.map} +1 -1
- package/dist/{chunk-FHZTWWI6.js → chunk-YMZTXOUG.js} +3 -3
- package/dist/{chunk-FHZTWWI6.js.map → chunk-YMZTXOUG.js.map} +1 -1
- package/dist/{chunk-XSPENTEG.js → chunk-YTGOLTLJ.js} +3 -3
- package/dist/{chunk-XSPENTEG.js.map → chunk-YTGOLTLJ.js.map} +1 -1
- package/dist/{chunk-VZO2SX6Q.cjs → chunk-Z3A2UNK2.cjs} +4 -4
- package/dist/{chunk-VZO2SX6Q.cjs.map → chunk-Z3A2UNK2.cjs.map} +1 -1
- package/dist/{diagnostics-CzHW0RCo.d.cts → diagnostics-BKRow1ur.d.cts} +15 -1
- package/dist/{diagnostics-CzHW0RCo.d.ts → diagnostics-BKRow1ur.d.ts} +15 -1
- package/dist/diagrams/blockdiagram/index.cjs +5 -5
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +1 -1
- package/dist/diagrams/circuit/index.cjs +12 -8
- package/dist/diagrams/circuit/index.d.cts +13 -2
- package/dist/diagrams/circuit/index.d.ts +13 -2
- package/dist/diagrams/circuit/index.js +2 -2
- package/dist/diagrams/ecomap/index.cjs +7 -7
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.js +2 -2
- package/dist/diagrams/entity/index.cjs +6 -6
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -2
- package/dist/diagrams/fishbone/index.cjs +8 -8
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.js +2 -2
- package/dist/diagrams/flowchart/index.cjs +8 -8
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +2 -2
- package/dist/diagrams/genogram/index.cjs +9 -9
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/genogram/index.js +2 -2
- package/dist/diagrams/ladder/index.cjs +6 -6
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -2
- package/dist/diagrams/logic/index.cjs +8 -8
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -2
- package/dist/diagrams/orgchart/index.cjs +11 -7
- package/dist/diagrams/orgchart/index.d.cts +27 -2
- package/dist/diagrams/orgchart/index.d.ts +27 -2
- package/dist/diagrams/orgchart/index.js +2 -2
- package/dist/diagrams/pedigree/index.cjs +7 -7
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.js +2 -2
- package/dist/diagrams/phylo/index.cjs +7 -7
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -2
- package/dist/diagrams/sld/index.cjs +8 -8
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +2 -2
- package/dist/diagrams/sociogram/index.cjs +6 -6
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +2 -2
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/venn/index.cjs +9 -9
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -2
- package/dist/{index-R0IwpG20.d.cts → index-DU2h1Y-a.d.cts} +1 -1
- package/dist/{index-DdR1Auby.d.ts → index-Dq3Mfxay.d.ts} +1 -1
- package/dist/index.cjs +79 -75
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +22 -22
- package/dist/react.cjs +18 -18
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +17 -17
- package/dist/{tools-B7EqXLgD.d.ts → tools-A0HRZ8jj.d.ts} +11 -2
- package/dist/{tools-DHSVXHM9.d.cts → tools-OzOQnlnV.d.cts} +11 -2
- package/package.json +1 -1
- package/dist/chunk-35XCP2E4.js.map +0 -1
- package/dist/chunk-624UQ5R6.cjs.map +0 -1
- package/dist/chunk-AORGFBEH.js.map +0 -1
- package/dist/chunk-BXNOXOE4.cjs.map +0 -1
- package/dist/chunk-EPKIJEH7.js.map +0 -1
- package/dist/chunk-IPEHLRTI.js.map +0 -1
- package/dist/chunk-MI77LY6A.js.map +0 -1
- package/dist/chunk-OANWVUBA.js.map +0 -1
- package/dist/chunk-R5E2LSN2.cjs.map +0 -1
- package/dist/chunk-SUIDD2C5.cjs.map +0 -1
- package/dist/chunk-T3ZN5P32.cjs.map +0 -1
- package/dist/chunk-W3IXH6BN.cjs.map +0 -1
- package/dist/chunk-XJJUJ2EF.cjs.map +0 -1
- package/dist/chunk-ZZHQBAC3.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveIndustrialTheme } from './chunk-
|
|
1
|
+
import { resolveIndustrialTheme } from './chunk-UK6HF6PE.js';
|
|
2
2
|
import { matchQuotedTitle } from './chunk-5IKOLUWK.js';
|
|
3
3
|
import { text, svgRoot, title, desc, defs, el, group, circle, escapeXml } from './chunk-SYYBKDL7.js';
|
|
4
4
|
|
|
@@ -849,6 +849,461 @@ var disconnect_switch = {
|
|
|
849
849
|
lineWire(38, 0, 48, 0)
|
|
850
850
|
].join("")
|
|
851
851
|
};
|
|
852
|
+
var varistor = {
|
|
853
|
+
length: 40,
|
|
854
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 40, y: 0 } },
|
|
855
|
+
svg: () => [
|
|
856
|
+
lineWire(0, 0, 6, 0),
|
|
857
|
+
`<rect x="6" y="-8" width="28" height="16" fill="white" ${BODY}/>`,
|
|
858
|
+
// voltage-dependence diagonal through the body
|
|
859
|
+
`<line x1="9" y1="9" x2="31" y2="-9" ${BODY}/>`,
|
|
860
|
+
`<text x="12" y="-1" class="schematex-circuit-pol">U</text>`,
|
|
861
|
+
lineWire(34, 0, 40, 0)
|
|
862
|
+
].join("")
|
|
863
|
+
};
|
|
864
|
+
var fuse_slow = {
|
|
865
|
+
length: 30,
|
|
866
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 30, y: 0 } },
|
|
867
|
+
svg: () => [
|
|
868
|
+
lineWire(0, 0, 5, 0),
|
|
869
|
+
`<rect x="5" y="-5" width="20" height="10" rx="5" fill="none" ${BODY}/>`,
|
|
870
|
+
`<line x1="5" y1="0" x2="25" y2="0" ${BODY}/>`,
|
|
871
|
+
`<text x="11" y="-8" class="schematex-circuit-pol">T</text>`,
|
|
872
|
+
lineWire(25, 0, 30, 0)
|
|
873
|
+
].join("")
|
|
874
|
+
};
|
|
875
|
+
var inductor_iron = {
|
|
876
|
+
length: 40,
|
|
877
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 40, y: 0 } },
|
|
878
|
+
svg: () => [
|
|
879
|
+
`<path d="M 0,0 L 5,0 A 5,5 0 0 1 15,0 A 5,5 0 0 1 25,0 A 5,5 0 0 1 35,0 L 40,0" fill="none" ${BODY}/>`,
|
|
880
|
+
// iron core: two parallel lines above the humps
|
|
881
|
+
`<line x1="6" y1="-8" x2="34" y2="-8" ${BODY}/>`,
|
|
882
|
+
`<line x1="6" y1="-11" x2="34" y2="-11" ${BODY}/>`
|
|
883
|
+
].join("")
|
|
884
|
+
};
|
|
885
|
+
var inductor_ferrite = {
|
|
886
|
+
length: 40,
|
|
887
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 40, y: 0 } },
|
|
888
|
+
svg: () => [
|
|
889
|
+
`<path d="M 0,0 L 5,0 A 5,5 0 0 1 15,0 A 5,5 0 0 1 25,0 A 5,5 0 0 1 35,0 L 40,0" fill="none" ${BODY}/>`,
|
|
890
|
+
// ferrite core: one heavy line above the humps
|
|
891
|
+
`<line x1="6" y1="-9" x2="34" y2="-9" stroke-width="2.5" ${BODY}/>`
|
|
892
|
+
].join("")
|
|
893
|
+
};
|
|
894
|
+
var ferrite_bead = {
|
|
895
|
+
length: 30,
|
|
896
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 30, y: 0 } },
|
|
897
|
+
svg: () => [
|
|
898
|
+
lineWire(0, 0, 7, 0),
|
|
899
|
+
`<rect x="7" y="-6" width="16" height="12" rx="2" ${FILL}/>`,
|
|
900
|
+
lineWire(23, 0, 30, 0)
|
|
901
|
+
].join("")
|
|
902
|
+
};
|
|
903
|
+
var varactor = {
|
|
904
|
+
length: 32,
|
|
905
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 32, y: 0 } },
|
|
906
|
+
svg: () => [
|
|
907
|
+
lineWire(0, 0, 8, 0),
|
|
908
|
+
`<polygon points="8,-8 8,8 20,0" ${FILL}/>`,
|
|
909
|
+
// cathode bar + parallel capacitor plate (voltage-variable capacitance)
|
|
910
|
+
`<line x1="20" y1="-8" x2="20" y2="8" ${BODY}/>`,
|
|
911
|
+
`<line x1="24" y1="-8" x2="24" y2="8" ${BODY}/>`,
|
|
912
|
+
lineWire(24, 0, 32, 0)
|
|
913
|
+
].join("")
|
|
914
|
+
};
|
|
915
|
+
var tvs_diode = {
|
|
916
|
+
length: 36,
|
|
917
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 36, y: 0 } },
|
|
918
|
+
svg: () => [
|
|
919
|
+
lineWire(0, 0, 6, 0),
|
|
920
|
+
// two triangles back-to-back onto a shared bar (bidirectional clamp)
|
|
921
|
+
`<polygon points="6,-8 6,8 16,0" ${FILL}/>`,
|
|
922
|
+
`<polygon points="30,-8 30,8 20,0" ${FILL}/>`,
|
|
923
|
+
`<line x1="18" y1="-9" x2="18" y2="9" ${BODY}/>`,
|
|
924
|
+
lineWire(30, 0, 36, 0)
|
|
925
|
+
].join("")
|
|
926
|
+
};
|
|
927
|
+
var bridge_rectifier = {
|
|
928
|
+
length: 48,
|
|
929
|
+
netlistPins: ["ac1", "ac2", "dcp", "dcn"],
|
|
930
|
+
anchors: {
|
|
931
|
+
start: { x: 0, y: 0 },
|
|
932
|
+
end: { x: 48, y: 0 },
|
|
933
|
+
ac1: { x: 0, y: 0 },
|
|
934
|
+
// left corner
|
|
935
|
+
ac2: { x: 48, y: 0 },
|
|
936
|
+
// right corner
|
|
937
|
+
dcp: { x: 24, y: -24 },
|
|
938
|
+
// top corner (+)
|
|
939
|
+
dcn: { x: 24, y: 24 }
|
|
940
|
+
// bottom corner (−)
|
|
941
|
+
},
|
|
942
|
+
svg: () => [
|
|
943
|
+
`<polygon points="0,0 24,-24 48,0 24,24" fill="white" ${BODY}/>`,
|
|
944
|
+
// four diode triangles, all conducting toward DC+ (top)
|
|
945
|
+
`<polygon points="8,-10 15,-10 11,-3" ${FILL}/>`,
|
|
946
|
+
`<polygon points="33,-10 40,-10 36,-3" ${FILL}/>`,
|
|
947
|
+
`<polygon points="8,10 15,10 11,3" ${FILL}/>`,
|
|
948
|
+
`<polygon points="33,10 40,10 36,3" ${FILL}/>`,
|
|
949
|
+
`<text x="24" y="-10" text-anchor="middle" class="schematex-circuit-pol">+</text>`,
|
|
950
|
+
`<text x="24" y="20" text-anchor="middle" class="schematex-circuit-pol">\u2212</text>`
|
|
951
|
+
].join("")
|
|
952
|
+
};
|
|
953
|
+
var darlington_npn = {
|
|
954
|
+
length: 40,
|
|
955
|
+
netlistPins: ["c", "b", "e"],
|
|
956
|
+
anchors: {
|
|
957
|
+
start: { x: 0, y: 0 },
|
|
958
|
+
end: { x: 40, y: -16 },
|
|
959
|
+
base: { x: 0, y: 0 },
|
|
960
|
+
collector: { x: 40, y: -16 },
|
|
961
|
+
emitter: { x: 40, y: 16 },
|
|
962
|
+
b: { x: 0, y: 0 },
|
|
963
|
+
c: { x: 40, y: -16 },
|
|
964
|
+
e: { x: 40, y: 16 }
|
|
965
|
+
},
|
|
966
|
+
svg: () => [
|
|
967
|
+
`<circle cx="20" cy="0" r="16" fill="white" ${BODY}/>`,
|
|
968
|
+
lineWire(0, 0, 10, 0),
|
|
969
|
+
`<line x1="10" y1="-9" x2="10" y2="9" ${BODY}/>`,
|
|
970
|
+
// shared base plate
|
|
971
|
+
// Q1: base → collector, base → Q2 base node
|
|
972
|
+
`<line x1="10" y1="-5" x2="26" y2="-11" ${BODY}/>`,
|
|
973
|
+
`<line x1="10" y1="4" x2="19" y2="7" ${BODY}/>`,
|
|
974
|
+
// Q2: emitter out (NPN arrow outward)
|
|
975
|
+
`<line x1="19" y1="7" x2="28" y2="11" ${BODY}/>`,
|
|
976
|
+
`<polygon points="28,11 21,9 23,15" ${FILL}/>`,
|
|
977
|
+
lineWire(26, -11, 40, -16),
|
|
978
|
+
lineWire(28, 11, 40, 16)
|
|
979
|
+
].join("")
|
|
980
|
+
};
|
|
981
|
+
var darlington_pnp = {
|
|
982
|
+
length: 40,
|
|
983
|
+
netlistPins: ["c", "b", "e"],
|
|
984
|
+
anchors: {
|
|
985
|
+
start: { x: 0, y: 0 },
|
|
986
|
+
end: { x: 40, y: -16 },
|
|
987
|
+
base: { x: 0, y: 0 },
|
|
988
|
+
collector: { x: 40, y: -16 },
|
|
989
|
+
emitter: { x: 40, y: 16 },
|
|
990
|
+
b: { x: 0, y: 0 },
|
|
991
|
+
c: { x: 40, y: -16 },
|
|
992
|
+
e: { x: 40, y: 16 }
|
|
993
|
+
},
|
|
994
|
+
svg: () => [
|
|
995
|
+
`<circle cx="20" cy="0" r="16" fill="white" ${BODY}/>`,
|
|
996
|
+
lineWire(0, 0, 10, 0),
|
|
997
|
+
`<line x1="10" y1="-9" x2="10" y2="9" ${BODY}/>`,
|
|
998
|
+
`<line x1="10" y1="-5" x2="26" y2="-11" ${BODY}/>`,
|
|
999
|
+
`<line x1="10" y1="4" x2="19" y2="7" ${BODY}/>`,
|
|
1000
|
+
`<line x1="19" y1="7" x2="28" y2="11" ${BODY}/>`,
|
|
1001
|
+
// PNP arrow pointing inward (toward base node)
|
|
1002
|
+
`<polygon points="12,5 19,7 14,11" ${FILL}/>`,
|
|
1003
|
+
lineWire(26, -11, 40, -16),
|
|
1004
|
+
lineWire(28, 11, 40, 16)
|
|
1005
|
+
].join("")
|
|
1006
|
+
};
|
|
1007
|
+
var nmos_depletion = {
|
|
1008
|
+
length: 40,
|
|
1009
|
+
netlistPins: ["d", "g", "s"],
|
|
1010
|
+
anchors: {
|
|
1011
|
+
start: { x: 0, y: 0 },
|
|
1012
|
+
end: { x: 40, y: -16 },
|
|
1013
|
+
gate: { x: 0, y: 0 },
|
|
1014
|
+
drain: { x: 40, y: -16 },
|
|
1015
|
+
source: { x: 40, y: 16 },
|
|
1016
|
+
g: { x: 0, y: 0 },
|
|
1017
|
+
d: { x: 40, y: -16 },
|
|
1018
|
+
s: { x: 40, y: 16 }
|
|
1019
|
+
},
|
|
1020
|
+
svg: () => [
|
|
1021
|
+
lineWire(0, 0, 14, 0),
|
|
1022
|
+
`<line x1="14" y1="-12" x2="14" y2="12" ${BODY}/>`,
|
|
1023
|
+
// gate plate
|
|
1024
|
+
// solid channel bar (depletion mode) vs the segmented enhancement bar
|
|
1025
|
+
`<line x1="18" y1="-10" x2="18" y2="10" ${BODY}/>`,
|
|
1026
|
+
`<line x1="18" y1="-8" x2="32" y2="-8" ${BODY}/>`,
|
|
1027
|
+
lineWire(32, -8, 40, -16),
|
|
1028
|
+
`<line x1="18" y1="8" x2="32" y2="8" ${BODY}/>`,
|
|
1029
|
+
lineWire(32, 8, 40, 16),
|
|
1030
|
+
`<polygon points="22,0 18,-4 18,4" ${FILL}/>`
|
|
1031
|
+
].join("")
|
|
1032
|
+
};
|
|
1033
|
+
var igbt = {
|
|
1034
|
+
length: 40,
|
|
1035
|
+
netlistPins: ["c", "g", "e"],
|
|
1036
|
+
anchors: {
|
|
1037
|
+
start: { x: 0, y: 0 },
|
|
1038
|
+
end: { x: 40, y: -16 },
|
|
1039
|
+
gate: { x: 0, y: 0 },
|
|
1040
|
+
collector: { x: 40, y: -16 },
|
|
1041
|
+
emitter: { x: 40, y: 16 },
|
|
1042
|
+
g: { x: 0, y: 0 },
|
|
1043
|
+
c: { x: 40, y: -16 },
|
|
1044
|
+
e: { x: 40, y: 16 }
|
|
1045
|
+
},
|
|
1046
|
+
svg: () => [
|
|
1047
|
+
lineWire(0, 0, 10, 0),
|
|
1048
|
+
`<line x1="10" y1="-12" x2="10" y2="12" ${BODY}/>`,
|
|
1049
|
+
// insulated gate plate
|
|
1050
|
+
`<line x1="14" y1="-10" x2="14" y2="10" ${BODY}/>`,
|
|
1051
|
+
// channel
|
|
1052
|
+
`<line x1="14" y1="-8" x2="32" y2="-8" ${BODY}/>`,
|
|
1053
|
+
lineWire(32, -8, 40, -16),
|
|
1054
|
+
`<line x1="14" y1="8" x2="28" y2="8" ${BODY}/>`,
|
|
1055
|
+
// IGBT emitter arrow (BJT-like, pointing out)
|
|
1056
|
+
`<polygon points="28,8 22,5 23,11" ${FILL}/>`,
|
|
1057
|
+
lineWire(28, 8, 40, 16)
|
|
1058
|
+
].join("")
|
|
1059
|
+
};
|
|
1060
|
+
var scr = {
|
|
1061
|
+
length: 36,
|
|
1062
|
+
netlistPins: ["a", "k", "g"],
|
|
1063
|
+
anchors: {
|
|
1064
|
+
start: { x: 0, y: 0 },
|
|
1065
|
+
end: { x: 36, y: 0 },
|
|
1066
|
+
a: { x: 0, y: 0 },
|
|
1067
|
+
k: { x: 36, y: 0 },
|
|
1068
|
+
g: { x: 30, y: 16 },
|
|
1069
|
+
gate: { x: 30, y: 16 }
|
|
1070
|
+
},
|
|
1071
|
+
svg: () => [
|
|
1072
|
+
lineWire(0, 0, 8, 0),
|
|
1073
|
+
`<polygon points="8,-8 8,8 22,0" ${FILL}/>`,
|
|
1074
|
+
`<line x1="22" y1="-8" x2="22" y2="8" ${BODY}/>`,
|
|
1075
|
+
lineWire(22, 0, 36, 0),
|
|
1076
|
+
// gate lead off the cathode side
|
|
1077
|
+
`<line x1="22" y1="4" x2="30" y2="12" ${BODY}/>`,
|
|
1078
|
+
lineWire(30, 12, 30, 16)
|
|
1079
|
+
].join("")
|
|
1080
|
+
};
|
|
1081
|
+
var triac = {
|
|
1082
|
+
length: 40,
|
|
1083
|
+
netlistPins: ["mt1", "mt2", "g"],
|
|
1084
|
+
anchors: {
|
|
1085
|
+
start: { x: 0, y: 0 },
|
|
1086
|
+
end: { x: 40, y: 0 },
|
|
1087
|
+
mt1: { x: 0, y: 0 },
|
|
1088
|
+
mt2: { x: 40, y: 0 },
|
|
1089
|
+
g: { x: 6, y: 16 },
|
|
1090
|
+
gate: { x: 6, y: 16 }
|
|
1091
|
+
},
|
|
1092
|
+
svg: () => [
|
|
1093
|
+
lineWire(0, 0, 8, 0),
|
|
1094
|
+
// two triangles back-to-back, offset vertically (bidirectional)
|
|
1095
|
+
`<polygon points="8,-9 8,3 22,-3" ${FILL}/>`,
|
|
1096
|
+
`<polygon points="32,-3 32,9 18,3" ${FILL}/>`,
|
|
1097
|
+
`<line x1="8" y1="-9" x2="8" y2="3" ${BODY}/>`,
|
|
1098
|
+
`<line x1="32" y1="-3" x2="32" y2="9" ${BODY}/>`,
|
|
1099
|
+
lineWire(32, 0, 40, 0),
|
|
1100
|
+
// gate lead
|
|
1101
|
+
`<line x1="10" y1="6" x2="6" y2="12" ${BODY}/>`,
|
|
1102
|
+
lineWire(6, 12, 6, 16)
|
|
1103
|
+
].join("")
|
|
1104
|
+
};
|
|
1105
|
+
var diac = {
|
|
1106
|
+
length: 36,
|
|
1107
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 36, y: 0 } },
|
|
1108
|
+
svg: () => [
|
|
1109
|
+
lineWire(0, 0, 6, 0),
|
|
1110
|
+
// two triangles back-to-back, no gate (bidirectional trigger)
|
|
1111
|
+
`<polygon points="6,-9 6,3 20,-3" ${FILL}/>`,
|
|
1112
|
+
`<polygon points="30,-3 30,9 16,3" ${FILL}/>`,
|
|
1113
|
+
`<line x1="6" y1="-9" x2="6" y2="3" ${BODY}/>`,
|
|
1114
|
+
`<line x1="30" y1="-3" x2="30" y2="9" ${BODY}/>`,
|
|
1115
|
+
lineWire(30, 0, 36, 0)
|
|
1116
|
+
].join("")
|
|
1117
|
+
};
|
|
1118
|
+
var phototransistor = {
|
|
1119
|
+
length: 40,
|
|
1120
|
+
netlistPins: ["c", "b", "e"],
|
|
1121
|
+
anchors: {
|
|
1122
|
+
start: { x: 0, y: 0 },
|
|
1123
|
+
end: { x: 40, y: -16 },
|
|
1124
|
+
base: { x: 0, y: 0 },
|
|
1125
|
+
collector: { x: 40, y: -16 },
|
|
1126
|
+
emitter: { x: 40, y: 16 },
|
|
1127
|
+
b: { x: 0, y: 0 },
|
|
1128
|
+
c: { x: 40, y: -16 },
|
|
1129
|
+
e: { x: 40, y: 16 }
|
|
1130
|
+
},
|
|
1131
|
+
svg: () => [
|
|
1132
|
+
`<circle cx="20" cy="0" r="16" fill="white" ${BODY}/>`,
|
|
1133
|
+
`<line x1="14" y1="-10" x2="14" y2="10" ${BODY}/>`,
|
|
1134
|
+
lineWire(0, 0, 14, 0),
|
|
1135
|
+
`<line x1="14" y1="-6" x2="30" y2="-12" ${BODY}/>`,
|
|
1136
|
+
lineWire(30, -12, 40, -16),
|
|
1137
|
+
`<line x1="14" y1="6" x2="30" y2="12" ${BODY}/>`,
|
|
1138
|
+
lineWire(30, 12, 40, 16),
|
|
1139
|
+
`<polygon points="30,12 24,10 26,16" ${FILL}/>`,
|
|
1140
|
+
// inward light arrows striking the base
|
|
1141
|
+
`<path d="M 2,-20 L 9,-13 M 9,-15 L 9,-13 L 7,-13" fill="none" ${BODY}/>`,
|
|
1142
|
+
`<path d="M 7,-22 L 14,-15 M 14,-17 L 14,-15 L 12,-15" fill="none" ${BODY}/>`
|
|
1143
|
+
].join("")
|
|
1144
|
+
};
|
|
1145
|
+
var optocoupler = {
|
|
1146
|
+
length: 56,
|
|
1147
|
+
netlistPins: ["a", "k", "c", "e"],
|
|
1148
|
+
anchors: {
|
|
1149
|
+
start: { x: 0, y: 0 },
|
|
1150
|
+
end: { x: 56, y: 0 },
|
|
1151
|
+
a: { x: 0, y: -12 },
|
|
1152
|
+
k: { x: 0, y: 12 },
|
|
1153
|
+
c: { x: 56, y: -12 },
|
|
1154
|
+
e: { x: 56, y: 12 }
|
|
1155
|
+
},
|
|
1156
|
+
svg: () => [
|
|
1157
|
+
`<rect x="10" y="-22" width="36" height="44" fill="none" class="schematex-circuit-body" stroke-dasharray="4,3"/>`,
|
|
1158
|
+
// LED (left): anode top, cathode bottom — drawn pointing down
|
|
1159
|
+
lineWire(0, -12, 16, -12),
|
|
1160
|
+
lineWire(0, 12, 16, 12),
|
|
1161
|
+
`<polygon points="16,-6 24,-6 20,2" ${FILL}/>`,
|
|
1162
|
+
`<line x1="16" y1="2" x2="24" y2="2" ${BODY}/>`,
|
|
1163
|
+
// isolation light arrows
|
|
1164
|
+
`<path d="M 26,-4 L 32,-4 M 30,-6 L 32,-4 L 30,-2" fill="none" ${BODY}/>`,
|
|
1165
|
+
`<path d="M 26,2 L 32,2 M 30,0 L 32,2 L 30,4" fill="none" ${BODY}/>`,
|
|
1166
|
+
// phototransistor (right)
|
|
1167
|
+
`<line x1="36" y1="-8" x2="36" y2="8" ${BODY}/>`,
|
|
1168
|
+
`<line x1="36" y1="-4" x2="46" y2="-12" ${BODY}/>`,
|
|
1169
|
+
lineWire(46, -12, 56, -12),
|
|
1170
|
+
`<line x1="36" y1="4" x2="46" y2="12" ${BODY}/>`,
|
|
1171
|
+
lineWire(46, 12, 56, 12),
|
|
1172
|
+
`<polygon points="46,12 40,10 42,16" ${FILL}/>`
|
|
1173
|
+
].join("")
|
|
1174
|
+
};
|
|
1175
|
+
var schmitt_buffer = {
|
|
1176
|
+
length: 44,
|
|
1177
|
+
netlistPins: ["in", "out"],
|
|
1178
|
+
anchors: {
|
|
1179
|
+
start: { x: 0, y: 0 },
|
|
1180
|
+
end: { x: 44, y: 0 },
|
|
1181
|
+
in: { x: 0, y: 0 },
|
|
1182
|
+
out: { x: 44, y: 0 }
|
|
1183
|
+
},
|
|
1184
|
+
svg: () => [
|
|
1185
|
+
lineWire(0, 0, 6, 0),
|
|
1186
|
+
`<polygon points="6,-14 6,14 38,0" fill="white" ${BODY}/>`,
|
|
1187
|
+
// hysteresis glyph inside
|
|
1188
|
+
`<path d="M 12,4 L 18,4 L 18,-4 L 24,-4 M 14,-2 L 20,-2 L 20,6 L 26,6" fill="none" ${BODY}/>`,
|
|
1189
|
+
lineWire(38, 0, 44, 0)
|
|
1190
|
+
].join("")
|
|
1191
|
+
};
|
|
1192
|
+
var tri_state_buffer = {
|
|
1193
|
+
length: 44,
|
|
1194
|
+
netlistPins: ["in", "out", "en"],
|
|
1195
|
+
anchors: {
|
|
1196
|
+
start: { x: 0, y: 0 },
|
|
1197
|
+
end: { x: 44, y: 0 },
|
|
1198
|
+
in: { x: 0, y: 0 },
|
|
1199
|
+
out: { x: 44, y: 0 },
|
|
1200
|
+
en: { x: 19, y: -14 },
|
|
1201
|
+
enable: { x: 19, y: -14 }
|
|
1202
|
+
},
|
|
1203
|
+
svg: () => [
|
|
1204
|
+
lineWire(0, 0, 6, 0),
|
|
1205
|
+
`<polygon points="6,-14 6,14 38,0" fill="white" ${BODY}/>`,
|
|
1206
|
+
// enable pin on top
|
|
1207
|
+
`<line x1="19" y1="-7" x2="19" y2="-14" ${BODY}/>`,
|
|
1208
|
+
lineWire(38, 0, 44, 0)
|
|
1209
|
+
].join("")
|
|
1210
|
+
};
|
|
1211
|
+
var instrumentation_amp = {
|
|
1212
|
+
length: 50,
|
|
1213
|
+
netlistPins: ["inp", "inn", "out"],
|
|
1214
|
+
anchors: {
|
|
1215
|
+
start: { x: 0, y: 0 },
|
|
1216
|
+
end: { x: 50, y: 0 },
|
|
1217
|
+
inp: { x: 0, y: -12 },
|
|
1218
|
+
inn: { x: 0, y: 12 },
|
|
1219
|
+
out: { x: 50, y: 0 }
|
|
1220
|
+
},
|
|
1221
|
+
svg: () => [
|
|
1222
|
+
lineWire(0, -12, 4, -12),
|
|
1223
|
+
lineWire(0, 12, 4, 12),
|
|
1224
|
+
`<polygon points="4,-22 4,22 50,0" fill="white" ${BODY}/>`,
|
|
1225
|
+
// double left edge marks the instrumentation (3-opamp) block
|
|
1226
|
+
`<line x1="8" y1="-20" x2="8" y2="20" ${BODY}/>`,
|
|
1227
|
+
`<text x="6" y="-7" class="schematex-circuit-pol">+</text>`,
|
|
1228
|
+
`<text x="6" y="15" class="schematex-circuit-pol">\u2212</text>`,
|
|
1229
|
+
`<text x="18" y="4" class="schematex-circuit-pol">INA</text>`
|
|
1230
|
+
].join("")
|
|
1231
|
+
};
|
|
1232
|
+
var dc_dc_converter = {
|
|
1233
|
+
length: 50,
|
|
1234
|
+
netlistPins: ["vin", "gin", "vout", "gout"],
|
|
1235
|
+
anchors: {
|
|
1236
|
+
start: { x: 0, y: 0 },
|
|
1237
|
+
end: { x: 50, y: 0 },
|
|
1238
|
+
vin: { x: 0, y: -12 },
|
|
1239
|
+
gin: { x: 0, y: 12 },
|
|
1240
|
+
vout: { x: 50, y: -12 },
|
|
1241
|
+
gout: { x: 50, y: 12 }
|
|
1242
|
+
},
|
|
1243
|
+
svg: () => [
|
|
1244
|
+
lineWire(0, -12, 8, -12),
|
|
1245
|
+
lineWire(0, 12, 8, 12),
|
|
1246
|
+
`<rect x="8" y="-20" width="34" height="40" fill="white" ${BODY}/>`,
|
|
1247
|
+
`<line x1="14" y1="14" x2="36" y2="-14" ${BODY}/>`,
|
|
1248
|
+
`<text x="12" y="-8" class="schematex-circuit-pol">DC</text>`,
|
|
1249
|
+
`<text x="24" y="17" class="schematex-circuit-pol">DC</text>`,
|
|
1250
|
+
lineWire(42, -12, 50, -12),
|
|
1251
|
+
lineWire(42, 12, 50, 12)
|
|
1252
|
+
].join("")
|
|
1253
|
+
};
|
|
1254
|
+
var switch_dpdt = {
|
|
1255
|
+
length: 52,
|
|
1256
|
+
netlistPins: ["p1", "nc1", "no1", "p2", "nc2", "no2"],
|
|
1257
|
+
anchors: {
|
|
1258
|
+
start: { x: 0, y: 0 },
|
|
1259
|
+
end: { x: 52, y: 0 },
|
|
1260
|
+
p1: { x: 0, y: -16 },
|
|
1261
|
+
nc1: { x: 52, y: -28 },
|
|
1262
|
+
no1: { x: 52, y: -8 },
|
|
1263
|
+
p2: { x: 0, y: 16 },
|
|
1264
|
+
nc2: { x: 52, y: 4 },
|
|
1265
|
+
no2: { x: 52, y: 24 }
|
|
1266
|
+
},
|
|
1267
|
+
svg: () => [
|
|
1268
|
+
// pole 1 (upper)
|
|
1269
|
+
lineWire(0, -16, 10, -16),
|
|
1270
|
+
`<circle cx="10" cy="-16" r="2" ${FILL}/>`,
|
|
1271
|
+
`<line x1="10" y1="-16" x2="40" y2="-26" ${BODY}/>`,
|
|
1272
|
+
`<circle cx="42" cy="-28" r="2" ${FILL}/>`,
|
|
1273
|
+
lineWire(42, -28, 52, -28),
|
|
1274
|
+
`<circle cx="42" cy="-8" r="2" ${FILL}/>`,
|
|
1275
|
+
lineWire(42, -8, 52, -8),
|
|
1276
|
+
// pole 2 (lower)
|
|
1277
|
+
lineWire(0, 16, 10, 16),
|
|
1278
|
+
`<circle cx="10" cy="16" r="2" ${FILL}/>`,
|
|
1279
|
+
`<line x1="10" y1="16" x2="40" y2="6" ${BODY}/>`,
|
|
1280
|
+
`<circle cx="42" cy="4" r="2" ${FILL}/>`,
|
|
1281
|
+
lineWire(42, 4, 52, 4),
|
|
1282
|
+
`<circle cx="42" cy="24" r="2" ${FILL}/>`,
|
|
1283
|
+
lineWire(42, 24, 52, 24),
|
|
1284
|
+
// ganged actuator (dashed link between the two arms)
|
|
1285
|
+
`<line x1="25" y1="-21" x2="25" y2="11" class="schematex-circuit-body" stroke-dasharray="3,3"/>`
|
|
1286
|
+
].join("")
|
|
1287
|
+
};
|
|
1288
|
+
var oscilloscope = {
|
|
1289
|
+
length: 40,
|
|
1290
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 40, y: 0 } },
|
|
1291
|
+
svg: () => [
|
|
1292
|
+
lineWire(0, 0, 8, 0),
|
|
1293
|
+
`<circle cx="20" cy="0" r="12" fill="white" ${BODY}/>`,
|
|
1294
|
+
// sine trace
|
|
1295
|
+
`<path d="M 12,2 Q 16,-9 20,0 Q 24,9 28,-2" fill="none" ${BODY}/>`,
|
|
1296
|
+
lineWire(32, 0, 40, 0)
|
|
1297
|
+
].join("")
|
|
1298
|
+
};
|
|
1299
|
+
var port = {
|
|
1300
|
+
length: 16,
|
|
1301
|
+
anchors: { start: { x: 0, y: 0 }, end: { x: 16, y: 0 } },
|
|
1302
|
+
svg: () => [
|
|
1303
|
+
lineWire(0, 0, 6, 0),
|
|
1304
|
+
`<circle cx="11" cy="0" r="5" fill="white" ${BODY}/>`
|
|
1305
|
+
].join("")
|
|
1306
|
+
};
|
|
852
1307
|
var SYMBOLS = {
|
|
853
1308
|
resistor,
|
|
854
1309
|
capacitor,
|
|
@@ -911,7 +1366,32 @@ var SYMBOLS = {
|
|
|
911
1366
|
contactor,
|
|
912
1367
|
solenoid_valve,
|
|
913
1368
|
thermal_overload,
|
|
914
|
-
disconnect_switch
|
|
1369
|
+
disconnect_switch,
|
|
1370
|
+
// Previously-missing glyphs (v0.6.7) — passives / diodes / power semis / ICs
|
|
1371
|
+
varistor,
|
|
1372
|
+
fuse_slow,
|
|
1373
|
+
inductor_iron,
|
|
1374
|
+
inductor_ferrite,
|
|
1375
|
+
ferrite_bead,
|
|
1376
|
+
varactor,
|
|
1377
|
+
tvs_diode,
|
|
1378
|
+
bridge_rectifier,
|
|
1379
|
+
darlington_npn,
|
|
1380
|
+
darlington_pnp,
|
|
1381
|
+
nmos_depletion,
|
|
1382
|
+
igbt,
|
|
1383
|
+
scr,
|
|
1384
|
+
triac,
|
|
1385
|
+
diac,
|
|
1386
|
+
phototransistor,
|
|
1387
|
+
optocoupler,
|
|
1388
|
+
schmitt_buffer,
|
|
1389
|
+
tri_state_buffer,
|
|
1390
|
+
instrumentation_amp,
|
|
1391
|
+
dc_dc_converter,
|
|
1392
|
+
switch_dpdt,
|
|
1393
|
+
oscilloscope,
|
|
1394
|
+
port
|
|
915
1395
|
// Lamp reuses buzzer slot? No, needs its own entry but our CircuitComponentType
|
|
916
1396
|
// doesn't have "lamp". We map it via parser alias to "buzzer" or add specifically.
|
|
917
1397
|
};
|
|
@@ -1026,6 +1506,7 @@ function parseNetlist(body, title2) {
|
|
|
1026
1506
|
const netByName = /* @__PURE__ */ new Map();
|
|
1027
1507
|
const pinMap = {};
|
|
1028
1508
|
let autoGnd = 0;
|
|
1509
|
+
const underspecified = [];
|
|
1029
1510
|
const ensureNet = (name) => {
|
|
1030
1511
|
let n = netByName.get(name);
|
|
1031
1512
|
if (!n) {
|
|
@@ -1117,10 +1598,11 @@ function parseNetlist(body, title2) {
|
|
|
1117
1598
|
);
|
|
1118
1599
|
}
|
|
1119
1600
|
if (netRefs.length < pinOrder.length) {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1601
|
+
const got = netRefs.length;
|
|
1602
|
+
for (let k = got; k < pinOrder.length; k++) {
|
|
1603
|
+
netRefs.push(`${id}_nc${k + 1}`);
|
|
1604
|
+
}
|
|
1605
|
+
underspecified.push({ id, type: cType, expected: pinOrder.length, got });
|
|
1124
1606
|
}
|
|
1125
1607
|
const pins = {};
|
|
1126
1608
|
for (let p = 0; p < pinOrder.length; p++) {
|
|
@@ -1166,7 +1648,7 @@ function parseNetlist(body, title2) {
|
|
|
1166
1648
|
}
|
|
1167
1649
|
}
|
|
1168
1650
|
const nets = Array.from(netByName.values());
|
|
1169
|
-
|
|
1651
|
+
const ast = {
|
|
1170
1652
|
type: "circuit",
|
|
1171
1653
|
title: title2,
|
|
1172
1654
|
components,
|
|
@@ -1174,6 +1656,8 @@ function parseNetlist(body, title2) {
|
|
|
1174
1656
|
pinMap,
|
|
1175
1657
|
mode: "netlist"
|
|
1176
1658
|
};
|
|
1659
|
+
if (underspecified.length) ast.recovered = { underspecified };
|
|
1660
|
+
return ast;
|
|
1177
1661
|
}
|
|
1178
1662
|
|
|
1179
1663
|
// src/diagrams/circuit/parser.ts
|
|
@@ -1522,6 +2006,27 @@ function parseCircuit(text2) {
|
|
|
1522
2006
|
};
|
|
1523
2007
|
}
|
|
1524
2008
|
|
|
2009
|
+
// src/diagrams/circuit/lint.ts
|
|
2010
|
+
function lintCircuit(text2) {
|
|
2011
|
+
let ast;
|
|
2012
|
+
try {
|
|
2013
|
+
ast = parseCircuit(text2);
|
|
2014
|
+
} catch {
|
|
2015
|
+
return [];
|
|
2016
|
+
}
|
|
2017
|
+
const out = [];
|
|
2018
|
+
for (const u of ast.recovered?.underspecified ?? []) {
|
|
2019
|
+
out.push({
|
|
2020
|
+
severity: "warning",
|
|
2021
|
+
code: "CIRCUIT_PIN_UNDERSPECIFIED",
|
|
2022
|
+
message: `component ${u.id} (${u.type}) needs ${u.expected} nets but got ${u.got}; the missing terminal(s) were left floating`,
|
|
2023
|
+
hint: `Give ${u.id} all ${u.expected} net connections (e.g. a transformer is \`${u.id} p1 p2 s1 s2 type=transformer\`). Unconnected pins are drawn but not wired.`,
|
|
2024
|
+
fatal: false
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
return out;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
1525
2030
|
// src/diagrams/circuit/layout.ts
|
|
1526
2031
|
function rotationDeg(d) {
|
|
1527
2032
|
return d === "right" ? 0 : d === "down" ? 90 : d === "left" ? 180 : 270;
|
|
@@ -2068,12 +2573,13 @@ var circuit = {
|
|
|
2068
2573
|
return first.startsWith("circuit");
|
|
2069
2574
|
},
|
|
2070
2575
|
parse: parseCircuit,
|
|
2576
|
+
lint: lintCircuit,
|
|
2071
2577
|
render(text2, config) {
|
|
2072
2578
|
const ast = parseCircuit(text2);
|
|
2073
2579
|
return renderCircuit(ast, config);
|
|
2074
2580
|
}
|
|
2075
2581
|
};
|
|
2076
2582
|
|
|
2077
|
-
export { EXTRA_SYMBOLS, SYMBOLS, circuit, layoutCircuit, layoutCircuitNetlist, parseCircuit, parseNetlist, renderCircuit };
|
|
2078
|
-
//# sourceMappingURL=chunk-
|
|
2079
|
-
//# sourceMappingURL=chunk-
|
|
2583
|
+
export { EXTRA_SYMBOLS, SYMBOLS, circuit, layoutCircuit, layoutCircuitNetlist, lintCircuit, parseCircuit, parseNetlist, renderCircuit };
|
|
2584
|
+
//# sourceMappingURL=chunk-WAKRRGAV.js.map
|
|
2585
|
+
//# sourceMappingURL=chunk-WAKRRGAV.js.map
|