react-html-graph 1.0.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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/calculations/index.d.ts +32 -0
  4. package/dist/calculations/index.d.ts.map +1 -0
  5. package/dist/calculations/index.js +247 -0
  6. package/dist/calculations/index.js.map +1 -0
  7. package/dist/calculations/types.d.ts +43 -0
  8. package/dist/calculations/types.d.ts.map +1 -0
  9. package/dist/calculations/types.js +2 -0
  10. package/dist/calculations/types.js.map +1 -0
  11. package/dist/context/connection-context.d.ts +3 -0
  12. package/dist/context/connection-context.d.ts.map +1 -0
  13. package/dist/context/connection-context.js +13 -0
  14. package/dist/context/connection-context.js.map +1 -0
  15. package/dist/context/error-context.d.ts +3 -0
  16. package/dist/context/error-context.d.ts.map +1 -0
  17. package/dist/context/error-context.js +5 -0
  18. package/dist/context/error-context.js.map +1 -0
  19. package/dist/context/graph-context.d.ts +3 -0
  20. package/dist/context/graph-context.d.ts.map +1 -0
  21. package/dist/context/graph-context.js +8 -0
  22. package/dist/context/graph-context.js.map +1 -0
  23. package/dist/context/graph-root-context.d.ts +7 -0
  24. package/dist/context/graph-root-context.d.ts.map +1 -0
  25. package/dist/context/graph-root-context.js +8 -0
  26. package/dist/context/graph-root-context.js.map +1 -0
  27. package/dist/example/App.css +39 -0
  28. package/dist/example/App.d.ts +3 -0
  29. package/dist/example/App.d.ts.map +1 -0
  30. package/dist/example/App.js +7 -0
  31. package/dist/example/App.js.map +1 -0
  32. package/dist/example/graph-teste.d.ts +2 -0
  33. package/dist/example/graph-teste.d.ts.map +1 -0
  34. package/dist/example/graph-teste.js +205 -0
  35. package/dist/example/graph-teste.js.map +1 -0
  36. package/dist/example/index.css +48 -0
  37. package/dist/example/reportWebVitals.d.ts +4 -0
  38. package/dist/example/reportWebVitals.d.ts.map +1 -0
  39. package/dist/example/reportWebVitals.js +13 -0
  40. package/dist/example/reportWebVitals.js.map +1 -0
  41. package/dist/graph/index.d.ts +11 -0
  42. package/dist/graph/index.d.ts.map +1 -0
  43. package/dist/graph/index.js +161 -0
  44. package/dist/graph/index.js.map +1 -0
  45. package/dist/graph/viewbox.d.ts +9 -0
  46. package/dist/graph/viewbox.d.ts.map +1 -0
  47. package/dist/graph/viewbox.js +30 -0
  48. package/dist/graph/viewbox.js.map +1 -0
  49. package/dist/hooks/api.d.ts +9 -0
  50. package/dist/hooks/api.d.ts.map +1 -0
  51. package/dist/hooks/api.js +13 -0
  52. package/dist/hooks/api.js.map +1 -0
  53. package/dist/hooks/connection.d.ts +46 -0
  54. package/dist/hooks/connection.d.ts.map +1 -0
  55. package/dist/hooks/connection.js +81 -0
  56. package/dist/hooks/connection.js.map +1 -0
  57. package/dist/hooks/error.d.ts +10 -0
  58. package/dist/hooks/error.d.ts.map +1 -0
  59. package/dist/hooks/error.js +16 -0
  60. package/dist/hooks/error.js.map +1 -0
  61. package/dist/hooks/get-zoom.d.ts +2 -0
  62. package/dist/hooks/get-zoom.d.ts.map +1 -0
  63. package/dist/hooks/get-zoom.js +14 -0
  64. package/dist/hooks/get-zoom.js.map +1 -0
  65. package/dist/hooks/graph-mode.d.ts +8 -0
  66. package/dist/hooks/graph-mode.d.ts.map +1 -0
  67. package/dist/hooks/graph-mode.js +13 -0
  68. package/dist/hooks/graph-mode.js.map +1 -0
  69. package/dist/hooks/graph-root.d.ts +9 -0
  70. package/dist/hooks/graph-root.d.ts.map +1 -0
  71. package/dist/hooks/graph-root.js +13 -0
  72. package/dist/hooks/graph-root.js.map +1 -0
  73. package/dist/hooks/graph.d.ts +10 -0
  74. package/dist/hooks/graph.d.ts.map +1 -0
  75. package/dist/hooks/graph.js +12 -0
  76. package/dist/hooks/graph.js.map +1 -0
  77. package/dist/hooks/viewbox.d.ts +7 -0
  78. package/dist/hooks/viewbox.d.ts.map +1 -0
  79. package/dist/hooks/viewbox.js +12 -0
  80. package/dist/hooks/viewbox.js.map +1 -0
  81. package/dist/link/base.d.ts +34 -0
  82. package/dist/link/base.d.ts.map +1 -0
  83. package/dist/link/base.js +202 -0
  84. package/dist/link/base.js.map +1 -0
  85. package/dist/link/temp-link.d.ts +9 -0
  86. package/dist/link/temp-link.d.ts.map +1 -0
  87. package/dist/link/temp-link.js +60 -0
  88. package/dist/link/temp-link.js.map +1 -0
  89. package/dist/module.d.ts +18 -0
  90. package/dist/module.d.ts.map +1 -0
  91. package/dist/module.js +18 -0
  92. package/dist/module.js.map +1 -0
  93. package/dist/nodes/base.d.ts +11 -0
  94. package/dist/nodes/base.d.ts.map +1 -0
  95. package/dist/nodes/base.js +117 -0
  96. package/dist/nodes/base.js.map +1 -0
  97. package/dist/ports/base.d.ts +11 -0
  98. package/dist/ports/base.d.ts.map +1 -0
  99. package/dist/ports/base.js +115 -0
  100. package/dist/ports/base.js.map +1 -0
  101. package/dist/providers/connection-provider.d.ts +10 -0
  102. package/dist/providers/connection-provider.d.ts.map +1 -0
  103. package/dist/providers/connection-provider.js +120 -0
  104. package/dist/providers/connection-provider.js.map +1 -0
  105. package/dist/style.css +78 -0
  106. package/dist/types.d.ts +349 -0
  107. package/dist/types.d.ts.map +1 -0
  108. package/dist/types.js +11 -0
  109. package/dist/types.js.map +1 -0
  110. package/package.json +73 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jefferson Raylan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ **To be documented**...
