schematic-symbols 0.0.118 → 0.0.120
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +13 -1
- package/dist/index.js +342 -8
- 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/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
|