@stuly/anode 0.1.0

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.
@@ -0,0 +1,157 @@
1
+ import { LinkKind, Vec2 } from "./elements.js";
2
+
3
+ //#region src/core/layout.ts
4
+ function getLinkPoints(ctx, link) {
5
+ const fromSocket = ctx.sockets.get(link.from);
6
+ const toSocket = ctx.sockets.get(link.to);
7
+ if (!fromSocket || !toSocket) return null;
8
+ const fromEntity = ctx.entities.get(fromSocket.entityId);
9
+ const toEntity = ctx.entities.get(toSocket.entityId);
10
+ if (!fromEntity || !toEntity) return null;
11
+ const fromWorldPos = ctx.getWorldPosition(fromEntity.id);
12
+ const toWorldPos = ctx.getWorldPosition(toEntity.id);
13
+ return {
14
+ from: new Vec2(fromWorldPos.x + fromSocket.offset.x, fromWorldPos.y + fromSocket.offset.y),
15
+ to: new Vec2(toWorldPos.x + toSocket.offset.x, toWorldPos.y + toSocket.offset.y)
16
+ };
17
+ }
18
+ function getLinkCenter(ctx, link) {
19
+ const pts = getLinkPoints(ctx, link);
20
+ if (!pts) return null;
21
+ const points = [
22
+ pts.from,
23
+ ...link.waypoints,
24
+ pts.to
25
+ ];
26
+ if (points.length < 2) return null;
27
+ const midIndex = Math.floor((points.length - 1) / 2);
28
+ const p1 = points[midIndex];
29
+ const p2 = points[midIndex + 1];
30
+ return new Vec2((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);
31
+ }
32
+ function getLinkPath(ctx, link) {
33
+ const pts = getLinkPoints(ctx, link);
34
+ if (!pts) return null;
35
+ const { from: fromPos, to: toPos } = pts;
36
+ const points = [
37
+ fromPos,
38
+ ...link.waypoints,
39
+ toPos
40
+ ];
41
+ if (link.kind === LinkKind.LINE) return points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
42
+ if (link.kind === LinkKind.BEZIER) {
43
+ if (points.length === 2) {
44
+ const p1 = points[0];
45
+ const p2 = points[1];
46
+ const dx = Math.abs(p1.x - p2.x);
47
+ const offset = Math.max(dx / 2, 50);
48
+ return `M ${p1.x} ${p1.y} C ${p1.x + offset} ${p1.y}, ${p2.x - offset} ${p2.y}, ${p2.x} ${p2.y}`;
49
+ }
50
+ let path = `M ${points[0].x} ${points[0].y}`;
51
+ for (let i = 0; i < points.length - 1; i++) {
52
+ const p1 = points[i];
53
+ const p2 = points[i + 1];
54
+ const dx = Math.abs(p1.x - p2.x);
55
+ const offset = Math.max(dx / 2, 20);
56
+ path += ` C ${p1.x + offset} ${p1.y}, ${p2.x - offset} ${p2.y}, ${p2.x} ${p2.y}`;
57
+ }
58
+ return path;
59
+ }
60
+ if (link.kind === LinkKind.STEP || link.kind === LinkKind.SMOOTH_STEP) {
61
+ let path = `M ${points[0].x} ${points[0].y}`;
62
+ const isSmooth = link.kind === LinkKind.SMOOTH_STEP;
63
+ const borderRadius = 10;
64
+ for (let i = 0; i < points.length - 1; i++) {
65
+ const p1 = points[i];
66
+ const p2 = points[i + 1];
67
+ const midX = (p1.x + p2.x) / 2;
68
+ if (!isSmooth) path += ` L ${midX} ${p1.y} L ${midX} ${p2.y} L ${p2.x} ${p2.y}`;
69
+ else {
70
+ const signX = p2.x > p1.x ? 1 : -1;
71
+ const signY = p2.y > p1.y ? 1 : -1;
72
+ const actualBorder = Math.min(borderRadius, Math.abs(p1.x - p2.x) / 2, Math.abs(p1.y - p2.y) / 2);
73
+ if (actualBorder < 1) path += ` L ${p2.x} ${p2.y}`;
74
+ else path += ` L ${midX - actualBorder * signX} ${p1.y}
75
+ Q ${midX} ${p1.y} ${midX} ${p1.y + actualBorder * signY}
76
+ L ${midX} ${p2.y - actualBorder * signY}
77
+ Q ${midX} ${p2.y} ${midX + actualBorder * signX} ${p2.y}
78
+ L ${p2.x} ${p2.y}`;
79
+ }
80
+ }
81
+ return path;
82
+ }
83
+ return null;
84
+ }
85
+ var Rect = class {
86
+ constructor(x, y, w, h) {
87
+ this.x = x;
88
+ this.y = y;
89
+ this.w = w;
90
+ this.h = h;
91
+ }
92
+ contains(point) {
93
+ return point.x >= this.x && point.x <= this.x + this.w && point.y >= this.y && point.y <= this.y + this.h;
94
+ }
95
+ intersects(range) {
96
+ return !(range.x > this.x + this.w || range.x + range.w < this.x || range.y > this.y + this.h || range.y + range.h < this.y);
97
+ }
98
+ };
99
+ var QuadTree = class QuadTree {
100
+ capacity = 4;
101
+ points = [];
102
+ divided = false;
103
+ northwest = null;
104
+ northeast = null;
105
+ southwest = null;
106
+ southeast = null;
107
+ constructor(boundary) {
108
+ this.boundary = boundary;
109
+ }
110
+ subdivide() {
111
+ const { x, y, w, h } = this.boundary;
112
+ const nw = new Rect(x, y, w / 2, h / 2);
113
+ const ne = new Rect(x + w / 2, y, w / 2, h / 2);
114
+ const sw = new Rect(x, y + h / 2, w / 2, h / 2);
115
+ const se = new Rect(x + w / 2, y + h / 2, w / 2, h / 2);
116
+ this.northwest = new QuadTree(nw);
117
+ this.northeast = new QuadTree(ne);
118
+ this.southwest = new QuadTree(sw);
119
+ this.southeast = new QuadTree(se);
120
+ this.divided = true;
121
+ }
122
+ insert(pos, data) {
123
+ if (!this.boundary.contains(pos)) return false;
124
+ if (this.points.length < this.capacity) {
125
+ this.points.push({
126
+ pos,
127
+ data
128
+ });
129
+ return true;
130
+ }
131
+ if (!this.divided) this.subdivide();
132
+ return this.northwest.insert(pos, data) || this.northeast.insert(pos, data) || this.southwest.insert(pos, data) || this.southeast.insert(pos, data);
133
+ }
134
+ query(range, found = []) {
135
+ if (!this.boundary.intersects(range)) return found;
136
+ for (const p of this.points) if (range.contains(p.pos)) found.push(p.data);
137
+ if (this.divided) {
138
+ this.northwest.query(range, found);
139
+ this.northeast.query(range, found);
140
+ this.southwest.query(range, found);
141
+ this.southeast.query(range, found);
142
+ }
143
+ return found;
144
+ }
145
+ clear() {
146
+ this.points = [];
147
+ this.divided = false;
148
+ this.northwest = null;
149
+ this.northeast = null;
150
+ this.southwest = null;
151
+ this.southeast = null;
152
+ }
153
+ };
154
+
155
+ //#endregion
156
+ export { QuadTree, Rect, getLinkCenter, getLinkPath, getLinkPoints };
157
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","names":[],"sources":["../../src/core/layout.ts"],"sourcesContent":["import { Context } from './context';\nimport { Link, Vec2, LinkKind } from './elements';\n\nexport function getLinkPoints(ctx: Context, link: Link): { from: Vec2; to: Vec2 } | null {\n const fromSocket = ctx.sockets.get(link.from);\n const toSocket = ctx.sockets.get(link.to);\n\n if (!fromSocket || !toSocket) {\n return null;\n }\n\n const fromEntity = ctx.entities.get(fromSocket.entityId);\n const toEntity = ctx.entities.get(toSocket.entityId);\n\n if (!fromEntity || !toEntity) return null;\n\n const fromWorldPos = ctx.getWorldPosition(fromEntity.id);\n const toWorldPos = ctx.getWorldPosition(toEntity.id);\n\n return {\n from: new Vec2(fromWorldPos.x + fromSocket.offset.x, fromWorldPos.y + fromSocket.offset.y),\n to: new Vec2(toWorldPos.x + toSocket.offset.x, toWorldPos.y + toSocket.offset.y)\n };\n}\n\nexport function getLinkCenter(ctx: Context, link: Link): Vec2 | null {\n const pts = getLinkPoints(ctx, link);\n if (!pts) return null;\n\n const points = [pts.from, ...link.waypoints, pts.to];\n if (points.length < 2) return null;\n\n const midIndex = Math.floor((points.length - 1) / 2);\n const p1 = points[midIndex]!;\n const p2 = points[midIndex + 1]!;\n\n return new Vec2((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);\n}\n\nexport function getLinkPath(ctx: Context, link: Link): string | null {\n const pts = getLinkPoints(ctx, link);\n if (!pts) return null;\n\n const { from: fromPos, to: toPos } = pts;\n const points = [fromPos, ...link.waypoints, toPos];\n\n if (link.kind === LinkKind.LINE) {\n return points.map((p, i) => `${i === 0 ? 'M' : 'L'} ${p.x} ${p.y}`).join(' ');\n }\n\n if (link.kind === LinkKind.BEZIER) {\n if (points.length === 2) {\n const p1 = points[0]!;\n const p2 = points[1]!;\n const dx = Math.abs(p1.x - p2.x);\n const offset = Math.max(dx / 2, 50);\n return `M ${p1.x} ${p1.y} C ${p1.x + offset} ${p1.y}, ${p2.x - offset} ${p2.y}, ${p2.x} ${p2.y}`;\n }\n\n let path = `M ${points[0]!.x} ${points[0]!.y}`;\n for (let i = 0; i < points.length - 1; i++) {\n const p1 = points[i]!;\n const p2 = points[i + 1]!;\n const dx = Math.abs(p1.x - p2.x);\n const offset = Math.max(dx / 2, 20);\n path += ` C ${p1.x + offset} ${p1.y}, ${p2.x - offset} ${p2.y}, ${p2.x} ${p2.y}`;\n }\n return path;\n }\n\n if (link.kind === LinkKind.STEP || link.kind === LinkKind.SMOOTH_STEP) {\n let path = `M ${points[0]!.x} ${points[0]!.y}`;\n const isSmooth = link.kind === LinkKind.SMOOTH_STEP;\n const borderRadius = 10;\n\n for (let i = 0; i < points.length - 1; i++) {\n const p1 = points[i]!;\n const p2 = points[i + 1]!;\n const midX = (p1.x + p2.x) / 2;\n\n if (!isSmooth) {\n path += ` L ${midX} ${p1.y} L ${midX} ${p2.y} L ${p2.x} ${p2.y}`;\n } else {\n const signX = p2.x > p1.x ? 1 : -1;\n const signY = p2.y > p1.y ? 1 : -1;\n const actualBorder = Math.min(\n borderRadius,\n Math.abs(p1.x - p2.x) / 2,\n Math.abs(p1.y - p2.y) / 2\n );\n\n if (actualBorder < 1) {\n // Points are aligned, draw a straight line for this segment\n path += ` L ${p2.x} ${p2.y}`;\n } else {\n path += ` L ${midX - actualBorder * signX} ${p1.y} \n Q ${midX} ${p1.y} ${midX} ${p1.y + actualBorder * signY}\n L ${midX} ${p2.y - actualBorder * signY}\n Q ${midX} ${p2.y} ${midX + actualBorder * signX} ${p2.y}\n L ${p2.x} ${p2.y}`;\n }\n }\n }\n return path;\n }\n\n return null;\n}\n\nexport class Rect {\n constructor(\n public x: number,\n public y: number,\n public w: number,\n public h: number\n ) {}\n\n contains(point: Vec2) {\n return (\n point.x >= this.x &&\n point.x <= this.x + this.w &&\n point.y >= this.y &&\n point.y <= this.y + this.h\n );\n }\n\n intersects(range: Rect) {\n return !(\n range.x > this.x + this.w ||\n range.x + range.w < this.x ||\n range.y > this.y + this.h ||\n range.y + range.h < this.y\n );\n }\n}\n\nexport class QuadTree<T> {\n private capacity: number = 4;\n private points: { pos: Vec2; data: T }[] = [];\n private divided: boolean = false;\n\n private northwest: QuadTree<T> | null = null;\n private northeast: QuadTree<T> | null = null;\n private southwest: QuadTree<T> | null = null;\n private southeast: QuadTree<T> | null = null;\n\n constructor(public boundary: Rect) {}\n\n subdivide() {\n const { x, y, w, h } = this.boundary;\n const nw = new Rect(x, y, w / 2, h / 2);\n const ne = new Rect(x + w / 2, y, w / 2, h / 2);\n const sw = new Rect(x, y + h / 2, w / 2, h / 2);\n const se = new Rect(x + w / 2, y + h / 2, w / 2, h / 2);\n\n this.northwest = new QuadTree<T>(nw);\n this.northeast = new QuadTree<T>(ne);\n this.southwest = new QuadTree<T>(sw);\n this.southeast = new QuadTree<T>(se);\n\n this.divided = true;\n }\n\n insert(pos: Vec2, data: T): boolean {\n if (!this.boundary.contains(pos)) {\n return false;\n }\n\n if (this.points.length < this.capacity) {\n this.points.push({ pos, data });\n return true;\n }\n\n if (!this.divided) {\n this.subdivide();\n }\n\n return (\n this.northwest!.insert(pos, data) ||\n this.northeast!.insert(pos, data) ||\n this.southwest!.insert(pos, data) ||\n this.southeast!.insert(pos, data)\n );\n }\n\n query(range: Rect, found: T[] = []): T[] {\n if (!this.boundary.intersects(range)) {\n return found;\n }\n\n for (const p of this.points) {\n if (range.contains(p.pos)) {\n found.push(p.data);\n }\n }\n\n if (this.divided) {\n this.northwest!.query(range, found);\n this.northeast!.query(range, found);\n this.southwest!.query(range, found);\n this.southeast!.query(range, found);\n }\n\n return found;\n }\n\n clear() {\n this.points = [];\n this.divided = false;\n this.northwest = null;\n this.northeast = null;\n this.southwest = null;\n this.southeast = null;\n }\n}\n"],"mappings":";;;AAGA,SAAgB,cAAc,KAAc,MAA6C;CACvF,MAAM,aAAa,IAAI,QAAQ,I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AAW,MAAM,OAAO,MAAM;AACnC,QAAK,UAAW,MAAM,OAAO,MAAM;AACnC,QAAK,UAAW,MAAM,OAAO,MAAM;AACnC,QAAK,UAAW,MAAM,OAAO,MAAM;;AAGrC,SAAO;;CAGT,QAAQ;AACN,OAAK,SAAS,EAAE;AAChB,OAAK,UAAU;AACf,OAAK,YAAY;AACjB,OAAK,YAAY;AACjB,OAAK,YAAY;AACjB,OAAK,YAAY"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@stuly/anode",
3
+ "version": "0.1.0",
4
+ "main": "dist/anode.js",
5
+ "module": "dist/anode.js",
6
+ "types": "dist/anode.d.ts",
7
+ "description": "A simple node library",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/anode.d.ts",
17
+ "import": "./dist/anode.js",
18
+ "default": "./dist/anode.js"
19
+ }
20
+ },
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "MIT",
24
+ "type": "module",
25
+ "devDependencies": {
26
+ "tsdown": "^0.20.3",
27
+ "typescript": "^5.9.3",
28
+ "vitest": "^4.0.18"
29
+ },
30
+ "scripts": {
31
+ "build": "tsdown",
32
+ "dev": "tsdown --watch",
33
+ "format": "prettier --write .",
34
+ "test": "vitest run",
35
+ "lint": "tsc"
36
+ }
37
+ }