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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.js",
4
- "version": "0.0.117",
4
+ "version": "0.0.119",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -0,0 +1,4 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import icled_right from "./icled_right"
3
+
4
+ export default rotateSymbol(icled_right, "down")
@@ -0,0 +1,4 @@
1
+ import { flipSymbolOverYAxis } from "drawing/rotateSymbol"
2
+ import icled_right from "./icled_right"
3
+
4
+ export default flipSymbolOverYAxis(icled_right)
@@ -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,4 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import potentiometer3_right from "./potentiometer3_right"
3
+
4
+ export default rotateSymbol(potentiometer3_right, "down")
@@ -0,0 +1,4 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import potentiometer3_right from "./potentiometer3_right"
3
+
4
+ export default rotateSymbol(potentiometer3_right, "left")
@@ -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()
@@ -0,0 +1,4 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import potentiometer3_right from "./potentiometer3_right"
3
+
4
+ export default rotateSymbol(potentiometer3_right, "up")