schematic-symbols 0.0.63 → 0.0.65

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.js",
4
- "version": "0.0.63",
4
+ "version": "0.0.65",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -0,0 +1,20 @@
1
+ import { defineSymbol } from "drawing/defineSymbol"
2
+ import svgJson from "assets/generated/njfet_transistor.json"
3
+
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+
6
+ export default defineSymbol({
7
+ primitives: [
8
+ ...Object.values(paths),
9
+ ...Object.values(circles),
10
+ { ...texts.top1, anchor: "middle_right", x: 0 },
11
+ { ...texts.bottom1, anchor: "middle_right", x: 0 },
12
+ ] as any,
13
+ ports: [
14
+ { ...refblocks.top1, labels: ["1", "drain"] }, // TODO add more "standard" labels
15
+ { ...refblocks.bottom1, labels: ["2", "source"] }, // TODO add more "standard" labels
16
+ { ...refblocks.left1, labels: ["3", "gate"] }, // TODO add more "standard" labels
17
+ ],
18
+ size: { width: bounds.width, height: bounds.height },
19
+ center: { x: bounds.centerX, y: bounds.centerY },
20
+ })
@@ -0,0 +1,20 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import njfet_transistor_horz from "./njfet_transistor_horz"
3
+
4
+ const rotatedSymbol = rotateSymbol(njfet_transistor_horz)
5
+
6
+ const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")!
7
+
8
+ const val = texts.find((t) => t.text === "{VAL}")!
9
+
10
+ val.x = -0.35
11
+ val.y = 0
12
+ val.anchor = "middle_right"
13
+
14
+ const ref = texts.find((t) => t.text === "{REF}")!
15
+
16
+ ref.y = 0
17
+ ref.x = 0.35
18
+ ref.anchor = "middle_left"
19
+
20
+ export default rotatedSymbol
@@ -0,0 +1,20 @@
1
+ import { defineSymbol } from "drawing/defineSymbol"
2
+ import svgJson from "assets/generated/p_channel_d_mosfet_transistor.json"
3
+
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+
6
+ export default defineSymbol({
7
+ primitives: [
8
+ ...Object.values(paths),
9
+ ...Object.values(circles),
10
+ { ...texts.top1, anchor: "middle_right", x: 0 },
11
+ { ...texts.bottom1, anchor: "middle_right", x: 0 },
12
+ ] as any,
13
+ ports: [
14
+ { ...refblocks.top1, labels: ["1", "drain"] }, // TODO add more "standard" labels
15
+ { ...refblocks.bottom1, labels: ["2", "source"] }, // TODO add more "standard" labels
16
+ { ...refblocks.left1, labels: ["3", "gate"] }, // TODO add more "standard" labels
17
+ ],
18
+ size: { width: bounds.width, height: bounds.height },
19
+ center: { x: bounds.centerX, y: bounds.centerY },
20
+ })
@@ -0,0 +1,20 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import p_channel_d_mosfet_transistor_horz from "./p_channel_d_mosfet_transistor_horz"
3
+
4
+ const rotatedSymbol = rotateSymbol(p_channel_d_mosfet_transistor_horz)
5
+
6
+ const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")!
7
+
8
+ const val = texts.find((t) => t.text === "{VAL}")!
9
+
10
+ val.x = -0.35
11
+ val.y = 0
12
+ val.anchor = "middle_right"
13
+
14
+ const ref = texts.find((t) => t.text === "{REF}")!
15
+
16
+ ref.y = 0
17
+ ref.x = 0.35
18
+ ref.anchor = "middle_left"
19
+
20
+ export default rotatedSymbol