schematic-symbols 0.0.29 → 0.0.31
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/index.d.ts +5 -1
- package/dist/index.js +605 -217
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/avalanche_diode_horz.ts +19 -0
- package/symbols/avalanche_diode_vert.ts +17 -0
- package/symbols/tunnel_diode_horz.ts +19 -0
- package/symbols/tunnel_diode_vert.ts +18 -0
package/package.json
CHANGED
@@ -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/tunnel_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,18 @@
|
|
1
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
+
import tunnel_diode_horz from "./tunnel_diode_horz"
|
3
|
+
|
4
|
+
import type { TextPrimitive } from "drawing"
|
5
|
+
|
6
|
+
const rotated = rotateSymbol(tunnel_diode_horz)
|
7
|
+
|
8
|
+
const ref = rotated.primitives.find(
|
9
|
+
(p) => p.type === "text" && p.text === "{REF}",
|
10
|
+
)! as TextPrimitive
|
11
|
+
const val = rotated.primitives.find(
|
12
|
+
(p) => p.type === "text" && p.text === "{VAL}",
|
13
|
+
)! as TextPrimitive
|
14
|
+
|
15
|
+
ref.anchor = "middle_left"
|
16
|
+
val.anchor = "middle_right"
|
17
|
+
|
18
|
+
export default rotated
|