schematic-symbols 0.0.104 → 0.0.105

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.js",
4
- "version": "0.0.104",
4
+ "version": "0.0.105",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1,4 +1,34 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import capacitor_horz from "./capacitor_horz"
1
+ import svgJson from "assets/generated/capacitor.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
3
 
4
- export default rotateSymbol(capacitor_horz, "down")
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+ export default modifySymbol({
6
+ primitives: [
7
+ ...Object.values(paths),
8
+ ...Object.values(circles),
9
+ {
10
+ type: "text",
11
+ text: "{REF}",
12
+ x: -0.2,
13
+ y: 0.2094553499999995,
14
+ },
15
+ {
16
+ type: "text",
17
+ text: "{VAL}",
18
+ x: 0.2,
19
+ y: 0.2094553499999995,
20
+ },
21
+ ] as any,
22
+ ports: [
23
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
24
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
25
+ ],
26
+ size: { width: bounds.width, height: bounds.height },
27
+ center: { x: bounds.centerX, y: bounds.centerY },
28
+ })
29
+ .changeTextAnchor("{VAL}", "top_left")
30
+ .rotateRightFacingSymbol("down")
31
+ .labelPort("left1", ["1"])
32
+ .labelPort("right1", ["2"])
33
+ .changeTextAnchor("{REF}", "bottom_left")
34
+ .build()
@@ -1,4 +1,11 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import capacitor_horz from "./capacitor_horz"
1
+ import { isPrimitive } from "drawing/typeguards"
2
+ import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
3
+ import svgJson from "./capacitor_right"
3
4
 
4
- export default rotateSymbol(capacitor_horz, "left")
5
+ export default modifySymbol(svgJson)
6
+ .changeTextAnchor("{VAL}", "middle_top")
7
+ .rotateRightFacingSymbol("left")
8
+ .labelPort("left1", ["1"])
9
+ .labelPort("right1", ["2"])
10
+ .changeTextAnchor("{REF}", "middle_top")
11
+ .build()
@@ -1,10 +1,34 @@
1
- import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
2
- import svgJson from "./capacitor_polarized_right"
1
+ import svgJson from "assets/generated/capacitor_polarized.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
3
 
4
- export default modifySymbol(svgJson)
5
- .changeTextAnchor("{VAL}", "middle_top")
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+ export default modifySymbol({
6
+ primitives: [
7
+ ...Object.values(paths),
8
+ ...Object.values(circles),
9
+ {
10
+ type: "text",
11
+ text: "{REF}",
12
+ x: -0.2,
13
+ y: 0.2094553499999995,
14
+ },
15
+ {
16
+ type: "text",
17
+ text: "{VAL}",
18
+ x: 0.3,
19
+ y: 0.2094553499999995,
20
+ },
21
+ ] as any,
22
+ ports: [
23
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
24
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
25
+ ],
26
+ size: { width: bounds.width, height: bounds.height },
27
+ center: { x: bounds.centerX, y: bounds.centerY },
28
+ })
29
+ .changeTextAnchor("{VAL}", "top_left")
6
30
  .rotateRightFacingSymbol("down")
7
31
  .labelPort("left1", ["1"])
8
32
  .labelPort("right1", ["2"])
9
- .changeTextAnchor("{REF}", "middle_left")
33
+ .changeTextAnchor("{REF}", "bottom_left")
10
34
  .build()
@@ -1,10 +1,34 @@
1
- import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
2
- import svgJson from "./capacitor_polarized_right"
1
+ import svgJson from "assets/generated/capacitor_polarized.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
3
 
4
- export default modifySymbol(svgJson)
5
- .changeTextAnchor("{VAL}", "middle_top")
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+ export default modifySymbol({
6
+ primitives: [
7
+ ...Object.values(paths),
8
+ ...Object.values(circles),
9
+ {
10
+ type: "text",
11
+ text: "{REF}",
12
+ x: 0.1,
13
+ y: -0.2094553499999995,
14
+ },
15
+ {
16
+ type: "text",
17
+ text: "{VAL}",
18
+ x: -0.2,
19
+ y: -0.2094553499999995,
20
+ },
21
+ ] as any,
22
+ ports: [
23
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
24
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
25
+ ],
26
+ size: { width: bounds.width, height: bounds.height },
27
+ center: { x: bounds.centerX, y: bounds.centerY },
28
+ })
29
+ .changeTextAnchor("{VAL}", "top_left")
6
30
  .rotateRightFacingSymbol("up")
7
31
  .labelPort("left1", ["1"])
8
32
  .labelPort("right1", ["2"])
9
- .changeTextAnchor("{REF}", "middle_right")
33
+ .changeTextAnchor("{REF}", "bottom_left")
10
34
  .build()
@@ -1,3 +1,10 @@
1
- import capacitor_horz from "./capacitor_horz"
1
+ import svgJson from "assets/generated/capacitor.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
2
3
 
3
- export default capacitor_horz
4
+ export default modifySymbol(svgJson)
5
+ .rotateRightFacingSymbol("right")
6
+ .changeTextAnchor("{VAL}", "middle_right")
7
+ .labelPort("left1", ["1"])
8
+ .labelPort("right1", ["2"])
9
+ .changeTextAnchor("{REF}", "middle_left")
10
+ .build()
@@ -1,4 +1,34 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import capacitor_horz from "./capacitor_horz"
1
+ import svgJson from "assets/generated/capacitor.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
3
 
4
- export default rotateSymbol(capacitor_horz, "up")
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+ export default modifySymbol({
6
+ primitives: [
7
+ ...Object.values(paths),
8
+ ...Object.values(circles),
9
+ {
10
+ type: "text",
11
+ text: "{REF}",
12
+ x: 0.2,
13
+ y: -0.2094553499999995,
14
+ },
15
+ {
16
+ type: "text",
17
+ text: "{VAL}",
18
+ x: -0.2,
19
+ y: -0.2094553499999995,
20
+ },
21
+ ] as any,
22
+ ports: [
23
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
24
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
25
+ ],
26
+ size: { width: bounds.width, height: bounds.height },
27
+ center: { x: bounds.centerX, y: bounds.centerY },
28
+ })
29
+ .changeTextAnchor("{VAL}", "top_left")
30
+ .rotateRightFacingSymbol("up")
31
+ .labelPort("left1", ["1"])
32
+ .labelPort("right1", ["2"])
33
+ .changeTextAnchor("{REF}", "bottom_left")
34
+ .build()
@@ -1,18 +0,0 @@
1
- import svgJson from "assets/generated/capacitor.json"
2
- import { defineSymbol } from "drawing/defineSymbol"
3
-
4
- const { paths, bounds, refblocks, texts } = svgJson
5
-
6
- export default defineSymbol({
7
- primitives: [
8
- ...Object.values(paths),
9
- { ...texts.top1, anchor: "middle_bottom" },
10
- { ...texts.bottom1, anchor: "middle_top" },
11
- ] as any,
12
- ports: [
13
- { ...refblocks.left1, labels: ["1"] },
14
- { ...refblocks.right1, labels: ["2"] },
15
- ],
16
- size: { width: bounds.width, height: bounds.height }, //{ width: 1, height: 0.24 },
17
- center: { x: bounds.centerX, y: bounds.centerY },
18
- })
@@ -1,4 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import capacitor_horz from "./capacitor_horz"
3
-
4
- export default rotateSymbol(capacitor_horz)