schematic-symbols 0.0.45 → 0.0.47
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 +399 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/triac_horz.ts +21 -0
- package/symbols/triac_vert.ts +16 -0
- package/symbols/var_meter_horz.ts +30 -0
- package/symbols/var_meter_vert.ts +4 -0
package/package.json
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/triac.json"
|
3
|
+
import { TextPrimitive } 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" } as TextPrimitive,
|
12
|
+
{ ...texts.bottom1, anchor: "middle_top" } as TextPrimitive,
|
13
|
+
] as any,
|
14
|
+
ports: [
|
15
|
+
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
16
|
+
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
17
|
+
{ ...refblocks.bottom1, labels: ["3"] }, // 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,16 @@
|
|
1
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
+
import triac_horz from "./triac_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(triac_horz)
|
5
|
+
|
6
|
+
const texts = rotatedSymbol.primitives.filter(
|
7
|
+
(primitive) => primitive.type === "text",
|
8
|
+
)
|
9
|
+
|
10
|
+
const ref = texts.find((text) => text.text === "{REF}")!
|
11
|
+
const val = texts.find((text) => text.text === "{VAL}")!
|
12
|
+
|
13
|
+
ref.y = 0
|
14
|
+
val.y = 0
|
15
|
+
|
16
|
+
export default rotatedSymbol
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/var_meter.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
|
+
{
|
11
|
+
...texts.top1,
|
12
|
+
x: 0,
|
13
|
+
y: -0.3594553499999995,
|
14
|
+
anchor: "middle_bottom",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
...texts.bottom1,
|
18
|
+
x: 0,
|
19
|
+
y: 0.35,
|
20
|
+
anchor: "middle_top",
|
21
|
+
},
|
22
|
+
{ ...texts.left1, x: -0.02, y: -0.02, fontSize: 0.2, anchor: "center" },
|
23
|
+
] as any,
|
24
|
+
ports: [
|
25
|
+
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
26
|
+
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
27
|
+
],
|
28
|
+
size: { width: bounds.width, height: bounds.height },
|
29
|
+
center: { x: bounds.centerX, y: bounds.centerY },
|
30
|
+
})
|