schematic-symbols 0.0.79 → 0.0.80
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1074 -590
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/darlington_pair_transistor_horz.ts +21 -0
- package/symbols/darlington_pair_transistor_vert.ts +4 -0
- package/symbols/dpst_switch_horz.ts +22 -0
- package/symbols/dpst_switch_vert.ts +20 -0
package/package.json
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/darlington_pair_transistor.json"
|
3
|
+
import { Primitive } from "drawing/types"
|
4
|
+
|
5
|
+
const { paths, texts, bounds, refblocks, circles } = svgJson
|
6
|
+
|
7
|
+
export default defineSymbol({
|
8
|
+
primitives: [
|
9
|
+
...Object.values(paths),
|
10
|
+
...Object.values(circles),
|
11
|
+
{ ...texts.bottom1, anchor: "middle_top" },
|
12
|
+
{ ...texts.right1, anchor: "middle_bottom" },
|
13
|
+
] as Primitive[],
|
14
|
+
ports: [
|
15
|
+
{ ...refblocks.right1, labels: ["3"] }, // TODO add more "standard" labels
|
16
|
+
{ ...refblocks.right2, labels: ["1"] }, // TODO add more "standard" labels
|
17
|
+
{ ...refblocks.right3, labels: ["2"] }, // TODO add more "standard" labels
|
18
|
+
],
|
19
|
+
size: { width: bounds.width, height: bounds.height },
|
20
|
+
center: { x: bounds.centerX, y: bounds.centerY },
|
21
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/dpst_switch.json"
|
3
|
+
import { Primitive } from "drawing/types"
|
4
|
+
|
5
|
+
const { paths, texts, bounds, refblocks, circles } = svgJson
|
6
|
+
|
7
|
+
export default defineSymbol({
|
8
|
+
primitives: [
|
9
|
+
...Object.values(paths),
|
10
|
+
...Object.values(circles),
|
11
|
+
{ ...texts.top1, anchor: "middle_bottom", x: 0 },
|
12
|
+
{ ...texts.bottom1, anchor: "middle_top", x: 0 },
|
13
|
+
] as Primitive[],
|
14
|
+
ports: [
|
15
|
+
{ ...refblocks.left1, labels: ["1", "left1"] }, // TODO add more "standard" labels
|
16
|
+
{ ...refblocks.left3, labels: ["3", "left3"] }, // TODO add more "standard" labels
|
17
|
+
{ ...refblocks.right1, labels: ["2", "right1"] }, // TODO add more "standard" labels
|
18
|
+
{ ...refblocks.right3, labels: ["4", "right3"] }, // TODO add more "standard" labels
|
19
|
+
],
|
20
|
+
size: { width: bounds.width, height: bounds.height },
|
21
|
+
center: { x: bounds.centerX, y: bounds.centerY },
|
22
|
+
})
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
+
import dpst_switch_horz from "./dpst_switch_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(dpst_switch_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.anchor = "middle_right"
|
11
|
+
val.x = -0.35
|
12
|
+
val.y = 0
|
13
|
+
|
14
|
+
const ref = texts.find((t) => t.text === "{REF}")!
|
15
|
+
|
16
|
+
ref.anchor = "middle_left"
|
17
|
+
ref.x = 0.3
|
18
|
+
ref.y = 0
|
19
|
+
|
20
|
+
export default rotatedSymbol
|