schematic-symbols 0.0.121 → 0.0.123

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.
Files changed (197) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +2 -5
  4. package/drawing/arc.ts +0 -31
  5. package/drawing/arrow.ts +0 -41
  6. package/drawing/box.ts +0 -5
  7. package/drawing/circle.ts +0 -7
  8. package/drawing/cubicBezierCurveArc.ts +0 -28
  9. package/drawing/defineSymbol.ts +0 -16
  10. package/drawing/getSvg.ts +0 -199
  11. package/drawing/index.ts +0 -10
  12. package/drawing/mapColor.ts +0 -10
  13. package/drawing/modify-symbol/modify-symbol.ts +0 -97
  14. package/drawing/ninePointAnchorToSvgAnchor.ts +0 -11
  15. package/drawing/path.ts +0 -5
  16. package/drawing/pathToSvgD.ts +0 -22
  17. package/drawing/resizeSymbol.ts +0 -67
  18. package/drawing/rotateSymbol.ts +0 -324
  19. package/drawing/svgPathToPoints.ts +0 -109
  20. package/drawing/text.ts +0 -8
  21. package/drawing/typeguards.ts +0 -155
  22. package/drawing/types.ts +0 -93
  23. package/drawing/utils/getBoundsOfPrimitives.ts +0 -51
  24. package/drawing/utils/makeYUpPositive.ts +0 -46
  25. package/index.ts +0 -24
  26. package/symbols/SPDT_switch_horz.ts +0 -22
  27. package/symbols/SPDT_switch_vert.ts +0 -20
  28. package/symbols/SPST_switch_horz.ts +0 -12
  29. package/symbols/SPST_switch_vert.ts +0 -20
  30. package/symbols/ac_voltmeter_horz.ts +0 -31
  31. package/symbols/ac_voltmeter_vert.ts +0 -8
  32. package/symbols/avalanche_diode_horz.ts +0 -19
  33. package/symbols/avalanche_diode_vert.ts +0 -10
  34. package/symbols/battery_horz.ts +0 -20
  35. package/symbols/battery_vert.ts +0 -6
  36. package/symbols/boxresistor_down.ts +0 -33
  37. package/symbols/boxresistor_left.ts +0 -33
  38. package/symbols/boxresistor_right.ts +0 -33
  39. package/symbols/boxresistor_up.ts +0 -33
  40. package/symbols/capacitor_down.ts +0 -34
  41. package/symbols/capacitor_left.ts +0 -11
  42. package/symbols/capacitor_polarized_down.ts +0 -34
  43. package/symbols/capacitor_polarized_left.ts +0 -10
  44. package/symbols/capacitor_polarized_right.ts +0 -10
  45. package/symbols/capacitor_polarized_up.ts +0 -34
  46. package/symbols/capacitor_right.ts +0 -10
  47. package/symbols/capacitor_up.ts +0 -34
  48. package/symbols/constant_current_diode_horz.ts +0 -9
  49. package/symbols/constant_current_diode_vert.ts +0 -11
  50. package/symbols/crystal_4pin_horz.ts +0 -11
  51. package/symbols/crystal_4pin_vert.ts +0 -10
  52. package/symbols/crystal_horz.ts +0 -9
  53. package/symbols/crystal_vert.ts +0 -10
  54. package/symbols/darlington_pair_transistor_horz.ts +0 -10
  55. package/symbols/darlington_pair_transistor_vert.ts +0 -12
  56. package/symbols/dc_ammeter_horz.ts +0 -32
  57. package/symbols/dc_ammeter_vert.ts +0 -51
  58. package/symbols/dc_voltmeter_horz.ts +0 -31
  59. package/symbols/dc_voltmeter_vert.ts +0 -19
  60. package/symbols/diac_horz.ts +0 -9
  61. package/symbols/diac_vert.ts +0 -16
  62. package/symbols/diode_down.ts +0 -4
  63. package/symbols/diode_left.ts +0 -4
  64. package/symbols/diode_right.ts +0 -9
  65. package/symbols/diode_up.ts +0 -4
  66. package/symbols/dpdt_normally_closed_switch_down.ts +0 -22
  67. package/symbols/dpdt_normally_closed_switch_left.ts +0 -23
  68. package/symbols/dpdt_normally_closed_switch_right.ts +0 -13
  69. package/symbols/dpdt_normally_closed_switch_up.ts +0 -22
  70. package/symbols/dpdt_switch_down.ts +0 -22
  71. package/symbols/dpdt_switch_left.ts +0 -23
  72. package/symbols/dpdt_switch_right.ts +0 -13
  73. package/symbols/dpdt_switch_up.ts +0 -22
  74. package/symbols/dpst_normally_closed_switch_down.ts +0 -22
  75. package/symbols/dpst_normally_closed_switch_left.ts +0 -23
  76. package/symbols/dpst_normally_closed_switch_right.ts +0 -11
  77. package/symbols/dpst_normally_closed_switch_up.ts +0 -22
  78. package/symbols/dpst_switch_down.ts +0 -21
  79. package/symbols/dpst_switch_left.ts +0 -23
  80. package/symbols/dpst_switch_right.ts +0 -11
  81. package/symbols/dpst_switch_up.ts +0 -22
  82. package/symbols/filled_diode_horz.ts +0 -9
  83. package/symbols/filled_diode_vert.ts +0 -4
  84. package/symbols/frequency_meter_horz.ts +0 -32
  85. package/symbols/frequency_meter_vert.ts +0 -19
  86. package/symbols/fuse_horz.ts +0 -24
  87. package/symbols/fuse_vert.ts +0 -4
  88. package/symbols/ground_horz.ts +0 -37
  89. package/symbols/ground_vert.ts +0 -4
  90. package/symbols/gunn_diode_horz.ts +0 -11
  91. package/symbols/gunn_diode_vert.ts +0 -11
  92. package/symbols/icled_down.ts +0 -4
  93. package/symbols/icled_left.ts +0 -4
  94. package/symbols/icled_right.ts +0 -11
  95. package/symbols/icled_up.ts +0 -27
  96. package/symbols/igbt_transistor_horz.ts +0 -10
  97. package/symbols/igbt_transistor_vert.ts +0 -21
  98. package/symbols/illuminated_push_button_normally_open_horz.ts +0 -9
  99. package/symbols/illuminated_push_button_normally_open_vert.ts +0 -20
  100. package/symbols/inductor_down.ts +0 -4
  101. package/symbols/inductor_left.ts +0 -4
  102. package/symbols/inductor_right.ts +0 -20
  103. package/symbols/inductor_up.ts +0 -4
  104. package/symbols/laser_diode_horz.ts +0 -10
  105. package/symbols/laser_diode_vert.ts +0 -13
  106. package/symbols/led_down.ts +0 -4
  107. package/symbols/led_left.ts +0 -4
  108. package/symbols/led_right.ts +0 -20
  109. package/symbols/led_up.ts +0 -27
  110. package/symbols/light_dependent_resistor_horz.ts +0 -20
  111. package/symbols/light_dependent_resistor_vert.ts +0 -20
  112. package/symbols/mosfet_depletion_normally_on_horz.ts +0 -19
  113. package/symbols/mosfet_depletion_normally_on_vert.ts +0 -21
  114. package/symbols/mushroom_head_normally_open_momentary_horz.ts +0 -20
  115. package/symbols/mushroom_head_normally_open_momentary_vert.ts +0 -23
  116. package/symbols/n_channel_d_mosfet_transistor_horz.ts +0 -20
  117. package/symbols/n_channel_d_mosfet_transistor_vert.ts +0 -20
  118. package/symbols/n_channel_e_mosfet_transistor_horz.ts +0 -21
  119. package/symbols/n_channel_e_mosfet_transistor_vert.ts +0 -20
  120. package/symbols/njfet_transistor_horz.ts +0 -20
  121. package/symbols/njfet_transistor_vert.ts +0 -20
  122. package/symbols/npn_bipolar_transistor_horz.ts +0 -11
  123. package/symbols/npn_bipolar_transistor_vert.ts +0 -21
  124. package/symbols/opamp_no_power_down.ts +0 -4
  125. package/symbols/opamp_no_power_left.ts +0 -4
  126. package/symbols/opamp_no_power_right.ts +0 -10
  127. package/symbols/opamp_no_power_up.ts +0 -4
  128. package/symbols/opamp_with_power_down.ts +0 -4
  129. package/symbols/opamp_with_power_left.ts +0 -4
  130. package/symbols/opamp_with_power_right.ts +0 -12
  131. package/symbols/opamp_with_power_up.ts +0 -4
  132. package/symbols/p_channel_d_mosfet_transistor_horz.ts +0 -20
  133. package/symbols/p_channel_d_mosfet_transistor_vert.ts +0 -20
  134. package/symbols/p_channel_e_mosfet_transistor_horz.ts +0 -20
  135. package/symbols/p_channel_e_mosfet_transistor_vert.ts +0 -20
  136. package/symbols/photodiode_horz.ts +0 -9
  137. package/symbols/photodiode_vert.ts +0 -13
  138. package/symbols/pjfet_transistor_horz.ts +0 -20
  139. package/symbols/pjfet_transistor_vert.ts +0 -20
  140. package/symbols/pnp_bipolar_transistor_horz.ts +0 -10
  141. package/symbols/pnp_bipolar_transistor_vert.ts +0 -20
  142. package/symbols/potentiometer2_horz.ts +0 -18
  143. package/symbols/potentiometer2_vert.ts +0 -14
  144. package/symbols/potentiometer3_down.ts +0 -4
  145. package/symbols/potentiometer3_left.ts +0 -4
  146. package/symbols/potentiometer3_right.ts +0 -10
  147. package/symbols/potentiometer3_up.ts +0 -4
  148. package/symbols/potentiometer_horz.ts +0 -18
  149. package/symbols/potentiometer_vert.ts +0 -6
  150. package/symbols/power_factor_meter_horz.ts +0 -42
  151. package/symbols/power_factor_meter_vert.ts +0 -19
  152. package/symbols/push_button_normally_closed_momentary_horz.ts +0 -20
  153. package/symbols/push_button_normally_closed_momentary_vert.ts +0 -4
  154. package/symbols/push_button_normally_open_momentary_horz.ts +0 -20
  155. package/symbols/push_button_normally_open_momentary_vert.ts +0 -4
  156. package/symbols/rectifier_diode_horz.ts +0 -21
  157. package/symbols/rectifier_diode_vert.ts +0 -17
  158. package/symbols/resonator_horz.ts +0 -34
  159. package/symbols/resonator_vert.ts +0 -4
  160. package/symbols/schottky_diode_horz.ts +0 -10
  161. package/symbols/schottky_diode_vert.ts +0 -18
  162. package/symbols/silicon_controlled_rectifier_horz.ts +0 -13
  163. package/symbols/silicon_controlled_rectifier_vert.ts +0 -15
  164. package/symbols/spdt_normally_closed_switch_down.ts +0 -22
  165. package/symbols/spdt_normally_closed_switch_left.ts +0 -22
  166. package/symbols/spdt_normally_closed_switch_right.ts +0 -10
  167. package/symbols/spdt_normally_closed_switch_up.ts +0 -22
  168. package/symbols/spst_normally_closed_switch_down.ts +0 -22
  169. package/symbols/spst_normally_closed_switch_left.ts +0 -22
  170. package/symbols/spst_normally_closed_switch_right.ts +0 -12
  171. package/symbols/spst_normally_closed_switch_up.ts +0 -22
  172. package/symbols/step_recovery_diode_horz.ts +0 -11
  173. package/symbols/step_recovery_diode_vert.ts +0 -4
  174. package/symbols/tachometer_horz.ts +0 -32
  175. package/symbols/tachometer_vert.ts +0 -19
  176. package/symbols/triac_horz.ts +0 -13
  177. package/symbols/triac_vert.ts +0 -16
  178. package/symbols/tunnel_diode_horz.ts +0 -19
  179. package/symbols/tunnel_diode_vert.ts +0 -18
  180. package/symbols/unijunction_transistor_horz.ts +0 -20
  181. package/symbols/unijunction_transistor_vert.ts +0 -19
  182. package/symbols/var_meter_horz.ts +0 -30
  183. package/symbols/var_meter_vert.ts +0 -4
  184. package/symbols/varactor_diode_horz.ts +0 -19
  185. package/symbols/varactor_diode_vert.ts +0 -18
  186. package/symbols/varistor_horz.ts +0 -24
  187. package/symbols/varistor_vert.ts +0 -4
  188. package/symbols/varmeter_horz.ts +0 -32
  189. package/symbols/varmeter_vert.ts +0 -19
  190. package/symbols/volt_meter_horz.ts +0 -10
  191. package/symbols/volt_meter_vert.ts +0 -4
  192. package/symbols/watt_hour_meter_horz.ts +0 -32
  193. package/symbols/watt_hour_meter_vert.ts +0 -19
  194. package/symbols/wattmeter_horz.ts +0 -32
  195. package/symbols/wattmeter_vert.ts +0 -19
  196. package/symbols/zener_diode_horz.ts +0 -19
  197. package/symbols/zener_diode_vert.ts +0 -17
