schematic-symbols 0.0.87 → 0.0.89
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +11 -1
- package/dist/index.js +143 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/symbols/wattmeter_horz.ts +32 -0
- package/symbols/wattmeter_vert.ts +19 -0
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.
|
4
|
+
"version": "0.0.89",
|
5
5
|
"type": "module",
|
6
6
|
"files": [
|
7
7
|
"dist",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"vercel-build": "bun run build && bun run ./scripts/build.ts"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
24
|
-
"@biomejs/biome": "^1.9.
|
24
|
+
"@biomejs/biome": "^1.9.4",
|
25
25
|
"@types/bun": "latest",
|
26
26
|
"@types/prompts": "^2.4.9",
|
27
27
|
"@types/svg-path-parser": "^1.1.6",
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { defineSymbol } from "drawing/defineSymbol"
|
2
|
+
import svgJson from "assets/generated/wattmeter.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
|
+
{
|
11
|
+
type: "text",
|
12
|
+
text: "{REF}",
|
13
|
+
x: 0,
|
14
|
+
y: -0.3594553499999995,
|
15
|
+
anchor: "middle_bottom",
|
16
|
+
},
|
17
|
+
{
|
18
|
+
type: "text",
|
19
|
+
text: "{VAL}",
|
20
|
+
x: 0,
|
21
|
+
y: 0.35,
|
22
|
+
anchor: "middle_top",
|
23
|
+
},
|
24
|
+
{ ...texts.left1, anchor: "center", fontSize: 0.3 },
|
25
|
+
] as any,
|
26
|
+
ports: [
|
27
|
+
{ ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
|
28
|
+
{ ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
|
29
|
+
],
|
30
|
+
size: { width: bounds.width, height: bounds.height },
|
31
|
+
center: { x: bounds.centerX, y: bounds.centerY },
|
32
|
+
})
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { rotateSymbol } from "drawing/rotateSymbol"
|
2
|
+
import wattmeter_horz from "./wattmeter_horz"
|
3
|
+
import { Primitive } from "drawing/types"
|
4
|
+
|
5
|
+
const { 5: letter, ...rest } = wattmeter_horz.primitives
|
6
|
+
|
7
|
+
function isPrimitive(value: any): value is Primitive {
|
8
|
+
return typeof value === "object"
|
9
|
+
}
|
10
|
+
|
11
|
+
const rotatedSymbol = rotateSymbol({
|
12
|
+
...wattmeter_horz,
|
13
|
+
primitives: Object.values(rest).filter(isPrimitive),
|
14
|
+
})
|
15
|
+
|
16
|
+
export default {
|
17
|
+
...rotatedSymbol,
|
18
|
+
primitives: [...rotatedSymbol.primitives, letter],
|
19
|
+
}
|