schematic-symbols 0.0.102 → 0.0.104

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/dist/index.js +1588 -2108
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/symbols/SPDT_switch_horz.ts +1 -0
  5. package/symbols/SPST_switch_horz.ts +10 -18
  6. package/symbols/constant_current_diode_horz.ts +7 -17
  7. package/symbols/constant_current_diode_vert.ts +9 -18
  8. package/symbols/crystal_horz.ts +7 -31
  9. package/symbols/crystal_vert.ts +9 -9
  10. package/symbols/darlington_pair_transistor_horz.ts +8 -19
  11. package/symbols/darlington_pair_transistor_vert.ts +11 -3
  12. package/symbols/dc_ammeter_horz.ts +3 -3
  13. package/symbols/dc_voltmeter_horz.ts +2 -2
  14. package/symbols/diac_horz.ts +7 -17
  15. package/symbols/diac_vert.ts +0 -1
  16. package/symbols/diode_right.ts +0 -1
  17. package/symbols/dpst_switch_horz.ts +1 -0
  18. package/symbols/filled_diode_horz.ts +7 -30
  19. package/symbols/frequency_meter_horz.ts +3 -3
  20. package/symbols/ground_vert.ts +0 -3
  21. package/symbols/gunn_diode_horz.ts +7 -21
  22. package/symbols/gunn_diode_vert.ts +10 -11
  23. package/symbols/igbt_transistor_horz.ts +8 -31
  24. package/symbols/illuminated_push_button_normally_open_horz.ts +7 -18
  25. package/symbols/laser_diode_horz.ts +8 -17
  26. package/symbols/npn_bipolar_transistor_horz.ts +8 -29
  27. package/symbols/npn_bipolar_transistor_vert.ts +10 -1
  28. package/symbols/photodiode_horz.ts +7 -30
  29. package/symbols/pnp_bipolar_transistor_horz.ts +8 -31
  30. package/symbols/pnp_bipolar_transistor_vert.ts +10 -2
  31. package/symbols/power_factor_meter_horz.ts +4 -4
  32. package/symbols/power_factor_meter_vert.ts +5 -2
  33. package/symbols/push_button_normally_closed_momentary_horz.ts +6 -4
  34. package/symbols/push_button_normally_closed_momentary_vert.ts +1 -20
  35. package/symbols/push_button_normally_open_momentary_horz.ts +6 -4
  36. package/symbols/push_button_normally_open_momentary_vert.ts +1 -20
  37. package/symbols/schottky_diode_horz.ts +2 -2
  38. package/symbols/silicon_controlled_rectifier_horz.ts +8 -16
  39. package/symbols/step_recovery_diode_horz.ts +7 -29
  40. package/symbols/tachometer_horz.ts +3 -3
  41. package/symbols/triac_horz.ts +8 -16
  42. package/symbols/var_meter_horz.ts +3 -3
  43. package/symbols/varmeter_horz.ts +3 -3
  44. package/symbols/volt_meter_horz.ts +7 -28
  45. package/symbols/watt_hour_meter_horz.ts +3 -3
  46. package/symbols/wattmeter_horz.ts +3 -3
@@ -1,33 +1,10 @@
1
1
  import svgJson from "assets/generated/pnp_bipolar_transistor.json"
2
- import { defineSymbol } from "drawing/defineSymbol"
3
- import { Primitive } from "drawing/types"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
4
3
 
5
- const { paths, texts, bounds, refblocks, circles } = svgJson
6
-
7
- export default defineSymbol({
8
- primitives: [
9
- ...Object.values(paths),
10
- ...Object.values(circles),
11
- {
12
- type: "text",
13
- text: "{REF}",
14
- x: -0.07,
15
- y: -0.3596647999999991,
16
- anchor: "middle_right",
17
- },
18
- {
19
- type: "text",
20
- text: "{VAL}",
21
- x: -0.0679100444999996,
22
- y: 0.4129789000000006,
23
- anchor: "middle_right",
24
- },
25
- ] as Primitive[],
26
- ports: [
27
- { ...refblocks.top1, labels: ["1", "collector"] },
28
- { ...refblocks.bottom1, labels: ["2", "emitter"] },
29
- { ...refblocks.left1, labels: ["3", "base"] },
30
- ],
31
- size: { width: bounds.width, height: bounds.height },
32
- center: { x: bounds.centerX, y: bounds.centerY },
33
- })
4
+ export default modifySymbol(svgJson)
5
+ .changeTextAnchor("{VAL}", "middle_right")
6
+ .labelPort("left1", ["3"])
7
+ .labelPort("bottom1", ["2"])
8
+ .labelPort("top1", ["1"])
9
+ .changeTextAnchor("{REF}", "middle_right")
10
+ .build()
@@ -1,5 +1,7 @@
1
1
  import { rotateSymbol } from "drawing/rotateSymbol"
