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,51 +0,0 @@
|
|
1
|
-
import { Primitive, Point } from "../types"
|
2
|
-
|
3
|
-
export function getBoundsOfPrimitives(primitives: Primitive[]): {
|
4
|
-
minX: number
|
5
|
-
maxX: number
|
6
|
-
minY: number
|
7
|
-
maxY: number
|
8
|
-
} {
|
9
|
-
if (primitives.length === 0) {
|
10
|
-
return { minX: 0, maxX: 0, minY: 0, maxY: 0 }
|
11
|
-
}
|
12
|
-
|
13
|
-
let minX = Infinity
|
14
|
-
let maxX = -Infinity
|
15
|
-
let minY = Infinity
|
16
|
-
let maxY = -Infinity
|
17
|
-
|
18
|
-
const updateBounds = (point: Point) => {
|
19
|
-
minX = Math.min(minX, point.x)
|
20
|
-
maxX = Math.max(maxX, point.x)
|
21
|
-
minY = Math.min(minY, point.y)
|
22
|
-
maxY = Math.max(maxY, point.y)
|
23
|
-
}
|
24
|
-
|
25
|
-
primitives.forEach((primitive) => {
|
26
|
-
switch (primitive.type) {
|
27
|
-
case "path":
|
28
|
-
primitive.points.forEach(updateBounds)
|
29
|
-
break
|
30
|
-
case "text":
|
31
|
-
updateBounds({ x: primitive.x, y: primitive.y })
|
32
|
-
break
|
33
|
-
case "circle": {
|
34
|
-
const { x, y, radius } = primitive
|
35
|
-
updateBounds({ x: x - radius, y: y - radius })
|
36
|
-
updateBounds({ x: x + radius, y: y + radius })
|
37
|
-
break
|
38
|
-
}
|
39
|
-
case "box": {
|
40
|
-
const { x, y, width, height } = primitive
|
41
|
-
const halfWidth = width / 2
|
42
|
-
const halfHeight = height / 2
|
43
|
-
updateBounds({ x: x - halfWidth, y: y - halfHeight })
|
44
|
-
updateBounds({ x: x + halfWidth, y: y + halfHeight })
|
45
|
-
break
|
46
|
-
}
|
47
|
-
}
|
48
|
-
})
|
49
|
-
|
50
|
-
return { minX, maxX, minY, maxY }
|
51
|
-
}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import { NinePointAnchor } from "drawing/types"
|
2
|
-
|
3
|
-
/**
|
4
|
-
* In Inkscape and Websites, Y-up is NEGATIVE- meaning e.g. y=10 is BELOW y=0.
|
5
|
-
*
|
6
|
-
* Our symbols are defined with Y-up POSITIVE, meaning e.g. y=10 is ABOVE y=0.
|
7
|
-
*
|
8
|
-
* This function helps flip y positions so that you can convert from schematic
|
9
|
-
* symbol coordinates to SVG coordinates.
|
10
|
-
*/
|
11
|
-
export const makeYUpPositive = (y: number, yUpPositive: boolean = true) => {
|
12
|
-
return yUpPositive ? -y : y
|
13
|
-
}
|
14
|
-
|
15
|
-
/**
|
16
|
-
* This function gives an intermediate anchor flip that can be used to determine
|
17
|
-
* how anchors should be interpreted when flipping in the Y-axis.
|
18
|
-
*
|
19
|
-
* It converts top_left -> bottom_left etc.
|
20
|
-
*
|
21
|
-
* y=1 top_left -------
|
22
|
-
* y=0 | |
|
23
|
-
* y=-1 -------------
|
24
|
-
*
|
25
|
-
* Y-up Negative
|
26
|
-
*
|
27
|
-
* y=-1 -------------
|
28
|
-
* y=0 | |
|
29
|
-
* y=1 bottom_left --
|
30
|
-
*/
|
31
|
-
export const flipAnchorOverYAxis = (anchor: NinePointAnchor) => {
|
32
|
-
if (anchor === "top_left") return "bottom_left"
|
33
|
-
if (anchor === "top_right") return "bottom_right"
|
34
|
-
if (anchor === "bottom_left") return "top_left"
|
35
|
-
if (anchor === "bottom_right") return "top_right"
|
36
|
-
if (anchor === "middle_top") return "middle_bottom"
|
37
|
-
if (anchor === "middle_bottom") return "middle_top"
|
38
|
-
return anchor
|
39
|
-
}
|
40
|
-
|
41
|
-
export const makeAnchorYUpPositive = (
|
42
|
-
anchor: NinePointAnchor,
|
43
|
-
yUpPositive: boolean = true,
|
44
|
-
) => {
|
45
|
-
return yUpPositive ? flipAnchorOverYAxis(anchor) : anchor
|
46
|
-
}
|
package/index.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import symbols from "./generated/symbols-index"
|
2
|
-
|
3
|
-
export type {
|
4
|
-
SchSymbol,
|
5
|
-
BoxPrimitive,
|
6
|
-
CirclePrimitive,
|
7
|
-
PathPrimitive,
|
8
|
-
TextPrimitive,
|
9
|
-
} from "./drawing/types"
|
10
|
-
import { getSvg, getInnerSvg, resizeSymbol } from "./drawing"
|
11
|
-
|
12
|
-
import { BaseSymbolName } from "./generated/base-symbol-names"
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Utility for easier autocomplete:
|
16
|
-
*
|
17
|
-
* ```ts
|
18
|
-
* BASE_SYMBOLS.boxresistor // "boxresistor"
|
19
|
-
* ```
|
20
|
-
*/
|
21
|
-
export const BASE_SYMBOLS: Record<BaseSymbolName, BaseSymbolName> =
|
22
|
-
Object.fromEntries(Object.keys(symbols).map((k) => [k, k])) as any
|
23
|
-
|
24
|
-
export { symbols, getSvg, getInnerSvg, resizeSymbol, BaseSymbolName }
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/SPDT_switch.json"
|
3
|
-
import { Primitive } from "drawing/types"
|
4
|
-
|
5
|
-
svgJson.bounds.width += 0.2
|
6
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
7
|
-
|
8
|
-
export default defineSymbol({
|
9
|
-
primitives: [
|
10
|
-
...Object.values(paths),
|
11
|
-
...Object.values(circles),
|
12
|
-
{ ...texts.top1, anchor: "middle_bottom", x: -0.01 },
|
13
|
-
{ ...texts.bottom1, anchor: "middle_top", x: -0.01 },
|
14
|
-
] as Primitive[],
|
15
|
-
ports: [
|
16
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
17
|
-
{ ...refblocks.right1, labels: ["3"] }, // TODO add more "standard" labels
|
18
|
-
{ ...refblocks.right2, labels: ["2"] }, // TODO add more "standard" labels
|
19
|
-
],
|
20
|
-
size: { width: bounds.width, height: bounds.height },
|
21
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
22
|
-
})
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import SPDT_switch_horz from "./SPDT_switch_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(SPDT_switch_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.anchor = "middle_right"
|
11
|
-
val.x = -0.3
|
12
|
-
val.y = 0
|
13
|
-
|
14
|
-
const ref = texts.find((t) => t.text === "{REF}")!
|
15
|
-
|
16
|
-
ref.anchor = "middle_left"
|
17
|
-
ref.x = 0.3
|
18
|
-
ref.y = 0
|
19
|
-
|
20
|
-
export default rotatedSymbol
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/SPST_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,20 +0,0 @@
|
|
1
|
-
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import SPST_switch_horz from "./SPST_switch_horz"
|
3
|
-
|
4
|
-
const rotatedSymbol = rotateSymbol(SPST_switch_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.anchor = "middle_right"
|
11
|
-
val.x = -0.3
|
12
|
-
val.y = 0
|
13
|
-
|
14
|
-
const ref = texts.find((t) => t.text === "{REF}")!
|
15
|
-
|
16
|
-
ref.anchor = "middle_left"
|
17
|
-
ref.x = 0.3
|
18
|
-
ref.y = 0
|
19
|
-
|
20
|
-
export default rotatedSymbol
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/ac_voltmeter.json"
|
3
|
-
|
4
|
-
const { paths, 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 { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/avalanche_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,10 +0,0 @@
|
|
1
|
-
import { rotateRightFacingSymbol, rotateSymbol } from "drawing/rotateSymbol"
|
2
|
-
import avalanche_diode_horz from "./avalanche_diode_horz"
|
3
|
-
|
4
|
-
import type { TextPrimitive } from "drawing"
|
5
|
-
|
6
|
-
const rotated = rotateRightFacingSymbol(avalanche_diode_horz, {
|
7
|
-
newOrientation: "down",
|
8
|
-
})
|
9
|
-
|
10
|
-
export default rotated
|
package/symbols/battery_horz.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
-
import svgJson from "assets/generated/battery.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/battery_vert.ts
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/boxresistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: -0.16,
|
13
|
-
y: 0.2294553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0.16,
|
19
|
-
y: 0.2294553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
27
|
-
})
|
28
|
-
.changeTextAnchor("{VAL}", "middle_bottom")
|
29
|
-
.rotateRightFacingSymbol("down")
|
30
|
-
.labelPort("left1", ["1"])
|
31
|
-
.labelPort("right1", ["2"])
|
32
|
-
.changeTextAnchor("{REF}", "middle_left")
|
33
|
-
.build()
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/boxresistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: 0,
|
13
|
-
y: 0.2294553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0,
|
19
|
-
y: -0.1594553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
27
|
-
})
|
28
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
29
|
-
.rotateRightFacingSymbol("right")
|
30
|
-
.labelPort("left1", ["1"])
|
31
|
-
.labelPort("right1", ["2"])
|
32
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
33
|
-
.build()
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/boxresistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: 0,
|
13
|
-
y: 0.2294553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0,
|
19
|
-
y: -0.1594553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
27
|
-
})
|
28
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
29
|
-
.rotateRightFacingSymbol("right")
|
30
|
-
.labelPort("left1", ["1"])
|
31
|
-
.labelPort("right1", ["2"])
|
32
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
33
|
-
.build()
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/boxresistor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: -0.16,
|
13
|
-
y: 0.2294553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0.16,
|
19
|
-
y: 0.2294553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
27
|
-
})
|
28
|
-
.changeTextAnchor("{VAL}", "middle_bottom")
|
29
|
-
.rotateRightFacingSymbol("down")
|
30
|
-
.labelPort("left1", ["1"])
|
31
|
-
.labelPort("right1", ["2"])
|
32
|
-
.changeTextAnchor("{REF}", "middle_left")
|
33
|
-
.build()
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/capacitor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: -0.2,
|
13
|
-
y: 0.2094553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0.2,
|
19
|
-
y: 0.2094553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
size: { width: bounds.width, height: bounds.height },
|
27
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
28
|
-
})
|
29
|
-
.changeTextAnchor("{VAL}", "top_left")
|
30
|
-
.rotateRightFacingSymbol("down")
|
31
|
-
.labelPort("left1", ["1"])
|
32
|
-
.labelPort("right1", ["2"])
|
33
|
-
.changeTextAnchor("{REF}", "bottom_left")
|
34
|
-
.build()
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { isPrimitive } from "drawing/typeguards"
|
2
|
-
import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
|
3
|
-
import svgJson from "../assets/generated/capacitor.json"
|
4
|
-
|
5
|
-
export default modifySymbol(svgJson)
|
6
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
7
|
-
.rotateRightFacingSymbol("right")
|
8
|
-
.labelPort("left1", ["2"])
|
9
|
-
.labelPort("right1", ["1"])
|
10
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
11
|
-
.build()
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/capacitor_polarized.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: -0.2,
|
13
|
-
y: 0.2094553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: 0.3,
|
19
|
-
y: 0.2094553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
size: { width: bounds.width, height: bounds.height },
|
27
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
28
|
-
})
|
29
|
-
.changeTextAnchor("{VAL}", "top_left")
|
30
|
-
.rotateRightFacingSymbol("down")
|
31
|
-
.labelPort("left1", ["1"])
|
32
|
-
.labelPort("right1", ["2"])
|
33
|
-
.changeTextAnchor("{REF}", "bottom_left")
|
34
|
-
.build()
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
|
2
|
-
import svgJson from "./capacitor_polarized_right"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
6
|
-
.rotateRightFacingSymbol("left")
|
7
|
-
.labelPort("left1", ["1"])
|
8
|
-
.labelPort("right1", ["2"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_top")
|
10
|
-
.build()
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { modifySymbol } from "../drawing/modify-symbol/modify-symbol"
|
2
|
-
import svgJson from "assets/generated/capacitor_polarized.json"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
6
|
-
.rotateRightFacingSymbol("right")
|
7
|
-
.labelPort("left1", ["1"])
|
8
|
-
.labelPort("right1", ["2"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.build()
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/capacitor_polarized.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: 0.1,
|
13
|
-
y: -0.2094553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: -0.2,
|
19
|
-
y: -0.2094553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
size: { width: bounds.width, height: bounds.height },
|
27
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
28
|
-
})
|
29
|
-
.changeTextAnchor("{VAL}", "top_left")
|
30
|
-
.rotateRightFacingSymbol("up")
|
31
|
-
.labelPort("left1", ["1"])
|
32
|
-
.labelPort("right1", ["2"])
|
33
|
-
.changeTextAnchor("{REF}", "bottom_left")
|
34
|
-
.build()
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/capacitor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.rotateRightFacingSymbol("right")
|
6
|
-
.changeTextAnchor("{VAL}", "middle_top")
|
7
|
-
.labelPort("left1", ["1"])
|
8
|
-
.labelPort("right1", ["2"])
|
9
|
-
.changeTextAnchor("{REF}", "middle_bottom")
|
10
|
-
.build()
|
package/symbols/capacitor_up.ts
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/capacitor.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
const { paths, texts, bounds, refblocks, circles } = svgJson
|
5
|
-
export default modifySymbol({
|
6
|
-
primitives: [
|
7
|
-
...Object.values(paths),
|
8
|
-
...Object.values(circles),
|
9
|
-
{
|
10
|
-
type: "text",
|
11
|
-
text: "{REF}",
|
12
|
-
x: 0.2,
|
13
|
-
y: -0.2094553499999995,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
type: "text",
|
17
|
-
text: "{VAL}",
|
18
|
-
x: -0.2,
|
19
|
-
y: -0.2094553499999995,
|
20
|
-
},
|
21
|
-
] as any,
|
22
|
-
ports: [
|
23
|
-
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
24
|
-
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
25
|
-
],
|
26
|
-
size: { width: bounds.width, height: bounds.height },
|
27
|
-
center: { x: bounds.centerX, y: bounds.centerY },
|
28
|
-
})
|
29
|
-
.changeTextAnchor("{VAL}", "top_left")
|
30
|
-
.rotateRightFacingSymbol("up")
|
31
|
-
.labelPort("left1", ["1"])
|
32
|
-
.labelPort("right1", ["2"])
|
33
|
-
.changeTextAnchor("{REF}", "bottom_left")
|
34
|
-
.build()
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/constant_current_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,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/constant_current_diode.json"
|
2
|
-
|
3
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
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()
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import svgJson from "assets/generated/crystal_4pin.json"
|
2
|
-
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
-
|
4
|
-
export default modifySymbol(svgJson)
|
5
|
-
.labelPort("top1", ["2", "gnd1"])
|
6
|
-
.labelPort("bottom1", ["4", "gnd2"])
|
7
|
-
.labelPort("left1", ["1"])
|
8
|
-
.labelPort("right1", ["3"])
|
9
|
-
.changeTextAnchor("{REF}", "bottom_right")
|
10
|
-
.changeTextAnchor("{VAL}", "top_left")
|
11
|
-
.build()
|