schematic-symbols 0.0.121 → 0.0.122
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -5
- package/drawing/arc.ts +0 -31
- package/drawing/arrow.ts +0 -41
- package/drawing/box.ts +0 -5
- package/drawing/circle.ts +0 -7
- package/drawing/cubicBezierCurveArc.ts +0 -28
- package/drawing/defineSymbol.ts +0 -16
- package/drawing/getSvg.ts +0 -199
- package/drawing/index.ts +0 -10
- package/drawing/mapColor.ts +0 -10
- package/drawing/modify-symbol/modify-symbol.ts +0 -97
- package/drawing/ninePointAnchorToSvgAnchor.ts +0 -11
- package/drawing/path.ts +0 -5
- package/drawing/pathToSvgD.ts +0 -22
- package/drawing/resizeSymbol.ts +0 -67
- package/drawing/rotateSymbol.ts +0 -324
- package/drawing/svgPathToPoints.ts +0 -109
- package/drawing/text.ts +0 -8
- package/drawing/typeguards.ts +0 -155
- package/drawing/types.ts +0 -93
- package/drawing/utils/getBoundsOfPrimitives.ts +0 -51
- package/drawing/utils/makeYUpPositive.ts +0 -46
- package/index.ts +0 -24
- package/symbols/SPDT_switch_horz.ts +0 -22
- package/symbols/SPDT_switch_vert.ts +0 -20
- package/symbols/SPST_switch_horz.ts +0 -12
- package/symbols/SPST_switch_vert.ts +0 -20
- package/symbols/ac_voltmeter_horz.ts +0 -31
- package/symbols/ac_voltmeter_vert.ts +0 -8
- package/symbols/avalanche_diode_horz.ts +0 -19
- package/symbols/avalanche_diode_vert.ts +0 -10
- package/symbols/battery_horz.ts +0 -20
- package/symbols/battery_vert.ts +0 -6
- package/symbols/boxresistor_down.ts +0 -33
- package/symbols/boxresistor_left.ts +0 -33
- package/symbols/boxresistor_right.ts +0 -33
- package/symbols/boxresistor_up.ts +0 -33
- package/symbols/capacitor_down.ts +0 -34
- package/symbols/capacitor_left.ts +0 -11
- package/symbols/capacitor_polarized_down.ts +0 -34
- package/symbols/capacitor_polarized_left.ts +0 -10
- package/symbols/capacitor_polarized_right.ts +0 -10
- package/symbols/capacitor_polarized_up.ts +0 -34
- package/symbols/capacitor_right.ts +0 -10
- package/symbols/capacitor_up.ts +0 -34
- package/symbols/constant_current_diode_horz.ts +0 -9
- package/symbols/constant_current_diode_vert.ts +0 -11
- package/symbols/crystal_4pin_horz.ts +0 -11
- package/symbols/crystal_4pin_vert.ts +0 -10
- package/symbols/crystal_horz.ts +0 -9
- package/symbols/crystal_vert.ts +0 -10
- package/symbols/darlington_pair_transistor_horz.ts +0 -10
- package/symbols/darlington_pair_transistor_vert.ts +0 -12
- package/symbols/dc_ammeter_horz.ts +0 -32
- package/symbols/dc_ammeter_vert.ts +0 -51
- package/symbols/dc_voltmeter_horz.ts +0 -31
- package/symbols/dc_voltmeter_vert.ts +0 -19
- package/symbols/diac_horz.ts +0 -9
- package/symbols/diac_vert.ts +0 -16
- package/symbols/diode_down.ts +0 -4
- package/symbols/diode_left.ts +0 -4
- package/symbols/diode_right.ts +0 -9
- package/symbols/diode_up.ts +0 -4
- package/symbols/dpdt_normally_closed_switch_down.ts +0 -22
- package/symbols/dpdt_normally_closed_switch_left.ts +0 -23
- package/symbols/dpdt_normally_closed_switch_right.ts +0 -13
- package/symbols/dpdt_normally_closed_switch_up.ts +0 -22
- package/symbols/dpdt_switch_down.ts +0 -22
- package/symbols/dpdt_switch_left.ts +0 -23
- package/symbols/dpdt_switch_right.ts +0 -13
- package/symbols/dpdt_switch_up.ts +0 -22
- package/symbols/dpst_normally_closed_switch_down.ts +0 -22
- package/symbols/dpst_normally_closed_switch_left.ts +0 -23
- package/symbols/dpst_normally_closed_switch_right.ts +0 -11
- package/symbols/dpst_normally_closed_switch_up.ts +0 -22
- package/symbols/dpst_switch_down.ts +0 -21
- package/symbols/dpst_switch_left.ts +0 -23
- package/symbols/dpst_switch_right.ts +0 -11
- package/symbols/dpst_switch_up.ts +0 -22
- package/symbols/filled_diode_horz.ts +0 -9
- package/symbols/filled_diode_vert.ts +0 -4
- package/symbols/frequency_meter_horz.ts +0 -32
- package/symbols/frequency_meter_vert.ts +0 -19
- package/symbols/fuse_horz.ts +0 -24
- package/symbols/fuse_vert.ts +0 -4
- package/symbols/ground_horz.ts +0 -37
- package/symbols/ground_vert.ts +0 -4
- package/symbols/gunn_diode_horz.ts +0 -11
- package/symbols/gunn_diode_vert.ts +0 -11
- package/symbols/icled_down.ts +0 -4
- package/symbols/icled_left.ts +0 -4
- package/symbols/icled_right.ts +0 -11
- package/symbols/icled_up.ts +0 -27
- package/symbols/igbt_transistor_horz.ts +0 -10
- package/symbols/igbt_transistor_vert.ts +0 -21
- package/symbols/illuminated_push_button_normally_open_horz.ts +0 -9
- package/symbols/illuminated_push_button_normally_open_vert.ts +0 -20
- package/symbols/inductor_down.ts +0 -4
- package/symbols/inductor_left.ts +0 -4
- package/symbols/inductor_right.ts +0 -20
- package/symbols/inductor_up.ts +0 -4
- package/symbols/laser_diode_horz.ts +0 -10
- package/symbols/laser_diode_vert.ts +0 -13
- package/symbols/led_down.ts +0 -4
- package/symbols/led_left.ts +0 -4
- package/symbols/led_right.ts +0 -20
- package/symbols/led_up.ts +0 -27
- package/symbols/light_dependent_resistor_horz.ts +0 -20
- package/symbols/light_dependent_resistor_vert.ts +0 -20
- package/symbols/mosfet_depletion_normally_on_horz.ts +0 -19
- package/symbols/mosfet_depletion_normally_on_vert.ts +0 -21
- package/symbols/mushroom_head_normally_open_momentary_horz.ts +0 -20
- package/symbols/mushroom_head_normally_open_momentary_vert.ts +0 -23
- package/symbols/n_channel_d_mosfet_transistor_horz.ts +0 -20
- package/symbols/n_channel_d_mosfet_transistor_vert.ts +0 -20
- package/symbols/n_channel_e_mosfet_transistor_horz.ts +0 -21
- package/symbols/n_channel_e_mosfet_transistor_vert.ts +0 -20
- package/symbols/njfet_transistor_horz.ts +0 -20
- package/symbols/njfet_transistor_vert.ts +0 -20
- package/symbols/npn_bipolar_transistor_horz.ts +0 -11
- package/symbols/npn_bipolar_transistor_vert.ts +0 -21
- package/symbols/opamp_no_power_down.ts +0 -4
- package/symbols/opamp_no_power_left.ts +0 -4
- package/symbols/opamp_no_power_right.ts +0 -10
- package/symbols/opamp_no_power_up.ts +0 -4
- package/symbols/opamp_with_power_down.ts +0 -4
- package/symbols/opamp_with_power_left.ts +0 -4
- package/symbols/opamp_with_power_right.ts +0 -12
- package/symbols/opamp_with_power_up.ts +0 -4
- package/symbols/p_channel_d_mosfet_transistor_horz.ts +0 -20
- package/symbols/p_channel_d_mosfet_transistor_vert.ts +0 -20
- package/symbols/p_channel_e_mosfet_transistor_horz.ts +0 -20
- package/symbols/p_channel_e_mosfet_transistor_vert.ts +0 -20
- package/symbols/photodiode_horz.ts +0 -9
- package/symbols/photodiode_vert.ts +0 -13
- package/symbols/pjfet_transistor_horz.ts +0 -20
- package/symbols/pjfet_transistor_vert.ts +0 -20
- package/symbols/pnp_bipolar_transistor_horz.ts +0 -10
- package/symbols/pnp_bipolar_transistor_vert.ts +0 -20
- package/symbols/potentiometer2_horz.ts +0 -18
- package/symbols/potentiometer2_vert.ts +0 -14
- package/symbols/potentiometer3_down.ts +0 -4
- package/symbols/potentiometer3_left.ts +0 -4
- package/symbols/potentiometer3_right.ts +0 -10
- package/symbols/potentiometer3_up.ts +0 -4
- package/symbols/potentiometer_horz.ts +0 -18
- package/symbols/potentiometer_vert.ts +0 -6
- package/symbols/power_factor_meter_horz.ts +0 -42
- package/symbols/power_factor_meter_vert.ts +0 -19
- package/symbols/push_button_normally_closed_momentary_horz.ts +0 -20
- package/symbols/push_button_normally_closed_momentary_vert.ts +0 -4
- package/symbols/push_button_normally_open_momentary_horz.ts +0 -20
- package/symbols/push_button_normally_open_momentary_vert.ts +0 -4
- package/symbols/rectifier_diode_horz.ts +0 -21
- package/symbols/rectifier_diode_vert.ts +0 -17
- package/symbols/resonator_horz.ts +0 -34
- package/symbols/resonator_vert.ts +0 -4
- package/symbols/schottky_diode_horz.ts +0 -10
- package/symbols/schottky_diode_vert.ts +0 -18
- package/symbols/silicon_controlled_rectifier_horz.ts +0 -13
- package/symbols/silicon_controlled_rectifier_vert.ts +0 -15
- package/symbols/spdt_normally_closed_switch_down.ts +0 -22
- package/symbols/spdt_normally_closed_switch_left.ts +0 -22
- package/symbols/spdt_normally_closed_switch_right.ts +0 -10
- package/symbols/spdt_normally_closed_switch_up.ts +0 -22
- package/symbols/spst_normally_closed_switch_down.ts +0 -22
- package/symbols/spst_normally_closed_switch_left.ts +0 -22
- package/symbols/spst_normally_closed_switch_right.ts +0 -12
- package/symbols/spst_normally_closed_switch_up.ts +0 -22
- package/symbols/step_recovery_diode_horz.ts +0 -11
- package/symbols/step_recovery_diode_vert.ts +0 -4
- package/symbols/tachometer_horz.ts +0 -32
- package/symbols/tachometer_vert.ts +0 -19
- package/symbols/triac_horz.ts +0 -13
- package/symbols/triac_vert.ts +0 -16
- package/symbols/tunnel_diode_horz.ts +0 -19
- package/symbols/tunnel_diode_vert.ts +0 -18
- package/symbols/unijunction_transistor_horz.ts +0 -20
- package/symbols/unijunction_transistor_vert.ts +0 -19
- package/symbols/var_meter_horz.ts +0 -30
- package/symbols/var_meter_vert.ts +0 -4
- package/symbols/varactor_diode_horz.ts +0 -19
- package/symbols/varactor_diode_vert.ts +0 -18
- package/symbols/varistor_horz.ts +0 -24
- package/symbols/varistor_vert.ts +0 -4
- package/symbols/varmeter_horz.ts +0 -32
- package/symbols/varmeter_vert.ts +0 -19
- package/symbols/volt_meter_horz.ts +0 -10
- package/symbols/volt_meter_vert.ts +0 -4
- package/symbols/watt_hour_meter_horz.ts +0 -32
- package/symbols/watt_hour_meter_vert.ts +0 -19
- package/symbols/wattmeter_horz.ts +0 -32
- package/symbols/wattmeter_vert.ts +0 -19
- package/symbols/zener_diode_horz.ts +0 -19
- package/symbols/zener_diode_vert.ts +0 -17
@@ -1,10 +0,0 @@
|
|
1
|
-
import crystal_4pin_horz from "./crystal_4pin_horz"
|
2
|
-
import { rotateRightFacingSymbol } from "drawing/rotateSymbol"
|
3
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
4
|
-
import svgJson from "assets/generated/crystal_4pin.json"
|
5
|
-
|
6
|
-
export default modifySymbol(crystal_4pin_horz)
|
7
|
-
.rotateRightFacingSymbol("up")
|
8
|
-
.changeTextAnchor("{REF}", "top_right")
|
9
|
-
.changeTextAnchor("{VAL}", "bottom_left")
|
10
|
-
.build()
|
package/symbols/crystal_horz.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/crystal.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.changeTextAnchor("{VAL}", "middle_bottom")
|
6
|
-
.labelPort("left1", ["1"])
|
7
|
-
.labelPort("right1", ["2"])
|
8
|
-
.changeTextAnchor("{REF}", "middle_top")
|
9
|
-
.build()
|
package/symbols/crystal_vert.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/crystal.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.rotateRightFacingSymbol("down")
|
6
|
-
.changeTextAnchor("{VAL}", "middle_left")
|
7
|
-
.labelPort("left1", ["1"])
|
8
|
-
.labelPort("right1", ["2"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_right")
|
10
|
-
.build()
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/darlington_pair_transistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
6
|
-
.labelPort("right2", ["1"])
|
7
|
-
.labelPort("right3", ["2"])
|
8
|
-
.labelPort("right1", ["3"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.build()
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/darlington_pair_transistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
svgJson.bounds.width += 0.3
|
5
|
-
export default modifySymbol(svgJson)
|
6
|
-
.rotateRightFacingSymbol("down")
|
7
|
-
.changeTextAnchor("{VAL}", "middle_right")
|
8
|
-
.labelPort("right2", ["1"])
|
9
|
-
.labelPort("right3", ["2"])
|
10
|
-
.labelPort("right1", ["3"])
|
11
|
-
.changeTextAnchor("{REF}", "middle_left")
|
12
|
-
.build()
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/dc_ammeter.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, x: 0, y: 0.01, anchor: "center", 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,51 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dc_ammeter_horz from "./dc_ammeter_horz"
|
3
|
-
import { PathPrimitive, Primitive, TextPrimitive } from "drawing/types"
|
4
|
-
|
5
|
-
function isPathPrimitive(value: any): value is PathPrimitive {
|
6
|
-
return (
|
7
|
-
typeof value === "object" &&
|
8
|
-
value !== null &&
|
9
|
-
value.type === "path" &&
|
10
|
-
Array.isArray(value.points) &&
|
11
|
-
typeof value.color === "string"
|
12
|
-
)
|
13
|
-
}
|
14
|
-
|
15
|
-
function isTextPrimitive(value: any): value is TextPrimitive {
|
16
|
-
return (
|
17
|
-
typeof value === "object" &&
|
18
|
-
value !== null &&
|
19
|
-
value.type === "text" &&
|
20
|
-
typeof value.text === "string" &&
|
21
|
-
typeof value.x === "number" &&
|
22
|
-
typeof value.y === "number" &&
|
23
|
-
typeof value.anchor === "string"
|
24
|
-
)
|
25
|
-
}
|
26
|
-
|
27
|
-
const { 6: letter, 2: underline, ...rest } = dc_ammeter_horz.primitives
|
28
|
-
|
29
|
-
if (isPathPrimitive(underline)) {
|
30
|
-
underline.points.map((p) => {
|
31
|
-
p.y += 0.05
|
32
|
-
})
|
33
|
-
}
|
34
|
-
|
35
|
-
if (isTextPrimitive(letter)) {
|
36
|
-
letter.y += 0.025
|
37
|
-
}
|
38
|
-
|
39
|
-
function isPrimitive(value: any): value is Primitive {
|
40
|
-
return typeof value === "object"
|
41
|
-
}
|
42
|
-
|
43
|
-
const rotatedSymbol = rotateSymbol({
|
44
|
-
...dc_ammeter_horz,
|
45
|
-
primitives: Object.values(rest).filter(isPrimitive),
|
46
|
-
})
|
47
|
-
|
48
|
-
export default {
|
49
|
-
...rotatedSymbol,
|
50
|
-
primitives: [...rotatedSymbol.primitives, letter, underline],
|
51
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/dc_voltmeter.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
|
-
] 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
|
-
})
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dc_voltmeter_horz from "./dc_voltmeter_horz"
|
3
|
-
import { Primitive } from "drawing/types"
|
4
|
-
|
5
|
-
const { 2: letter, 3: underline, ...rest } = dc_voltmeter_horz.primitives
|
6
|
-
|
7
|
-
function isPrimitive(value: any): value is Primitive {
|
8
|
-
return typeof value === "object"
|
9
|
-
}
|
10
|
-
|
11
|
-
const rotatedSymbol = rotateSymbol({
|
12
|
-
...dc_voltmeter_horz,
|
13
|
-
primitives: Object.values(rest).filter(isPrimitive),
|
14
|
-
})
|
15
|
-
|
16
|
-
export default {
|
17
|
-
...rotatedSymbol,
|
18
|
-
primitives: [...rotatedSymbol.primitives, letter, underline],
|
19
|
-
}
|
package/symbols/diac_horz.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/diac.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("right1", ["2"])
|
8
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
9
|
-
.build()
|
package/symbols/diac_vert.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import diac_horz from "./diac_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(diac_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
|
package/symbols/diode_down.ts
DELETED
package/symbols/diode_left.ts
DELETED
package/symbols/diode_right.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/diode.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1", "pos"])
|
6
|
-
.labelPort("right1", ["2", "neg"])
|
7
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
8
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
9
|
-
.build()
|
package/symbols/diode_up.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_normally_closed_switch_right from "./dpdt_normally_closed_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpdt_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
|
18
|
-
ref.y += 0.537
|
19
|
-
val.y -= 0.5375
|
20
|
-
val.x = 0
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_normally_closed_switch_right from "./dpdt_normally_closed_switch_right"
|
3
|
-
|
4
|
-
import type { TextPrimitive } from "drawing"
|
5
|
-
|
6
|
-
const rotated = rotateSymbol(dpdt_normally_closed_switch_right, "left")
|
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_bottom"
|
16
|
-
val.anchor = "middle_top"
|
17
|
-
|
18
|
-
ref.x = 0
|
19
|
-
ref.y += 1.0
|
20
|
-
val.y -= 1.0
|
21
|
-
val.x = 0
|
22
|
-
|
23
|
-
export default rotated
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/dpdt_normally_closed_switch.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1"])
|
6
|
-
.labelPort("right1", ["3"])
|
7
|
-
.labelPort("right2", ["2"])
|
8
|
-
.labelPort("right3", ["6"])
|
9
|
-
.labelPort("left2", ["4"])
|
10
|
-
.labelPort("right5", ["5"])
|
11
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
12
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
13
|
-
.build()
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_normally_closed_switch_right from "./dpdt_normally_closed_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpdt_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
|
18
|
-
ref.y += 0.537
|
19
|
-
val.y -= 0.5375
|
20
|
-
val.x = 0
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_switch_right from "./dpdt_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpdt_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.0
|
18
|
-
ref.y += 0.565
|
19
|
-
val.y -= 0.555
|
20
|
-
val.x = 0.0
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_switch_right from "./dpdt_switch_right"
|
3
|
-
|
4
|
-
import type { TextPrimitive } from "drawing"
|
5
|
-
|
6
|
-
const rotated = rotateSymbol(dpdt_switch_right, "left")
|
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_bottom"
|
16
|
-
val.anchor = "middle_top"
|
17
|
-
|
18
|
-
ref.x = 0
|
19
|
-
ref.y += 1.09
|
20
|
-
val.y -= 1.09
|
21
|
-
val.x = 0
|
22
|
-
|
23
|
-
export default rotated
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/dpdt_switch.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1"])
|
6
|
-
.labelPort("right1", ["3"])
|
7
|
-
.labelPort("right2", ["2"])
|
8
|
-
.labelPort("right3", ["6"])
|
9
|
-
.labelPort("left2", ["4"])
|
10
|
-
.labelPort("right5", ["5"])
|
11
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
12
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
13
|
-
.build()
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpdt_switch_right from "./dpdt_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpdt_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.0
|
18
|
-
ref.y += 0.565
|
19
|
-
val.y -= 0.555
|
20
|
-
val.x = 0.0
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_normally_closed_switch_right from "./dpst_normally_closed_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpst_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.4
|
18
|
-
ref.y += 0.265
|
19
|
-
val.y -= 0.265
|
20
|
-
val.x = 0.4
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_normally_closed_switch_right from "./dpst_normally_closed_switch_right"
|
3
|
-
|
4
|
-
import type { TextPrimitive } from "drawing"
|
5
|
-
|
6
|
-
const rotated = rotateSymbol(dpst_normally_closed_switch_right, "left")
|
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_bottom"
|
16
|
-
val.anchor = "middle_top"
|
17
|
-
|
18
|
-
ref.x = 0
|
19
|
-
ref.y += 0.67
|
20
|
-
val.y -= 0.67
|
21
|
-
val.x = 0
|
22
|
-
|
23
|
-
export default rotated
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/dpst_normally_closed_switch.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1"])
|
6
|
-
.labelPort("right1", ["2"])
|
7
|
-
.labelPort("right3", ["4"])
|
8
|
-
.labelPort("left3", ["3"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
11
|
-
.build()
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_normally_closed_switch_right from "./dpst_normally_closed_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpst_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.46
|
18
|
-
ref.y += 0.265
|
19
|
-
val.y -= 0.265
|
20
|
-
val.x = 0.46
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_switch_right from "./dpst_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpst_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.4
|
18
|
-
ref.y += 0.295
|
19
|
-
val.y -= 0.295
|
20
|
-
val.x = 0.42
|
21
|
-
export default rotated
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_switch_right from "./dpst_switch_right"
|
3
|
-
|
4
|
-
import type { TextPrimitive } from "drawing"
|
5
|
-
|
6
|
-
const rotated = rotateSymbol(dpst_switch_right, "left")
|
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_bottom"
|
16
|
-
val.anchor = "middle_top"
|
17
|
-
|
18
|
-
ref.x = 0
|
19
|
-
ref.y += 0.795
|
20
|
-
val.y -= 0.795
|
21
|
-
val.x = 0
|
22
|
-
|
23
|
-
export default rotated
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/dpst_switch.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1"])
|
6
|
-
.labelPort("right1", ["2"])
|
7
|
-
.labelPort("right3", ["4"])
|
8
|
-
.labelPort("left3", ["3"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
11
|
-
.build()
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import dpst_switch_right from "./dpst_switch_right"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(dpst_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.46
|
18
|
-
ref.y += 0.315
|
19
|
-
val.y -= 0.315
|
20
|
-
val.x = 0.46
|
21
|
-
|
22
|
-
export default rotated
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/filled_diode.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("right1", ["2"])
|
8
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
9
|
-
.build()
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/frequency_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, x: 0, 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 frequency_meter_horz from "./frequency_meter_horz"
|
3
|
-
import { Primitive } from "drawing/types"
|
4
|
-
|
5
|
-
const { 5: letter, ...rest } = frequency_meter_horz.primitives
|
6
|
-
|
7
|
-
function isPrimitive(value: any): value is Primitive {
|
8
|
-
return typeof value === "object"
|
9
|
-
}
|
10
|
-
|
11
|
-
const rotatedSymbol = rotateSymbol({
|
12
|
-
...frequency_meter_horz,
|
13
|
-
primitives: Object.values(rest).filter(isPrimitive),
|
14
|
-
})
|
15
|
-
|
16
|
-
export default {
|
17
|
-
...rotatedSymbol,
|
18
|
-
primitives: [...rotatedSymbol.primitives, letter],
|
19
|
-
}
|