schematic-symbols 0.0.90 → 0.0.92
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 +1018 -580
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/ground_horz.ts +37 -0
- package/symbols/ground_vert.ts +34 -0
- package/symbols/illuminated_push_button_normally_open_horz.ts +20 -0
- package/symbols/illuminated_push_button_normally_open_vert.ts +20 -0
package/package.json
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/ground.json"
|
3
|
+
import { Primitive } from "drawing/types"
|
4
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
5
|
+
|
6
|
+
// Extract paths, bounds, etc.
|
7
|
+
const { paths, circles, bounds, refblocks } = svgJson
|
8
|
+
|
9
|
+
// Horizontal orientation symbol
|
10
|
+
export const horizontalSymbol = defineSymbol({
|
11
|
+
primitives: [
|
12
|
+
...Object.values(paths),
|
13
|
+
...Object.values(circles),
|
14
|
+
{
|
15
|
+
type: "text",
|
16
|
+
text: "{REF}", // REF label for horizontal
|
17
|
+
x: -0.1, // Adjust this for the horizontal positioning of REF
|
18
|
+
y: -0.8, // Adjust this for the vertical positioning of REF
|
19
|
+
anchor: "middle_bottom", // Horizontal anchor for REF
|
20
|
+
},
|
21
|
+
{
|
22
|
+
type: "text",
|
23
|
+
text: "{VAL}", // VAL label for horizontal
|
24
|
+
x: -0.1, // Adjust for horizontal positioning of VAL
|
25
|
+
y: -0.1, // Adjust for vertical positioning of VAL
|
26
|
+
anchor: "middle_top", // Horizontal anchor for VAL
|
27
|
+
},
|
28
|
+
] as Primitive[],
|
29
|
+
ports: [{ ...refblocks.top1, labels: ["1"] }],
|
30
|
+
size: { width: bounds.width, height: bounds.height },
|
31
|
+
center: { x: bounds.centerX - 0.09, y: bounds.centerY - 0.45 },
|
32
|
+
})
|
33
|
+
|
34
|
+
// Vertical orientation symbol
|
35
|
+
|
36
|
+
// Export vertical symbol (rotated 90 degrees from original)
|
37
|
+
export default horizontalSymbol
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/ground.json"
|
3
|
+
import { Primitive } from "drawing/types"
|
4
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
5
|
+
|
6
|
+
// Extract paths, bounds, etc.
|
7
|
+
const { paths, circles, bounds, refblocks } = svgJson
|
8
|
+
|
9
|
+
export const verticalSymbol = defineSymbol({
|
10
|
+
primitives: [
|
11
|
+
...Object.values(paths),
|
12
|
+
...Object.values(circles),
|
13
|
+
{
|
14
|
+
type: "text",
|
15
|
+
text: "{REF}", // REF label for vertical
|
16
|
+
x: -0.015, // Adjust this for the horizontal positioning of REF
|
17
|
+
y: -0.75, // Adjust this for the vertical positioning of REF
|
18
|
+
anchor: "middle_bottom", // Vertical anchor for REF
|
19
|
+
},
|
20
|
+
{
|
21
|
+
type: "text",
|
22
|
+
text: "{VAL}", // VAL label for vertical
|
23
|
+
x: -0.015, // Adjust for horizontal positioning of VAL
|
24
|
+
y: -0.12, // Adjust for vertical positioning of VAL
|
25
|
+
anchor: "middle_top", // Vertical anchor for VAL
|
26
|
+
},
|
27
|
+
] as Primitive[],
|
28
|
+
ports: [{ ...refblocks.top1, labels: ["1"] }],
|
29
|
+
size: { width: bounds.width, height: bounds.height },
|
30
|
+
center: { x: bounds.centerX, y: bounds.centerY - 0.45 },
|
31
|
+
})
|
32
|
+
|
33
|
+
// Export vertical symbol (rotated 90 degrees from original)
|
34
|
+
export default rotateSymbol(verticalSymbol)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/illuminated_push_button_normally_open.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_right", x: 0, y: -0.4 },
|
12
|
+
{ ...texts.bottom1, anchor: "middle_right", 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 illuminated_push_button_normally_open_horz from "./illuminated_push_button_normally_open_horz"
|
3
|
+
|
4
|
+
const rotatedSymbol = rotateSymbol(illuminated_push_button_normally_open_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
|