schematic-symbols 0.0.61 → 0.0.63
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 +799 -395
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/crystal_horz.ts +33 -0
- package/symbols/crystal_vert.ts +10 -0
- package/symbols/pjfet_transistor_horz.ts +20 -0
- package/symbols/pjfet_transistor_vert.ts +20 -0
package/package.json
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/crystal.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_left" },
|
11
|
+
// { ...texts.bottom1, anchor: "middle_left" },
|
12
|
+
{
|
13
|
+
type: "text",
|
14
|
+
text: "{REF}",
|
15
|
+
x: -0.012864500000000056,
|
16
|
+
y: -0.4150086999999978,
|
17
|
+
anchor: "middle_bottom",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
type: "text",
|
21
|
+
text: "{VAL}",
|
22
|
+
x: -0.003850500000000423,
|
23
|
+
y: 0.4250087000000011,
|
24
|
+
anchor: "middle_top",
|
25
|
+
},
|
26
|
+
] as any,
|
27
|
+
ports: [
|
28
|
+
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
29
|
+
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
30
|
+
],
|
31
|
+
size: { width: bounds.width, height: bounds.height },
|
32
|
+
center: { x: bounds.centerX, y: bounds.centerY },
|
33
|
+
})
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
+
import crystal_horz from "./crystal_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(crystal_horz)
|
5
|
+
const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")
|
6
|
+
const ref = texts.find((t) => t.text === "{REF}")!
|
7
|
+
const val = texts.find((t) => t.text === "{VAL}")!
|
8
|
+
val.x = -0.4
|
9
|
+
ref.x = 0.35
|
10
|
+
export default rotatedSymbol
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/pjfet_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" },
|
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 pjfet_transistor_horz from "./pjfet_transistor_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(pjfet_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
|