schematic-symbols 0.0.28 → 0.0.30

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.js",
4
- "version": "0.0.28",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -0,0 +1,19 @@
1
+ import { defineSymbol } from "drawing/defineSymbol"
2
+ import svgJson from "assets/generated/avalanche_diode.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_bottom" },
11
+ { ...texts.bottom1, anchor: "middle_top" },
12
+ ] as any,
13
+ ports: [
14
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
15
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
16
+ ],
17
+ size: { width: bounds.width, height: bounds.height },
18
+ center: { x: bounds.centerX, y: bounds.centerY },
19
+ })
@@ -0,0 +1,17 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import avalanche_diode_horz from "./avalanche_diode_horz"
3
+
4
+ import type { TextPrimitive } from "drawing"
5
+
6
+ const rotated = rotateSymbol(avalanche_diode_horz)
7
+ const ref = rotated.primitives.find(
8
+ (p) => p.type === "text" && p.text === "{REF}",
9
+ )! as TextPrimitive
10
+ const val = rotated.primitives.find(
11
+ (p) => p.type === "text" && p.text === "{VAL}",
12
+ )! as TextPrimitive
13
+
14
+ ref.anchor = "middle_left"
15
+ val.anchor = "middle_right"
16
+
17
+ export default rotated
@@ -0,0 +1,19 @@
1
+ import { defineSymbol } from "drawing/defineSymbol"
2
+ import svgJson from "assets/generated/zener_diode.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_bottom" },
11
+ { ...texts.bottom1, anchor: "middle_top" },
12
+ ] as any,
13
+ ports: [
14
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
15
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
16
+ ],
17
+ size: { width: bounds.width, height: bounds.height },
18
+ center: { x: bounds.centerX, y: bounds.centerY },
19
+ })
@@ -0,0 +1,17 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import zener_diode_horz from "./zener_diode_horz"
3
+
4
+ import type { TextPrimitive } from "drawing"
5
+
6
+ const rotated = rotateSymbol(zener_diode_horz)
7
+ const ref = rotated.primitives.find(
8
+ (p) => p.type === "text" && p.text === "{REF}",
9
+ )! as TextPrimitive
10
+ const val = rotated.primitives.find(
11
+ (p) => p.type === "text" && p.text === "{VAL}",
12
+ )! as TextPrimitive
13
+
14
+ ref.anchor = "middle_left"
15
+ val.anchor = "middle_right"
16
+
17
+ export default rotated