@@ -1,10 +0,0 @@
1
- import svgJson from "assets/generated/spdt_normally_closed_switch.json"
2
- import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
-
4
- export default modifySymbol(svgJson)
5
- .changeTextAnchor("{VAL}", "middle_top")
6
- .labelPort("left1", ["1"])
7
- .labelPort("right2", ["2"])
8
- .labelPort("right1", ["3"])
9
- .changeTextAnchor("{REF}", "middle_bottom")
10
- .build()
@@ -1,22 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import spdt_normally_closed_switch_right from "./spdt_normally_closed_switch_right"
3
- import type { TextPrimitive } from "drawing"
4
-
5
- const rotated = rotateSymbol(spdt_normally_closed_switch_right, "up")
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_bottom"
15
- val.anchor = "middle_top"
16
-
17
- ref.x = 0.4
18
- ref.y += 0.28
19
- val.y -= 0.28
20
- val.x = 0.4
21
-
22
- export default rotated
@@ -1,22 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import spst_normally_closed_switch_right from "./spst_normally_closed_switch_right"
3
- import type { TextPrimitive } from "drawing"
4
-
5
- const rotated = rotateSymbol(spst_normally_closed_switch_right, "down")
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_bottom"
15
- val.anchor = "middle_top"
16
-
17
- ref.x = 0.3
18
- ref.y += 0.265
19
- val.y -= 0.265
20
- val.x = 0.3
21
-
22
- export default rotated
@@ -1,22 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import spst_normally_closed_switch_right from "./spst_normally_closed_switch_right"
3
- import type { TextPrimitive } from "drawing"
4
-
5
- const rotated = rotateSymbol(spst_normally_closed_switch_right, "left")
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_bottom"
15
- val.anchor = "middle_top"
16
-
17
- ref.x = 0
18
- ref.y += 0.57
19
- val.y -= 0.57
20
- val.x = 0
21
-
22
- export default rotated
@@ -1,12 +0,0 @@
1
- import svgJson from "assets/generated/spst_normally_closed_switch.json"
2
- import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
-
4
- delete (svgJson.refblocks as any).left1
5
- delete (svgJson.refblocks as any).right1
6
- svgJson.bounds.width += 0.2
7
- export default modifySymbol(svgJson)
8
- .changeTextAnchor("{VAL}", "middle_top")
9
- .labelPort("left2", ["1"])
10
- .labelPort("right2", ["2"])
11
- .changeTextAnchor("{REF}", "middle_bottom")
12
- .build()
@@ -1,22 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import spst_normally_closed_switch_right from "./spst_normally_closed_switch_right"
3
- import type { TextPrimitive } from "drawing"
4
-
5
- const rotated = rotateSymbol(spst_normally_closed_switch_right, "up")
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_bottom"
15
- val.anchor = "middle_top"
16
-
17
- ref.x = 0.3
18
- ref.y += 0.265
19
- val.y -= 0.265
20
- val.x = 0.3
21
-
22
- export default rotated
@@ -1,11 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/step_recovery_diode.json"
3
- import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
4
-
5
- const { paths, texts, bounds, refblocks, circles } = svgJson
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()
@@ -1,4 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import step_recovery_diode_horz from "./step_recovery_diode_horz"
3
-
4
- export default rotateSymbol(step_recovery_diode_horz)
@@ -1,32 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/tachometer.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
- type: "text",
12
- text: "{REF}",
13
- x: 0,
14
- y: -0.3594553499999995,
15
- anchor: "middle_top",
16
- },
17
- {
18
- type: "text",
19
- text: "{VAL}",
20
- x: 0,
21
- y: 0.35,
22
- anchor: "middle_bottom",
23
- },
24
- { ...texts.left1, y: 0.01, anchor: "center", fontSize: 0.2 },
25
- ] as any,
26
- ports: [
27
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
28
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
29
- ],
30
- size: { width: bounds.width, height: bounds.height },
31
- center: { x: bounds.centerX, y: bounds.centerY },
32
- })
@@ -1,19 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import tachometer_horz from "./tachometer_horz"
3
- import { Primitive } from "drawing/types"
4
-
5
- const { 5: letter, ...rest } = tachometer_horz.primitives
6
-
7
- function isPrimitive(value: any): value is Primitive {
8
- return typeof value === "object"
9
- }
10
-
11
- const rotatedSymbol = rotateSymbol({
12
- ...tachometer_horz,
13
- primitives: Object.values(rest).filter(isPrimitive),
14
- })
15
-
16
- export default {
17
- ...rotatedSymbol,
18
- primitives: [...rotatedSymbol.primitives, letter],
19
- }
@@ -1,13 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/triac.json"
3
- import { TextPrimitive } from "drawing/types"
4
- import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
5
-
6
- const { paths, texts, bounds, refblocks, circles } = svgJson
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,16 +0,0 @@
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
@@ -1,19 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/tunnel_diode.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
- { ...texts.top1, anchor: "middle_bottom" },
11
- { ...texts.bottom1, anchor: "middle_top" },
12
- ] as any,
13
- ports: [
14
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
15
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
16
- ],
17
- size: { width: bounds.width, height: bounds.height },
18
- center: { x: bounds.centerX, y: bounds.centerY },
19
- })
@@ -1,18 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import tunnel_diode_horz from "./tunnel_diode_horz"
3
-
4
- import type { TextPrimitive } from "drawing"
5
-
6
- const rotated = rotateSymbol(tunnel_diode_horz)
7
-
8
- const ref = rotated.primitives.find(
9
- (p) => p.type === "text" && p.text === "{REF}",
10
- )! as TextPrimitive
11
- const val = rotated.primitives.find(
12
- (p) => p.type === "text" && p.text === "{VAL}",
13
- )! as TextPrimitive
14
-
15
- ref.anchor = "middle_left"
16
- val.anchor = "middle_right"
17
-
18
- export default rotated
@@ -1,20 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/unijunction_transistor.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
- { ...texts.top1, anchor: "middle_left" },
11
- { ...texts.bottom1, anchor: "middle_right" },
12
- ] as any,
13
- ports: [
14
- { ...refblocks.top1, labels: ["1"] }, // TODO add more "standard" labels
15
- { ...refblocks.bottom1, labels: ["2"] }, // TODO add more "standard" labels
16
- { ...refblocks.left1, labels: ["3"] }, // TODO add more "standard" labels
17
- ],
18
- size: { width: bounds.width, height: bounds.height },
19
- center: { x: bounds.centerX, y: bounds.centerY },
20
- })
@@ -1,19 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import unijunction_transistor_horz from "./unijunction_transistor_horz"
3
-
4
- const rotatedSymbol = rotateSymbol(unijunction_transistor_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
-
12
- ref.y = 0.1
13
-
14
- const val = texts.find((text) => text.text === "{VAL}")!
15
-
16
- val.y = 0.1
17
- val.x = -0.4
18
-
19
- export default rotatedSymbol
@@ -1,30 +0,0 @@
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_top",
15
- },
16
- {
17
- ...texts.bottom1,
18
- x: 0,
19
- y: 0.35,
20
- anchor: "middle_bottom",
21
- },
22
- { ...texts.left1, x: -0.02, y: 0.01, 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
- })
@@ -1,4 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import var_meter_horz from "./var_meter_horz"
3
-
4
- export default rotateSymbol(var_meter_horz)
@@ -1,19 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/varactor_diode.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
- { ...texts.top1, anchor: "middle_bottom" },
11
- { ...texts.bottom1, anchor: "middle_top" },
12
- ] as any,
13
- ports: [
14
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
15
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
16
- ],
17
- size: { width: bounds.width, height: bounds.height },
18
- center: { x: bounds.centerX, y: bounds.centerY },
19
- })
@@ -1,18 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import varactor_diode_horz from "./varactor_diode_horz"
3
-
4
- import type { TextPrimitive } from "drawing"
5
-
6
- const rotated = rotateSymbol(varactor_diode_horz)
7
-
8
- const ref = rotated.primitives.find(
9
- (p) => p.type === "text" && p.text === "{REF}",
10
- )! as TextPrimitive
11
- const val = rotated.primitives.find(
12
- (p) => p.type === "text" && p.text === "{VAL}",
13
- )! as TextPrimitive
14
-
15
- ref.anchor = "middle_left"
16
- val.anchor = "middle_right"
17
-
18
- export default rotated
@@ -1,24 +0,0 @@
1
- import svgJson from "assets/generated/varistor.json"
2
- import { defineSymbol } from "drawing/defineSymbol"
3
-
4
- const { paths, texts, bounds, refblocks } = svgJson
5
-
6
- export default defineSymbol({
7
- primitives: [
8
- ...Object.values(paths),
9
- { ...texts.top1, anchor: "middle_left" },
10
- { ...texts.bottom1, anchor: "middle_right" },
11
- ] as any,
12
- ports: [
13
- {
14
- ...refblocks.left1,
15
- labels: ["1", "-"],
16
- },
17
- {
18
- ...refblocks.right1,
19
- labels: ["2", "+"],
20
- },
21
- ],
22
- size: { width: bounds.width, height: bounds.height }, //{ width: 1, height: 0.24 },
23
- center: { x: bounds.centerX, y: bounds.centerY },
24
- })
@@ -1,4 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import varistor_horz from "./varistor_horz"
3
-
4
- export default rotateSymbol(varistor_horz)
@@ -1,32 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/varmeter.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
- type: "text",
12
- text: "{REF}",
13
- x: 0,
14
- y: -0.3594553499999995,
15
- anchor: "middle_top",
16
- },
17
- {
18
- type: "text",
19
- text: "{VAL}",
20
- x: 0,
21
- y: 0.35,
22
- anchor: "middle_bottom",
23
- },
24
- { ...texts.left1, anchor: "center", y: 0.02, fontSize: 0.2 },
25
- ] as any,
26
- ports: [
27
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
28
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
29
- ],
30
- size: { width: bounds.width, height: bounds.height },
31
- center: { x: bounds.centerX, y: bounds.centerY },
32
- })
@@ -1,19 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import varmeter_horz from "./varmeter_horz"
3
- import { Primitive } from "drawing/types"
4
-
5
- const { 5: letter, ...rest } = varmeter_horz.primitives
6
-
7
- function isPrimitive(value: any): value is Primitive {
8
- return typeof value === "object"
9
- }
10
-
11
- const rotatedSymbol = rotateSymbol({
12
- ...varmeter_horz,
13
- primitives: Object.values(rest).filter(isPrimitive),
14
- })
15
-
16
- export default {
17
- ...rotatedSymbol,
18
- primitives: [...rotatedSymbol.primitives, letter],
19
- }
@@ -1,10 +0,0 @@
1
- import svgJson from "assets/generated/volt_meter.json"
2
- import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
3
-
4
- const { paths, texts, bounds, circles, refblocks } = svgJson
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()
@@ -1,4 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import volt_meter_horz from "./volt_meter_horz"
3
-
4
- export default rotateSymbol(volt_meter_horz)
@@ -1,32 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/watt_hour_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
- type: "text",
12
- text: "{REF}",
13
- x: 0,
14
- y: -0.3594553499999995,
15
- anchor: "middle_top",
16
- },
17
- {
18
- type: "text",
19
- text: "{VAL}",
20
- x: 0,
21
- y: 0.35,
22
- anchor: "middle_bottom",
23
- },
24
- { ...texts.left1, anchor: "center", y: 0.01, fontSize: 0.2 },
25
- ] as any,
26
- ports: [
27
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
28
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
29
- ],
30
- size: { width: bounds.width, height: bounds.height },
31
- center: { x: bounds.centerX, y: bounds.centerY },
32
- })
@@ -1,19 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import watt_hour_meter_horz from "./watt_hour_meter_horz"
3
- import { Primitive } from "drawing/types"
4
-
5
- const { 5: letter, ...rest } = watt_hour_meter_horz.primitives
6
-
7
- function isPrimitive(value: any): value is Primitive {
8
- return typeof value === "object"
9
- }
10
-
11
- const rotatedSymbol = rotateSymbol({
12
- ...watt_hour_meter_horz,
13
- primitives: Object.values(rest).filter(isPrimitive),
14
- })
15
-
16
- export default {
17
- ...rotatedSymbol,
18
- primitives: [...rotatedSymbol.primitives, letter],
19
- }
@@ -1,32 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/wattmeter.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
- type: "text",
12
- text: "{REF}",
13
- x: 0,
14
- y: -0.3594553499999995,
15
- anchor: "middle_top",
16
- },
17
- {
18
- type: "text",
19
- text: "{VAL}",
20
- x: 0,
21
- y: 0.35,
22
- anchor: "middle_bottom",
23
- },
24
- { ...texts.left1, anchor: "center", y: 0.01, fontSize: 0.3 },
25
- ] as any,
26
- ports: [
27
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
28
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
29
- ],
30
- size: { width: bounds.width, height: bounds.height },
31
- center: { x: bounds.centerX, y: bounds.centerY },
32
- })
@@ -1,19 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import wattmeter_horz from "./wattmeter_horz"
3
- import { Primitive } from "drawing/types"
4
-
5
- const { 5: letter, ...rest } = wattmeter_horz.primitives
6
-
7
- function isPrimitive(value: any): value is Primitive {
8
- return typeof value === "object"
9
- }
10
-
11
- const rotatedSymbol = rotateSymbol({
12
- ...wattmeter_horz,
13
- primitives: Object.values(rest).filter(isPrimitive),
14
- })
15
-
16
- export default {
17
- ...rotatedSymbol,
18
- primitives: [...rotatedSymbol.primitives, letter],
19
- }
@@ -1,19 +0,0 @@
1
- import { defineSymbol } from "drawing/defineSymbol"
2
- import svgJson from "assets/generated/zener_diode.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
- { ...texts.top1, anchor: "middle_bottom" },
11
- { ...texts.bottom1, anchor: "middle_top" },
12
- ] as any,
13
- ports: [
14
- { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
15
- { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
16
- ],
17
- size: { width: bounds.width, height: bounds.height },
18
- center: { x: bounds.centerX, y: bounds.centerY },
19
- })
@@ -1,17 +0,0 @@
1
- import { rotateSymbol } from "drawing/rotateSymbol"
2
- import zener_diode_horz from "./zener_diode_horz"
3
-
4
- import type { TextPrimitive } from "drawing"
5
-
6
- const rotated = rotateSymbol(zener_diode_horz)
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
- export default rotated