schematic-symbols 0.0.117 → 0.0.119
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.d.ts +17 -1
- package/dist/index.js +451 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/symbols/icled_down.ts +4 -0
- package/symbols/icled_left.ts +4 -0
- package/symbols/icled_right.ts +11 -0
- package/symbols/icled_up.ts +27 -0
- package/symbols/potentiometer3_down.ts +4 -0
- package/symbols/potentiometer3_left.ts +4 -0
- package/symbols/potentiometer3_right.ts +10 -0
- package/symbols/potentiometer3_up.ts +4 -0
package/package.json
CHANGED
@@ -0,0 +1,11 @@
|
|
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()
|
@@ -0,0 +1,27 @@
|
|
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
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import svgJson from "assets/generated/potentiometer3.json"
|
2
|
+
import { modifySymbol } from "drawing/modify-symbol/modify-symbol"
|
3
|
+
|
4
|
+
export default modifySymbol(svgJson)
|
5
|
+
.labelPort("left", ["1"])
|
6
|
+
.labelPort("right", ["3"])
|
7
|
+
.labelPort("bottom", ["2"])
|
8
|
+
.changeTextAnchor("{REF}", "middle_bottom")
|
9
|
+
.changeTextAnchor("{VAL}", "middle_top")
|
10
|
+
.build()
|