schematic-symbols 0.0.81 → 0.0.83
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +721 -463
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/light_dependent_resistor_horz.ts +20 -0
- package/symbols/light_dependent_resistor_vert.ts +20 -0
package/package.json
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/light_dependent_resistor.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_left", x: 0 },
|
12
|
+
{ ...texts.bottom1, anchor: "middle_left", x: 0 },
|
13
|
+
] as Primitive[],
|
14
|
+
ports: [
|
15
|
+
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
16
|
+
{ ...refblocks.right1, labels: ["2"] }, // 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 light_dependent_resistor_horz from "./light_dependent_resistor_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(light_dependent_resistor_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
|