2
2
  import pnp_bipolar_transistor_horz from "./pnp_bipolar_transistor_horz"
3
+ import svgJson from "assets/generated/pnp_bipolar_transistor.json"
4
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
5
 
4
6
  const rotatedSymbol = rotateSymbol(pnp_bipolar_transistor_horz)
5
7
 
@@ -8,5 +10,11 @@ const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")
8
10
  const ref = texts.find((t) => t.text === "{REF}")!
9
11
 
10
12
  ref.anchor = "middle_left"
11
-
12
- export default rotatedSymbol
13
+ export default modifySymbol(svgJson)
14
+ .rotateRightFacingSymbol("down")
15
+ .changeTextAnchor("{VAL}", "middle_right")
16
+ .labelPort("left1", ["3"])
17
+ .labelPort("bottom1", ["2"])
18
+ .labelPort("top1", ["1"])
19
+ .changeTextAnchor("{REF}", "middle_left")
20
+ .build()
@@ -14,7 +14,7 @@ export default defineSymbol({
14
14
  text: "{REF}",
15
15
  x: -0.15,
16
16
  y: -0.42330070000000064,
17
- anchor: "middle_left",
17
+ anchor: "middle_top",
18
18
  },
19
19
  // { ...texts.bottom1, anchor: "middle_left" },
20
20
  {
@@ -22,15 +22,15 @@ export default defineSymbol({
22
22
  text: "{VAL}",
23
23
  x: -0.15,
24
24
  y: 0.42330070000000064,
25
- anchor: "middle_left",
25
+ anchor: "middle_bottom",
26
26
  },
27
27
  // { ...texts.left1, anchor: "middle_left" },
28
28
  {
29
29
  type: "text",
30
30
  text: "COS φ",
31
- x: -0.14,
31
+ x: 0,
32
32
  y: 0.014279000000000375,
33
- anchor: "middle-left",
33
+ anchor: "center",
34
34
  },
35
35
  ] as any,
36
36
  ports: [
@@ -9,8 +9,11 @@ const val = texts.find((t) => t.text === "{VAL}")!
9
9
  const text_cos = texts.find((t) => t.text === "COS φ")!
10
10
  ref.x = 0.35
11
11
  ref.y = 0
12
- val.x = -0.6
12
+ ref.anchor = "middle_left"
13
+ val.anchor = "middle_right"
14
+ val.x = -0.35
13
15
  val.y = 0
14
- text_cos.x = -0.1
16
+ text_cos.x = 0
15
17
  text_cos.y = 0
18
+ text_cos.anchor = "center"
16
19
  export default rotatedSymbol
@@ -1,14 +1,16 @@
1
1
  import { defineSymbol } from "drawing/defineSymbol"
2
2
  import svgJson from "assets/generated/push_button_normally_closed_momentary.json"
3
+ import { Primitive } from "drawing/types"
3
4
 
4
- const { paths, texts, bounds, refblocks } = svgJson
5
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
6
 
6
7
  export default defineSymbol({
7
8
  primitives: [
8
9
  ...Object.values(paths),
9
- { ...texts.top1, anchor: "middle_bottom" },
10
- { ...texts.bottom1, anchor: "middle_top" },
11
- ] as any,
10
+ ...Object.values(circles),
11
+ { ...texts.top1, anchor: "middle_left" },
12
+ { ...texts.bottom1, anchor: "middle_left" },
13
+ ] as Primitive[],
12
14
  ports: [
13
15
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
14
16
  { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
@@ -1,23 +1,4 @@
1
1
  import { rotateSymbol } from "drawing/rotateSymbol"
2
2
  import push_button_normally_closed_momentary_horz from "./push_button_normally_closed_momentary_horz"
3
- import type { TextPrimitive } from "drawing"
4
3
 
5
- const rotated = rotateSymbol(push_button_normally_closed_momentary_horz)
6
-
7
- const ref = rotated.primitives.find(
8
- (p) => p.type === "text" && p.text === "{REF}",
9
- )! as TextPrimitive
10
- const val = rotated.primitives.find(
11
- (p) => p.type === "text" && p.text === "{VAL}",
12
- )! as TextPrimitive
13
-
14
- ref.anchor = "middle_left"
15
- val.anchor = "middle_right"
16
-
17
- ref.x = ref.x - 0.03
18
- ref.y = ref.y
19
-
20
- val.x = val.x
21
- val.y = 0
22
-
23
- export default rotated
4
+ export default rotateSymbol(push_button_normally_closed_momentary_horz, "up")
@@ -1,14 +1,16 @@
1
1
  import { defineSymbol } from "drawing/defineSymbol"
2
2
  import svgJson from "assets/generated/push_button_normally_open_momentary.json"
3
+ import { Primitive } from "drawing/types"
3
4
 
4
- const { paths, texts, bounds, refblocks } = svgJson
5
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
6
 
6
7
  export default defineSymbol({
7
8
  primitives: [
8
9
  ...Object.values(paths),
9
- { ...texts.top1, anchor: "middle_bottom" },
10
- { ...texts.bottom1, anchor: "middle_top" },
11
- ] as any,
10
+ ...Object.values(circles),
11
+ { ...texts.top1, anchor: "middle_left" },
12
+ { ...texts.bottom1, anchor: "middle_left" },
13
+ ] as Primitive[],
12
14
  ports: [
13
15
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
14
16
  { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
@@ -1,23 +1,4 @@
1
1
  import { rotateSymbol } from "drawing/rotateSymbol"
2
2
  import push_button_normally_open_momentary_horz from "./push_button_normally_open_momentary_horz"
3
- import type { TextPrimitive } from "drawing"
4
3
 
5
- const rotated = rotateSymbol(push_button_normally_open_momentary_horz)
6
-
7
- const ref = rotated.primitives.find(
8
- (p) => p.type === "text" && p.text === "{REF}",
9
- )! as TextPrimitive
10
- const val = rotated.primitives.find(
11
- (p) => p.type === "text" && p.text === "{VAL}",
12
- )! as TextPrimitive
13
-
14
- ref.anchor = "middle_left"
15
- val.anchor = "middle_right"
16
-
17
- ref.x = ref.x + 0.1
18
- ref.y = ref.y
19
-
20
- val.x = val.x
21
- val.y = 0
22
-
23
- export default rotated
4
+ export default rotateSymbol(push_button_normally_open_momentary_horz, "up")
@@ -5,6 +5,6 @@ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
5
5
  export default modifySymbol(svgJson)
6
6
  .labelPort("left1", ["1", "pos"])
7
7
  .labelPort("right1", ["2", "neg"])
8
- .changeTextAnchor("{VAL}", "middle_bottom")
9
- .changeTextAnchor("{REF}", "middle_top")
8
+ .changeTextAnchor("{VAL}", "middle_top")
9
+ .changeTextAnchor("{REF}", "middle_bottom")
10
10
  .build()
@@ -1,21 +1,13 @@
1
1
  import { defineSymbol } from "drawing/defineSymbol"
2
2
  import svgJson from "assets/generated/silicon_controlled_rectifier.json"
3
3
  import { TextPrimitive } from "drawing/types"
4
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
4
5
 
5
6
  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" },
12
- { ...texts.bottom1, anchor: "middle_top" },
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
- })
7
+ export default modifySymbol(svgJson)
8
+ .changeTextAnchor("{VAL}", "middle_top")
9
+ .labelPort("left1", ["1"])
10
+ .labelPort("right1", ["2"])
11
+ .labelPort("bottom1", ["3"])
12
+ .changeTextAnchor("{REF}", "middle_bottom")
13
+ .build()
@@ -1,33 +1,11 @@
1
1
  import { defineSymbol } from "drawing/defineSymbol"
2
2
  import svgJson from "assets/generated/step_recovery_diode.json"
3
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
4
 
4
5
  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.0050250999999996715,
16
- y: -0.26884529999999884,
17
- anchor: "middle_bottom",
18
- },
19
- {
20
- type: "text",
21
- text: "{VAL}",
22
- x: -0.00011179999999999524,
23
- y: 0.2788453000000004,
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
- })
6
+ export default modifySymbol(svgJson)
7
+ .changeTextAnchor("{VAL}", "middle_top")
8
+ .labelPort("left1", ["1"])
9
+ .labelPort("right1", ["2"])
10
+ .changeTextAnchor("{REF}", "middle_bottom")
11
+ .build()
@@ -12,16 +12,16 @@ export default defineSymbol({
12
12
  text: "{REF}",
13
13
  x: 0,
14
14
  y: -0.3594553499999995,
15
- anchor: "middle_bottom",
15
+ anchor: "middle_top",
16
16
  },
17
17
  {
18
18
  type: "text",
19
19
  text: "{VAL}",
20
20
  x: 0,
21
21
  y: 0.35,
22
- anchor: "middle_top",
22
+ anchor: "middle_bottom",
23
23
  },
24
- { ...texts.left1, anchor: "center", fontSize: 0.2 },
24
+ { ...texts.left1, y: 0.01, anchor: "center", fontSize: 0.2 },
25
25
  ] as any,
26
26
  ports: [
27
27
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
@@ -1,21 +1,13 @@
1
1
  import { defineSymbol } from "drawing/defineSymbol"
2
2
  import svgJson from "assets/generated/triac.json"
3
3
  import { TextPrimitive } from "drawing/types"
4
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
4
5
 
5
6
  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
- })
7
+ export default modifySymbol(svgJson)
8
+ .changeTextAnchor("{VAL}", "middle_top")
9
+ .labelPort("left1", ["1"])
10
+ .labelPort("right1", ["2"])
11
+ .labelPort("bottom1", ["3"])
12
+ .changeTextAnchor("{REF}", "middle_bottom")
13
+ .build()
@@ -11,15 +11,15 @@ export default defineSymbol({
11
11
  ...texts.top1,
12
12
  x: 0,
13
13
  y: -0.3594553499999995,
14
- anchor: "middle_bottom",
14
+ anchor: "middle_top",
15
15
  },
16
16
  {
17
17
  ...texts.bottom1,
18
18
  x: 0,
19
19
  y: 0.35,
20
- anchor: "middle_top",
20
+ anchor: "middle_bottom",
21
21
  },
22
- { ...texts.left1, x: -0.02, y: -0.02, fontSize: 0.2, anchor: "center" },
22
+ { ...texts.left1, x: -0.02, y: 0.01, fontSize: 0.2, anchor: "center" },
23
23
  ] as any,
24
24
  ports: [
25
25
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
@@ -12,16 +12,16 @@ export default defineSymbol({
12
12
  text: "{REF}",
13
13
  x: 0,
14
14
  y: -0.3594553499999995,
15
- anchor: "middle_bottom",
15
+ anchor: "middle_top",
16
16
  },
17
17
  {
18
18
  type: "text",
19
19
  text: "{VAL}",
20
20
  x: 0,
21
21
  y: 0.35,
22
- anchor: "middle_top",
22
+ anchor: "middle_bottom",
23
23
  },
24
- { ...texts.left1, anchor: "center", fontSize: 0.2 },
24
+ { ...texts.left1, anchor: "center", y: 0.02, fontSize: 0.2 },
25
25
  ] as any,
26
26
  ports: [
27
27
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
@@ -1,31 +1,10 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
1
  import svgJson from "assets/generated/volt_meter.json"
2
+ import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
3
 
4
4
  const { paths, texts, bounds, circles, refblocks } = svgJson
5
-
6
- export default defineSymbol({
7
- primitives: [
8
- ...Object.values(paths),
9
- ...Object.values(circles),
10
- {
11
- type: "text",
12
- text: "{REF}",
13
- x: 0,
14
- y: -0.3594553499999995,
15
- anchor: "middle_bottom",
16
- },
17
- {
18
- type: "text",
19
- text: "{VAL}",
20
- x: 0,
21
- y: 0.35,
22
- anchor: "middle_top",
23
- },
24
- ] as any,
25
- ports: [
26
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
27
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
28
- ],
29
- size: { width: bounds.width, height: bounds.height },
30
- center: { x: bounds.centerX, y: bounds.centerY },
31
- })
5
+ export default modifySymbol(svgJson)
6
+ .changeTextAnchor("{VAL}", "middle_top")
7
+ .labelPort("left1", ["1"])
8
+ .labelPort("right1", ["2"])
9
+ .changeTextAnchor("{REF}", "middle_bottom")
10
+ .build()
@@ -12,16 +12,16 @@ export default defineSymbol({
12
12
  text: "{REF}",
13
13
  x: 0,
14
14
  y: -0.3594553499999995,
15
- anchor: "middle_bottom",
15
+ anchor: "middle_top",
16
16
  },
17
17
  {
18
18
  type: "text",
19
19
  text: "{VAL}",
20
20
  x: 0,
21
21
  y: 0.35,
22
- anchor: "middle_top",
22
+ anchor: "middle_bottom",
23
23
  },
24
- { ...texts.left1, anchor: "center", fontSize: 0.2 },
24
+ { ...texts.left1, anchor: "center", y: 0.01, fontSize: 0.2 },
25
25
  ] as any,
26
26
  ports: [
27
27
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
@@ -12,16 +12,16 @@ export default defineSymbol({
12
12
  text: "{REF}",
13
13
  x: 0,
14
14
  y: -0.3594553499999995,
15
- anchor: "middle_bottom",
15
+ anchor: "middle_top",
16
16
  },
17
17
  {
18
18
  type: "text",
19
19
  text: "{VAL}",
20
20
  x: 0,
21
21
  y: 0.35,
22
- anchor: "middle_top",
22
+ anchor: "middle_bottom",
23
23
  },
24
- { ...texts.left1, anchor: "center", fontSize: 0.3 },
24
+ { ...texts.left1, anchor: "center", y: 0.01, fontSize: 0.3 },
25
25
  ] as any,
26
26
  ports: [
27
27
  { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels