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.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- 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
package/symbols/fuse_horz.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/fuse.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_bottom" },
|
10
|
-
{
|
11
|
-
type: "text",
|
12
|
-
text: "{VAL}",
|
13
|
-
x: 0,
|
14
|
-
y: -0.2,
|
15
|
-
anchor: "middle_top",
|
16
|
-
},
|
17
|
-
] as any,
|
18
|
-
ports: [
|
19
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
20
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
21
|
-
],
|
22
|
-
size: { width: bounds.width, height: bounds.height },
|
23
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
24
|
-
})
|
package/symbols/fuse_vert.ts
DELETED
package/symbols/ground_horz.ts
DELETED
@@ -1,37 +0,0 @@
|
|
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: 1, height: 1 },
|
31
|
-
center: { x: 0, y: 0.4 },
|
32
|
-
})
|
33
|
-
|
34
|
-
// Vertical orientation symbol
|
35
|
-
|
36
|
-
// Export vertical symbol (rotated 90 degrees from original)
|
37
|
-
export default horizontalSymbol
|
package/symbols/ground_vert.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/gunn_diode.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
|
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,11 +0,0 @@
|
|
1
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
2
|
-
|
3
|
-
import svgJson from "assets/generated/gunn_diode.json"
|
4
|
-
|
5
|
-
export default modifySymbol(svgJson)
|
6
|
-
.rotateRightFacingSymbol("down")
|
7
|
-
.changeTextAnchor("{VAL}", "middle_right")
|
8
|
-
.labelPort("left1", ["1"])
|
9
|
-
.labelPort("right1", ["2"])
|
10
|
-
.changeTextAnchor("{REF}", "middle_left")
|
11
|
-
.build()
|
package/symbols/icled_down.ts
DELETED
package/symbols/icled_left.ts
DELETED
package/symbols/icled_right.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/icled.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("left1", ["1", "DIN"])
|
6
|
-
.labelPort("left2", ["2", "POWER"])
|
7
|
-
.labelPort("right1", ["4", "GND"])
|
8
|
-
.labelPort("right2", ["3", "DOUT"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
11
|
-
.build()
|
package/symbols/icled_up.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import icled_right from "./icled_right"
|
3
|
-
|
4
|
-
const baseSymbol = rotateSymbol(icled_right, "up")
|
5
|
-
|
6
|
-
// Flip path25-0 and path78 over X axis
|
7
|
-
const modifiedSymbol = {
|
8
|
-
...baseSymbol,
|
9
|
-
primitives: baseSymbol.primitives.map((primitive) => {
|
10
|
-
if (
|
11
|
-
primitive.type === "path" &&
|
12
|
-
(primitive.points.length === 3 || primitive.points.length === 4)
|
13
|
-
) {
|
14
|
-
// This matches both the triangle shape (path25-0) and path78
|
15
|
-
return {
|
16
|
-
...primitive,
|
17
|
-
points: primitive.points.map((point) => ({
|
18
|
-
x: point.x,
|
19
|
-
y: -point.y + 2 * baseSymbol.center.y,
|
20
|
-
})),
|
21
|
-
}
|
22
|
-
}
|
23
|
-
return primitive
|
24
|
-
}),
|
25
|
-
}
|
26
|
-
|
27
|
-
export default modifiedSymbol
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/igbt_transistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.changeTextAnchor("{VAL}", "middle_right")
|
6
|
-
.labelPort("left1", ["3"])
|
7
|
-
.labelPort("top1", ["2"])
|
8
|
-
.labelPort("bottom1", ["1"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_right")
|
10
|
-
.build()
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import igbt_transistor_horz from "./igbt_transistor_horz"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(igbt_transistor_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 = 0.45
|
18
|
-
ref.y += 0.065
|
19
|
-
val.y += 0.065
|
20
|
-
|
21
|
-
export default rotated
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/illuminated_push_button_normally_open.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,20 +0,0 @@
|
|
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
|
package/symbols/inductor_down.ts
DELETED
package/symbols/inductor_left.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/inductor.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_bottom" },
|
12
|
-
{ ...texts.bottom1, anchor: "middle_top" },
|
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
|
-
})
|
package/symbols/inductor_up.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/laser_diode.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
svgJson.bounds.width += 0.2
|
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,13 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import laser_diode_horz from "./laser_diode_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(laser_diode_horz)
|
5
|
-
|
6
|
-
const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")
|
7
|
-
|
8
|
-
const ref = texts.find((t) => t.text === "{VAL}")!
|
9
|
-
|
10
|
-
ref.x = -0.52
|
11
|
-
ref.anchor = "middle_right"
|
12
|
-
|
13
|
-
export default rotatedSymbol
|
package/symbols/led_down.ts
DELETED
package/symbols/led_left.ts
DELETED
package/symbols/led_right.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/led.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.bottom1, anchor: "middle_top" },
|
12
|
-
{ ...texts.right1, anchor: "middle_bottom" },
|
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
|
-
})
|
package/symbols/led_up.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import led_right from "./led_right"
|
3
|
-
|
4
|
-
const baseSymbol = rotateSymbol(led_right, "up")
|
5
|
-
|
6
|
-
// Flip path25-0 and path78 over X axis
|
7
|
-
const modifiedSymbol = {
|
8
|
-
...baseSymbol,
|
9
|
-
primitives: baseSymbol.primitives.map((primitive) => {
|
10
|
-
if (
|
11
|
-
primitive.type === "path" &&
|
12
|
-
(primitive.points.length === 3 || primitive.points.length === 4)
|
13
|
-
) {
|
14
|
-
// This matches both the triangle shape (path25-0) and path78
|
15
|
-
return {
|
16
|
-
...primitive,
|
17
|
-
points: primitive.points.map((point) => ({
|
18
|
-
x: point.x,
|
19
|
-
y: -point.y + 2 * baseSymbol.center.y,
|
20
|
-
})),
|
21
|
-
}
|
22
|
-
}
|
23
|
-
return primitive
|
24
|
-
}),
|
25
|
-
}
|
26
|
-
|
27
|
-
export default modifiedSymbol
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/light_dependent_resistor.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_left", x: 0 },
|
12
|
-
{ ...texts.bottom1, anchor: "middle_left", 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
|
-
})
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import light_dependent_resistor_horz from "./light_dependent_resistor_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(light_dependent_resistor_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
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/mosfet_depletion_normally_on.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.right1, anchor: "middle_left" },
|
10
|
-
{ ...texts.right2, anchor: "middle_left" },
|
11
|
-
] as any,
|
12
|
-
ports: [
|
13
|
-
{ ...refblocks.top1, labels: ["1"] }, // TODO add more "standard" labels
|
14
|
-
{ ...refblocks.bottom1, labels: ["2"] }, // TODO add more "standard" labels
|
15
|
-
{ ...refblocks.left1, labels: ["3"] }, // TODO add more "standard" labels
|
16
|
-
],
|
17
|
-
size: { width: bounds.width + 0.4, height: bounds.height },
|
18
|
-
center: { x: bounds.centerX + 0.2, y: bounds.centerY },
|
19
|
-
})
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import mosfet_depletion_normally_on_horz from "./mosfet_depletion_normally_on_horz"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(mosfet_depletion_normally_on_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_top"
|
15
|
-
val.anchor = "middle_top"
|
16
|
-
|
17
|
-
ref.x = val.x
|
18
|
-
|
19
|
-
val.y += 0.15
|
20
|
-
|
21
|
-
export default rotated
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/mushroom_head_normally_open_momentary.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_bottom", x: 0 },
|
12
|
-
{ ...texts.bottom1, anchor: "middle_top", x: 0 },
|
13
|
-
] as Primitive[],
|
14
|
-
ports: [
|
15
|
-
{ ...refblocks.left1, labels: ["1"] },
|
16
|
-
{ ...refblocks.right1, labels: ["2"] },
|
17
|
-
],
|
18
|
-
size: { width: bounds.width, height: bounds.height },
|
19
|
-
center: { x: bounds.centerX + 0.006, y: bounds.centerY + 0.06 },
|
20
|
-
})
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import mushroom_head_normally_open_momentary_horz from "./mushroom_head_normally_open_momentary_horz"
|
3
|
-
import type { TextPrimitive } from "drawing"
|
4
|
-
|
5
|
-
const rotated = rotateSymbol(mushroom_head_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.03
|
18
|
-
ref.y = ref.y
|
19
|
-
|
20
|
-
val.x = val.x
|
21
|
-
val.y = 0
|
22
|
-
|
23
|
-
export default rotated
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/n_channel_d_mosfet_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_right", x: 0 },
|
11
|
-
{ ...texts.bottom1, anchor: "middle_right", x: 0 },
|
12
|
-
] as any,
|
13
|
-
ports: [
|
14
|
-
{ ...refblocks.top1, labels: ["1", "drain"] }, // TODO add more "standard" labels
|
15
|
-
{ ...refblocks.bottom1, labels: ["2", "source"] }, // TODO add more "standard" labels
|
16
|
-
{ ...refblocks.left1, labels: ["3", "gate"] }, // TODO add more "standard" labels
|
17
|
-
],
|
18
|
-
size: { width: bounds.width, height: bounds.height },
|
19
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
20
|
-
})
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import n_channel_d_mosfet_transistor_horz from "./n_channel_d_mosfet_transistor_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(n_channel_d_mosfet_transistor_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
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/n_channel_e_mosfet_transistor.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 },
|
12
|
-
{ ...texts.bottom1, anchor: "middle_right", x: 0 },
|
13
|
-
] as Primitive[],
|
14
|
-
ports: [
|
15
|
-
{ ...refblocks.top1, labels: ["1", "drain"] }, // TODO add more "standard" labels
|
16
|
-
{ ...refblocks.bottom1, labels: ["2", "source"] }, // TODO add more "standard" labels
|
17
|
-
{ ...refblocks.left1, labels: ["3", "gate"] }, // TODO add more "standard" labels
|
18
|
-
],
|
19
|
-
size: { width: bounds.width, height: bounds.height },
|
20
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
21
|
-
})
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import n_channel_e_mosfet_transistor_horz from "./n_channel_e_mosfet_transistor_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(n_channel_e_mosfet_transistor_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
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/njfet_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_right", x: 0 },
|
11
|
-
{ ...texts.bottom1, anchor: "middle_right", x: 0 },
|
12
|
-
] as any,
|
13
|
-
ports: [
|
14
|
-
{ ...refblocks.top1, labels: ["1", "drain"] }, // TODO add more "standard" labels
|
15
|
-
{ ...refblocks.bottom1, labels: ["2", "source"] }, // TODO add more "standard" labels
|
16
|
-
{ ...refblocks.left1, labels: ["3", "gate"] }, // TODO add more "standard" labels
|
17
|
-
],
|
18
|
-
size: { width: bounds.width, height: bounds.height },
|
19
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
20
|
-
})
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import njfet_transistor_horz from "./njfet_transistor_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(njfet_transistor_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
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/npn_bipolar_transistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol(svgJson)
|
6
|
-
.changeTextAnchor("{VAL}", "middle_right")
|
7
|
-
.labelPort("left1", ["3"])
|
8
|
-
.labelPort("top1", ["2"])
|
9
|
-
.labelPort("bottom1", ["1"])
|
10
|
-
.changeTextAnchor("{REF}", "middle_right")
|
11
|
-
.build()
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import svgJson from "assets/generated/npn_bipolar_transistor.json"
|
3
|
-
import npn_bipolar_transistor_horz from "./npn_bipolar_transistor_horz"
|
4
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
5
|
-
|
6
|
-
const rotatedSymbol = rotateSymbol(npn_bipolar_transistor_horz)
|
7
|
-
|
8
|
-
const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")
|
9
|
-
|
10
|
-
const ref = texts.find((t) => t.text === "{REF}")!
|
11
|
-
|
12
|
-
ref.anchor = "middle_left"
|
13
|
-
|
14
|
-
export default modifySymbol(svgJson)
|
15
|
-
.rotateRightFacingSymbol("down")
|
16
|
-
.changeTextAnchor("{VAL}", "middle_right")
|
17
|
-
.labelPort("left1", ["3"])
|
18
|
-
.labelPort("top1", ["2"])
|
19
|
-
.labelPort("bottom1", ["1"])
|
20
|
-
.changeTextAnchor("{REF}", "middle_left")
|
21
|
-
.build()
|