@@ -0,0 +1,32 @@
1
+ import { PathInput, PathOutput, LabelsInput, LabelOutput } from './types';
2
+ /**
3
+ * Configura o tamanho do pool de workers.
4
+ * Deve ser chamado antes do primeiro cálculo para definir quantos workers
5
+ * serão instanciados (round-robin dispatch).
6
+ *
7
+ * Se não for chamado, o pool será criado automaticamente considerando a quantidade de
8
+ * núcleos do processador (navigator.hardwareConcurrency) limitado a um máximo de 4 workers.
9
+ *
10
+ * @param size Número de workers desejado (será arredondado para inteiro >= 1)
11
+ */
12
+ export declare function configureWorkerPool(size: number): void;
13
+ /**
14
+ * Calcula os paths SVG (forward/reverse/center) e os bounds para um link
15
+ * entre duas portas. Esta função delega o trabalho a um worker do pool.
16
+ *
17
+ * @param input Dados de entrada para o cálculo do path
18
+ * @returns Promise contendo os dados de path e bounds
19
+ */
20
+ export declare function calculatePath(input: PathInput): Promise<PathOutput>;
21
+ /**
22
+ * Calcula as posições dos rótulos (labels) ao longo do caminho entre duas
23
+ * portas. Retorna um array de posições que devem ser aplicadas como atributos
24
+ * de texto no DOM SVG.
25
+ *
26
+ * @param input Dados de entrada para cálculo de labels
27
+ * @returns Promise com posições dos labels
28
+ */
29
+ export declare function calculateLabels(input: LabelsInput): Promise<{
30
+ positions: LabelOutput[];
31
+ }>;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calculations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAsN1E;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,QAK/C;AAqCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAEnE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAEzF"}
@@ -0,0 +1,247 @@
1
+ // Fonte do worker — definida como função para que o TypeScript verifique os
2
+ // tipos do seu corpo.
3
+ // Em tempo de execução, Function.toString() retorna o JS compilado (sem tipos TS).
4
+ // Envolvemos em uma IIFE e carregamos em um Blob Worker.
5
+ function workerSource() {
6
+ function cubicBezier(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t) {
7
+ const t1 = 1 - t;
8
+ return {
9
+ x: t1 * t1 * t1 * p0x + 3 * t1 * t1 * t * p1x + 3 * t1 * t * t * p2x + t * t * t * p3x,
10
+ y: t1 * t1 * t1 * p0y + 3 * t1 * t1 * t * p1y + 3 * t1 * t * t * p2y + t * t * t * p3y,
11
+ };
12
+ }
13
+ function cubicBezierTangent(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t) {
14
+ const t1 = 1 - t;
15
+ return {
16
+ x: 3 * t1 * t1 * (p1x - p0x) + 6 * t1 * t * (p2x - p1x) + 3 * t * t * (p3x - p2x),
17
+ y: 3 * t1 * t1 * (p1y - p0y) + 6 * t1 * t * (p2y - p1y) + 3 * t * t * (p3y - p2y),
18
+ };
19
+ }
20
+ function normalAt(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t) {
21
+ const tang = cubicBezierTangent(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
22
+ const mag = Math.sqrt(tang.x * tang.x + tang.y * tang.y) || 1;
23
+ return { x: -tang.y / mag, y: tang.x / mag };
24
+ }
25
+ function buildLengthTable(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, n) {
26
+ const table = new Float64Array(n + 1);
27
+ table[0] = 0;
28
+ let prevX = p0x, prevY = p0y;
29
+ for (let i = 1; i <= n; i++) {
30
+ const t = i / n;
31
+ const pt = cubicBezier(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
32
+ const dx = pt.x - prevX, dy = pt.y - prevY;
33
+ table[i] = table[i - 1] + Math.sqrt(dx * dx + dy * dy);
34
+ prevX = pt.x;
35
+ prevY = pt.y;
36
+ }
37
+ return table;
38
+ }
39
+ function parameterAtLength(table, targetLen) {
40
+ const n = table.length - 1;
41
+ if (targetLen <= 0)
42
+ return 0;
43
+ if (targetLen >= table[n])
44
+ return 1;
45
+ let lo = 0, hi = n;
46
+ while (lo < hi - 1) {
47
+ const mid = (lo + hi) >> 1;
48
+ if (table[mid] < targetLen)
49
+ lo = mid;
50
+ else
51
+ hi = mid;
52
+ }
53
+ const segLen = table[hi] - table[lo];
54
+ const frac = segLen > 0 ? (targetLen - table[lo]) / segLen : 0;
55
+ return (lo + frac) / n;
56
+ }
57
+ function sampleOffsetPoints(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, offset, steps) {
58
+ const points = [];
59
+ for (let i = 0; i <= steps; i++) {
60
+ const t = i / steps;
61
+ const pt = cubicBezier(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
62
+ const n = normalAt(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
63
+ points.push({ x: pt.x + n.x * offset, y: pt.y + n.y * offset });
64
+ }
65
+ return points;
66
+ }
67
+ function pointsToSmoothPath(points) {
68
+ if (points.length < 2)
69
+ return "";
70
+ let d = "M " + points[0].x + " " + points[0].y;
71
+ for (let i = 0; i < points.length - 1; i++) {
72
+ const p0 = points[Math.max(0, i - 1)];
73
+ const p1 = points[i];
74
+ const p2 = points[i + 1];
75
+ const p3 = points[Math.min(points.length - 1, i + 2)];
76
+ const cp1x = p1.x + (p2.x - p0.x) / 6;
77
+ const cp1y = p1.y + (p2.y - p0.y) / 6;
78
+ const cp2x = p2.x - (p3.x - p1.x) / 6;
79
+ const cp2y = p2.y - (p3.y - p1.y) / 6;
80
+ d += " C " + cp1x + " " + cp1y + " " + cp2x + " " + cp2y + " " + p2.x + " " + p2.y;
81
+ }
82
+ return d;
83
+ }
84
+ // eslint-disable-next-line no-restricted-globals
85
+ const post = self.postMessage.bind(self);
86
+ // Calcula control point baseado na direcao da porta
87
+ function controlPoint(x, y, dir, dist) {
88
+ switch (dir) {
89
+ case "right": return { x: x + dist, y };
90
+ case "left": return { x: x - dist, y };
91
+ case "bottom": return { x, y: y + dist };
92
+ case "top": return { x, y: y - dist };
93
+ default: return { x: x + dist, y };
94
+ }
95
+ }
96
+ // eslint-disable-next-line no-restricted-globals
97
+ self.onmessage = function (e) {
98
+ const { type, id, ...data } = e.data;
99
+ if (type === "calculatePath") {
100
+ const { fromX, fromY, toX, toY, fromDir, toDir, gap, steps } = data;
101
+ const dx = toX - fromX;
102
+ const dy = toY - fromY;
103
+ const dist = Math.sqrt(dx * dx + dy * dy);
104
+ const cpDist = Math.max(50, dist * 0.4);
105
+ const cp1 = controlPoint(fromX, fromY, fromDir, cpDist);
106
+ const cp2 = controlPoint(toX, toY, toDir, cpDist);
107
+ const p0x = fromX, p0y = fromY;
108
+ const p1x = cp1.x, p1y = cp1.y;
109
+ const p2x = cp2.x, p2y = cp2.y;
110
+ const p3x = toX, p3y = toY;
111
+ const centerD = `M ${p0x} ${p0y} C ${p1x} ${p1y} ${p2x} ${p2y} ${p3x} ${p3y}`;
112
+ const halfGap = gap / 2;
113
+ const fwdPoints = sampleOffsetPoints(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, -halfGap, steps);
114
+ const revPoints = sampleOffsetPoints(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, halfGap, steps);
115
+ const padding = 50 + gap;
116
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
117
+ for (const pts of [fwdPoints, revPoints]) {
118
+ for (const p of pts) {
119
+ if (p.x < minX)
120
+ minX = p.x;
121
+ if (p.y < minY)
122
+ minY = p.y;
123
+ if (p.x > maxX)
124
+ maxX = p.x;
125
+ if (p.y > maxY)
126
+ maxY = p.y;
127
+ }
128
+ }
129
+ minX -= padding;
130
+ minY -= padding;
131
+ maxX += padding;
132
+ maxY += padding;
133
+ post({
134
+ type: "calculatePath", id, centerD,
135
+ forwardD: pointsToSmoothPath(fwdPoints),
136
+ reverseD: pointsToSmoothPath(revPoints),
137
+ bounds: { left: minX, top: minY, width: maxX - minX, height: maxY - minY },
138
+ });
139
+ }
140
+ else if (type === "calculateLabels") {
141
+ const { fromX, fromY, toX, toY, fromDir, toDir, halfGap, labels } = data;
142
+ const dx = toX - fromX;
143
+ const dy = toY - fromY;
144
+ const dist = Math.sqrt(dx * dx + dy * dy);
145
+ const cpDist = Math.max(50, dist * 0.4);
146
+ const cp1 = controlPoint(fromX, fromY, fromDir, cpDist);
147
+ const cp2 = controlPoint(toX, toY, toDir, cpDist);
148
+ const p0x = fromX, p0y = fromY;
149
+ const p1x = cp1.x, p1y = cp1.y;
150
+ const p2x = cp2.x, p2y = cp2.y;
151
+ const p3x = toX, p3y = toY;
152
+ const TABLE_SIZE = 200;
153
+ const table = buildLengthTable(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, TABLE_SIZE);
154
+ const totalLen = table[TABLE_SIZE];
155
+ const positions = labels.map((lbl) => {
156
+ const normalizedPos = Math.max(-1, Math.min(1, lbl.position));
157
+ const targetLen = ((normalizedPos + 1) / 2) * totalLen;
158
+ const t = parameterAtLength(table, targetLen);
159
+ const point = cubicBezier(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
160
+ const norm = normalAt(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t);
161
+ if (lbl.side === "forward" || lbl.side === "reverse") {
162
+ const sign = lbl.side === "forward" ? -1 : 1;
163
+ const totalDisplacement = (halfGap + (lbl.offset ?? 0)) * sign;
164
+ const x = point.x + norm.x * totalDisplacement;
165
+ const y = point.y + norm.y * totalDisplacement;
166
+ const outNx = norm.x * sign;
167
+ return { x, y, textAnchor: outNx < 0 ? "end" : "start" };
168
+ }
169
+ return { x: point.x, y: point.y, textAnchor: "middle" };
170
+ });
171
+ post({ type: "calculateLabels", id, positions });
172
+ }
173
+ };
174
+ }
175
+ let pool = null;
176
+ let roundRobin = 0;
177
+ let idCounter = 0;
178
+ let configuredSize = null;
179
+ /**
180
+ * Configura o tamanho do pool de workers.
181
+ * Deve ser chamado antes do primeiro cálculo para definir quantos workers
182
+ * serão instanciados (round-robin dispatch).
183
+ *
184
+ * Se não for chamado, o pool será criado automaticamente considerando a quantidade de
185
+ * núcleos do processador (navigator.hardwareConcurrency) limitado a um máximo de 4 workers.
186
+ *
187
+ * @param size Número de workers desejado (será arredondado para inteiro >= 1)
188
+ */
189
+ export function configureWorkerPool(size) {
190
+ if (pool) {
191
+ throw new Error("Worker pool ja foi inicializado. Configure antes do primeiro calculo.");
192
+ }
193
+ configuredSize = Math.max(1, Math.floor(size));
194
+ }
195
+ function getPool() {
196
+ if (!pool) {
197
+ const size = configuredSize ?? Math.max(1, Math.min(navigator.hardwareConcurrency ?? 2, 4));
198
+ const code = `(${workerSource.toString()})()`;
199
+ const blobUrl = URL.createObjectURL(new Blob([code], { type: 'application/javascript' }));
200
+ pool = Array.from({ length: size }, () => {
201
+ const pending = new Map();
202
+ const worker = new Worker(blobUrl);
203
+ worker.onmessage = (e) => {
204
+ const { id, ...rest } = e.data;
205
+ const cb = pending.get(id);
206
+ if (cb) {
207
+ cb(rest);
208
+ pending.delete(id);
209
+ }
210
+ };
211
+ return { worker, pending };
212
+ });
213
+ }
214
+ return pool;
215
+ }
216
+ function request(message) {
217
+ const workers = getPool();
218
+ const entry = workers[roundRobin % workers.length];
219
+ roundRobin++;
220
+ return new Promise((resolve) => {
221
+ const id = String(++idCounter);
222
+ entry.pending.set(id, resolve);
223
+ entry.worker.postMessage({ ...message, id });
224
+ });
225
+ }
226
+ /**
227
+ * Calcula os paths SVG (forward/reverse/center) e os bounds para um link
228
+ * entre duas portas. Esta função delega o trabalho a um worker do pool.
229
+ *
230
+ * @param input Dados de entrada para o cálculo do path
231
+ * @returns Promise contendo os dados de path e bounds
232
+ */
233
+ export function calculatePath(input) {
234
+ return request({ type: "calculatePath", ...input });
235
+ }
236
+ /**
237
+ * Calcula as posições dos rótulos (labels) ao longo do caminho entre duas
238
+ * portas. Retorna um array de posições que devem ser aplicadas como atributos
239
+ * de texto no DOM SVG.
240
+ *
241
+ * @param input Dados de entrada para cálculo de labels
242
+ * @returns Promise com posições dos labels
243
+ */
244
+ export function calculateLabels(input) {
245
+ return request({ type: "calculateLabels", ...input });
246
+ }
247
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calculations/index.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,sBAAsB;AACtB,mFAAmF;AACnF,yDAAyD;AACzD,SAAS,YAAY;IACjB,SAAS,WAAW,CAChB,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAClD,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,CAAS;QAE7D,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO;YACH,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG;YACtF,CAAC,EAAE,EAA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AC,CAAC;IACnD,UAAU,EAAE,CAAC;IAEb,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;QAC/B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,OAA8B,CAAC,CAAC;QACtD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgB;IAC1C,OAAO,OAAO,CAAa,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAAkB;IAC9C,OAAO,OAAO,CAA+B,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,43 @@
1
+ export type PortDirection = "left" | "right" | "top" | "bottom";
2
+ export type PathInput = {
3
+ fromX: number;
4
+ fromY: number;
5
+ toX: number;
6
+ toY: number;
7
+ fromDir: PortDirection;
8
+ toDir: PortDirection;
9
+ gap: number;
10
+ steps: number;
11
+ };
12
+ export type PathOutput = {
13
+ centerD: string;
14
+ forwardD: string;
15
+ reverseD: string;
16
+ bounds: {
17
+ left: number;
18
+ top: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ };
23
+ export type LabelInput = {
24
+ position: number;
25
+ side: string;
26
+ offset: number;
27
+ };
28
+ export type LabelsInput = {
29
+ fromX: number;
30
+ fromY: number;
31
+ toX: number;
32
+ toY: number;
33
+ fromDir: PortDirection;
34
+ toDir: PortDirection;
35
+ halfGap: number;
36
+ labels: LabelInput[];
37
+ };
38
+ export type LabelOutput = {
39
+ x: number;
40
+ y: number;
41
+ textAnchor: string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,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/calculations/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { ConnectionContextProps } from "../types";
2
+ export declare const ConnectionContext: import("react").Context<ConnectionContextProps>;
3
+ //# sourceMappingURL=connection-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-context.d.ts","sourceRoot":"","sources":["../../src/context/connection-context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlD,eAAO,MAAM,iBAAiB,iDAU5B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { createContext } from "react";
2
+ export const ConnectionContext = createContext({
3
+ connections: [],
4
+ dragState: { active: false },
5
+ getGraphApi: () => null,
6
+ connect: () => { },
7
+ disconnect: () => { },
8
+ startDrag: () => { },
9
+ endDrag: () => { },
10
+ registerPort: () => { },
11
+ unregisterPort: () => { },
12
+ });
13
+ //# sourceMappingURL=connection-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-context.js","sourceRoot":"","sources":["../../src/context/connection-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAyB;IACnE,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IAC5B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI;IACvB,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC;IAClB,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC;IACrB,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,EAAE,GAAG,CAAC;IACvB,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC;CAC5B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ErrorContextProps } from "../types";
2
+ export declare const ErrorContext: import("react").Context<ErrorContextProps>;
3
+ //# sourceMappingURL=error-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-context.d.ts","sourceRoot":"","sources":["../../src/context/error-context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,YAAY,4CAEvB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ export const ErrorContext = createContext({
3
+ reportError: () => { },
4
+ });
5
+ //# sourceMappingURL=error-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-context.js","sourceRoot":"","sources":["../../src/context/error-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAoB;IACzD,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;CACzB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { GraphContextProps } from "../types";
2
+ export declare const GraphContext: import("react").Context<GraphContextProps>;
3
+ //# sourceMappingURL=graph-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-context.d.ts","sourceRoot":"","sources":["../../src/context/graph-context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK7C,eAAO,MAAM,YAAY,4CAKvB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { createContext } from "react";
2
+ export const GraphContext = createContext({
3
+ viewbox: { x: 0, y: 0, width: 0, height: 0, zoom: 0 },
4
+ nodes: [],
5
+ links: [],
6
+ mode: "edit",
7
+ });
8
+ //# sourceMappingURL=graph-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-context.js","sourceRoot":"","sources":["../../src/context/graph-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAMtC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAoB;IACzD,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IACrD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,MAAM;CACf,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Contexto que fornece a ref do elemento raiz (graph-root) do grafo.
3
+ * Permite que componentes internos façam querySelector no escopo
4
+ * correto, possibilitando múltiplas instâncias do graph na mesma página.
5
+ */
6
+ export declare const GraphRootContext: import("react").Context<import("react").RefObject<HTMLElement | null>>;
7
+ //# sourceMappingURL=graph-root-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-root-context.d.ts","sourceRoot":"","sources":["../../src/context/graph-root-context.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,wEAAwE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { createContext } from "react";
2
+ /**
3
+ * Contexto que fornece a ref do elemento raiz (graph-root) do grafo.
4
+ * Permite que componentes internos façam querySelector no escopo
5
+ * correto, possibilitando múltiplas instâncias do graph na mesma página.
6
+ */
7
+ export const GraphRootContext = createContext({ current: null });
8
+ //# sourceMappingURL=graph-root-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-root-context.js","sourceRoot":"","sources":["../../src/context/graph-root-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAsC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ .App {
2
+ text-align: center;
3
+ }
4
+
5
+ .App-logo {
6
+ height: 40vmin;
7
+ pointer-events: none;
8
+ }
9
+
10
+ @media (prefers-reduced-motion: no-preference) {
11
+ .App-logo {
12
+ animation: App-logo-spin infinite 20s linear;
13
+ }
14
+ }
15
+
16
+ .App-header {
17
+ background-color: #282c34;
18
+ min-height: 100vh;
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ justify-content: center;
23
+ font-size: calc(10px + 2vmin);
24
+ color: white;
25
+ }
26
+
27
+ .App-link {
28
+ color: #61dafb;
29
+ }
30
+
31
+ @keyframes App-logo-spin {
32
+ from {
33
+ transform: rotate(0deg);
34
+ }
35
+
36
+ to {
37
+ transform: rotate(360deg);
38
+ }
39
+ }
@@ -0,0 +1,3 @@
1
+ declare function App(): import("react/jsx-runtime").JSX.Element;
2
+ export default App;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/example/App.tsx"],"names":[],"mappings":"AAGA,iBAAS,GAAG,4CAIX;AAED,eAAe,GAAG,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import GraphTest from "./graph-teste";
3
+ function App() {
4
+ return (_jsx(GraphTest, {}));
5
+ }
6
+ export default App;
7
+ //# sourceMappingURL=App.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/example/App.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,eAAe,CAAC;AAGtC,SAAS,GAAG;IACV,OAAO,CACL,KAAC,SAAS,KAAG,CACd,CAAC;AACJ,CAAC;AAED,eAAe,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default function GraphTest(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=graph-teste.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-teste.d.ts","sourceRoot":"","sources":["../../src/example/graph-teste.tsx"],"names":[],"mappings":"AA2LA,MAAM,CAAC,OAAO,UAAU,SAAS,4CAiEhC"}