egraph 4.0.1-alpha.8 → 6.0.0-alpha.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,524 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * @param {Graph} graph
5
+ * @param {Function} groups
6
+ * @param {Function} shrink_node
7
+ * @param {Function} shrink_edge
8
+ * @returns {any}
9
+ */
10
+ export function coarsen(graph: Graph, groups: Function, shrink_node: Function, shrink_edge: Function): any;
11
+ /**
12
+ * @param {Graph} graph
13
+ * @param {any} coordinates
14
+ * @returns {any}
15
+ */
16
+ export function fdeb(graph: Graph, coordinates: any): any;
17
+ /**
18
+ * @param {Graph} graph
19
+ * @param {number} min_size
20
+ * @param {number} step_iteration
21
+ * @param {Function} _shrink_node
22
+ * @param {Function} _shrink_edge
23
+ * @param {Function} _link_distance_accessor
24
+ * @returns {Coordinates}
25
+ */
26
+ export function fm3(graph: Graph, min_size: number, step_iteration: number, _shrink_node: Function, _shrink_edge: Function, _link_distance_accessor: Function): Coordinates;
27
+ /**
28
+ * @param {Graph} graph
29
+ * @param {Coordinates} coordinates
30
+ * @param {Function} _length
31
+ * @param {number} eps
32
+ * @param {number} width
33
+ * @param {number} height
34
+ * @returns {any}
35
+ */
36
+ export function kamadaKawai(graph: Graph, coordinates: Coordinates, _length: Function, eps: number, width: number, height: number): any;
37
+ /**
38
+ */
39
+ export class CollideForce {
40
+ free(): void;
41
+ /**
42
+ * @param {Graph} graph
43
+ * @param {Function} f
44
+ * @param {any} options
45
+ */
46
+ constructor(graph: Graph, f: Function, options: any);
47
+ /**
48
+ * @param {Coordinates} context
49
+ * @param {number} alpha
50
+ */
51
+ apply(context: Coordinates, alpha: number): void;
52
+ }
53
+ /**
54
+ */
55
+ export class Coordinates {
56
+ free(): void;
57
+ /**
58
+ * @param {number} u
59
+ * @returns {number | undefined}
60
+ */
61
+ x(u: number): number | undefined;
62
+ /**
63
+ * @param {number} u
64
+ * @returns {number | undefined}
65
+ */
66
+ y(u: number): number | undefined;
67
+ /**
68
+ * @param {number} u
69
+ * @param {number} x
70
+ */
71
+ setX(u: number, x: number): void;
72
+ /**
73
+ * @param {number} u
74
+ * @param {number} y
75
+ */
76
+ setY(u: number, y: number): void;
77
+ /**
78
+ * @param {number} u
79
+ * @returns {number | undefined}
80
+ */
81
+ vx(u: number): number | undefined;
82
+ /**
83
+ * @param {number} u
84
+ * @returns {number | undefined}
85
+ */
86
+ vy(u: number): number | undefined;
87
+ /**
88
+ * @returns {number}
89
+ */
90
+ len(): number;
91
+ /**
92
+ * @returns {any}
93
+ */
94
+ toJSON(): any;
95
+ /**
96
+ */
97
+ centralize(): void;
98
+ /**
99
+ * @param {number} velocity_decay
100
+ */
101
+ updatePosition(velocity_decay: number): void;
102
+ /**
103
+ * @param {number} x0
104
+ * @param {number} y0
105
+ * @param {number} x1
106
+ * @param {number} y1
107
+ */
108
+ clampRegion(x0: number, y0: number, x1: number, y1: number): void;
109
+ /**
110
+ * @param {Graph} graph
111
+ * @returns {Coordinates}
112
+ */
113
+ static initialPlacement(graph: Graph): Coordinates;
114
+ }
115
+ /**
116
+ */
117
+ export class FruchtermanReingoldForce {
118
+ free(): void;
119
+ /**
120
+ * @param {Graph} graph
121
+ * @param {number} k
122
+ * @param {number} min_distance
123
+ */
124
+ constructor(graph: Graph, k: number, min_distance: number);
125
+ /**
126
+ * @param {Coordinates} coordinates
127
+ * @param {number} alpha
128
+ */
129
+ apply(coordinates: Coordinates, alpha: number): void;
130
+ /**
131
+ * @param {number} u
132
+ * @param {Coordinates} coordinates
133
+ * @param {number} alpha
134
+ */
135
+ applyToNode(u: number, coordinates: Coordinates, alpha: number): void;
136
+ }
137
+ /**
138
+ */
139
+ export class Graph {
140
+ free(): void;
141
+ /**
142
+ */
143
+ constructor();
144
+ /**
145
+ * @returns {number}
146
+ */
147
+ nodeCount(): number;
148
+ /**
149
+ * @returns {number}
150
+ */
151
+ edgeCount(): number;
152
+ /**
153
+ * @param {any} value
154
+ * @returns {number}
155
+ */
156
+ addNode(value: any): number;
157
+ /**
158
+ * @param {number} a
159
+ * @returns {any}
160
+ */
161
+ nodeWeight(a: number): any;
162
+ /**
163
+ * @param {number} a
164
+ * @param {number} b
165
+ * @param {any} value
166
+ * @returns {number}
167
+ */
168
+ addEdge(a: number, b: number, value: any): number;
169
+ /**
170
+ * @param {number} e
171
+ * @returns {any}
172
+ */
173
+ edgeWeight(e: number): any;
174
+ /**
175
+ * @param {number} e
176
+ * @returns {Array<any>}
177
+ */
178
+ edgeEndpoints(e: number): Array<any>;
179
+ /**
180
+ * @param {number} a
181
+ * @returns {any}
182
+ */
183
+ removeNode(a: number): any;
184
+ /**
185
+ * @param {number} e
186
+ * @returns {any}
187
+ */
188
+ removeEdge(e: number): any;
189
+ /**
190
+ * @param {number} a
191
+ * @returns {Array<any>}
192
+ */
193
+ neighbors(a: number): Array<any>;
194
+ /**
195
+ * @param {number} a
196
+ * @param {number} dir
197
+ * @returns {Array<any>}
198
+ */
199
+ neighborsDirected(a: number, dir: number): Array<any>;
200
+ /**
201
+ * @param {number} a
202
+ * @returns {Array<any>}
203
+ */
204
+ neighborsUndirected(a: number): Array<any>;
205
+ /**
206
+ * @param {number} a
207
+ * @returns {Array<any>}
208
+ */
209
+ edges(a: number): Array<any>;
210
+ /**
211
+ * @param {number} a
212
+ * @param {number} b
213
+ * @returns {boolean}
214
+ */
215
+ containsEdge(a: number, b: number): boolean;
216
+ /**
217
+ * @param {number} a
218
+ * @param {number} b
219
+ * @returns {number}
220
+ */
221
+ findEdge(a: number, b: number): number;
222
+ /**
223
+ * @param {number} dir
224
+ * @returns {Array<any>}
225
+ */
226
+ externals(dir: number): Array<any>;
227
+ /**
228
+ * @returns {Array<any>}
229
+ */
230
+ nodeIndices(): Array<any>;
231
+ /**
232
+ * @returns {Array<any>}
233
+ */
234
+ edgeIndices(): Array<any>;
235
+ /**
236
+ * @param {Function} node_map
237
+ * @param {Function} edge_map
238
+ * @returns {Graph}
239
+ */
240
+ map(node_map: Function, edge_map: Function): Graph;
241
+ /**
242
+ * @param {Function} node_map
243
+ * @param {Function} edge_map
244
+ * @returns {Graph}
245
+ */
246
+ filterMap(node_map: Function, edge_map: Function): Graph;
247
+ }
248
+ /**
249
+ */
250
+ export class GroupLinkForce {
251
+ free(): void;
252
+ /**
253
+ * @param {Graph} graph
254
+ * @param {Function} group_accessor
255
+ * @param {Function} inter_link_accessor
256
+ * @param {Function} intra_link_accessor
257
+ */
258
+ constructor(graph: Graph, group_accessor: Function, inter_link_accessor: Function, intra_link_accessor: Function);
259
+ /**
260
+ * @param {Coordinates} coordinates
261
+ * @param {number} alpha
262
+ */
263
+ apply(coordinates: Coordinates, alpha: number): void;
264
+ }
265
+ /**
266
+ */
267
+ export class GroupManyBodyForce {
268
+ free(): void;
269
+ /**
270
+ * @param {Graph} graph
271
+ * @param {Function} node_accessor
272
+ */
273
+ constructor(graph: Graph, node_accessor: Function);
274
+ /**
275
+ * @param {Coordinates} coordinates
276
+ * @param {number} alpha
277
+ */
278
+ apply(coordinates: Coordinates, alpha: number): void;
279
+ }
280
+ /**
281
+ */
282
+ export class GroupPositionForce {
283
+ free(): void;
284
+ /**
285
+ * @param {Graph} graph
286
+ * @param {Function} node_accessor
287
+ * @param {Function} group_accessor
288
+ */
289
+ constructor(graph: Graph, node_accessor: Function, group_accessor: Function);
290
+ /**
291
+ * @param {Coordinates} coordinates
292
+ * @param {number} alpha
293
+ */
294
+ apply(coordinates: Coordinates, alpha: number): void;
295
+ }
296
+ /**
297
+ */
298
+ export class HyperbolicSpace {
299
+ free(): void;
300
+ /**
301
+ * @param {any} a
302
+ * @param {any} b
303
+ * @returns {any}
304
+ */
305
+ static toTangentSpace(a: any, b: any): any;
306
+ /**
307
+ * @param {any} a
308
+ * @param {any} b
309
+ * @returns {any}
310
+ */
311
+ static fromTangentSpace(a: any, b: any): any;
312
+ /**
313
+ * @param {number} i
314
+ * @param {Coordinates} riemann_space
315
+ * @param {Coordinates} tangent_space
316
+ */
317
+ static mapToTangentSpace(i: number, riemann_space: Coordinates, tangent_space: Coordinates): void;
318
+ /**
319
+ * @param {number} i
320
+ * @param {Coordinates} riemann_space
321
+ * @param {Coordinates} tangent_space
322
+ * @param {number} velocity_decay
323
+ */
324
+ static updatePosition(i: number, riemann_space: Coordinates, tangent_space: Coordinates, velocity_decay: number): void;
325
+ }
326
+ /**
327
+ */
328
+ export class KamadaKawai {
329
+ free(): void;
330
+ /**
331
+ * @param {Graph} graph
332
+ * @param {Function} f
333
+ */
334
+ constructor(graph: Graph, f: Function);
335
+ /**
336
+ * @param {Coordinates} coordinates
337
+ * @returns {number | undefined}
338
+ */
339
+ selectNode(coordinates: Coordinates): number | undefined;
340
+ /**
341
+ * @param {number} m
342
+ * @param {Coordinates} coordinates
343
+ */
344
+ applyToNode(m: number, coordinates: Coordinates): void;
345
+ /**
346
+ * @param {Coordinates} coordinates
347
+ */
348
+ run(coordinates: Coordinates): void;
349
+ }
350
+ /**
351
+ */
352
+ export class LinkForce {
353
+ free(): void;
354
+ /**
355
+ * @param {Graph} graph
356
+ * @param {Function} f
357
+ */
358
+ constructor(graph: Graph, f: Function);
359
+ /**
360
+ * @param {Coordinates} coordinates
361
+ * @param {number} alpha
362
+ */
363
+ apply(coordinates: Coordinates, alpha: number): void;
364
+ /**
365
+ * @param {number} u
366
+ * @param {Coordinates} coordinates
367
+ * @param {number} alpha
368
+ */
369
+ applyToNode(u: number, coordinates: Coordinates, alpha: number): void;
370
+ }
371
+ /**
372
+ */
373
+ export class ManyBodyForce {
374
+ free(): void;
375
+ /**
376
+ * @param {Graph} graph
377
+ * @param {Function} f
378
+ */
379
+ constructor(graph: Graph, f: Function);
380
+ /**
381
+ * @param {Coordinates} coordinates
382
+ * @param {number} alpha
383
+ */
384
+ apply(coordinates: Coordinates, alpha: number): void;
385
+ /**
386
+ * @param {number} u
387
+ * @param {Coordinates} coordinates
388
+ * @param {number} alpha
389
+ */
390
+ applyToNode(u: number, coordinates: Coordinates, alpha: number): void;
391
+ }
392
+ /**
393
+ */
394
+ export class PositionForce {
395
+ free(): void;
396
+ /**
397
+ * @param {Graph} graph
398
+ * @param {Function} f
399
+ */
400
+ constructor(graph: Graph, f: Function);
401
+ /**
402
+ * @param {Coordinates} coordinates
403
+ * @param {number} alpha
404
+ */
405
+ apply(coordinates: Coordinates, alpha: number): void;
406
+ /**
407
+ * @param {number} u
408
+ * @param {Coordinates} coordinates
409
+ * @param {number} alpha
410
+ */
411
+ applyToNode(u: number, coordinates: Coordinates, alpha: number): void;
412
+ }
413
+ /**
414
+ */
415
+ export class RadialForce {
416
+ free(): void;
417
+ /**
418
+ * @param {Graph} graph
419
+ * @param {Function} f
420
+ */
421
+ constructor(graph: Graph, f: Function);
422
+ /**
423
+ * @param {Coordinates} coordinates
424
+ * @param {number} alpha
425
+ */
426
+ apply(coordinates: Coordinates, alpha: number): void;
427
+ /**
428
+ * @param {number} u
429
+ * @param {Coordinates} coordinates
430
+ * @param {number} alpha
431
+ */
432
+ applyToNode(u: number, coordinates: Coordinates, alpha: number): void;
433
+ }
434
+ /**
435
+ */
436
+ export class Simulation {
437
+ free(): void;
438
+ /**
439
+ */
440
+ constructor();
441
+ /**
442
+ * @param {Function} f
443
+ */
444
+ run(f: Function): void;
445
+ /**
446
+ * @param {number} n
447
+ * @param {Function} f
448
+ */
449
+ runStep(n: number, f: Function): void;
450
+ /**
451
+ * @returns {boolean}
452
+ */
453
+ isFinished(): boolean;
454
+ /**
455
+ * @param {number} alpha_start
456
+ */
457
+ reset(alpha_start: number): void;
458
+ /**
459
+ * @returns {number}
460
+ */
461
+ alphaMin: number;
462
+ /**
463
+ * @returns {number}
464
+ */
465
+ alphaStart: number;
466
+ /**
467
+ * @returns {number}
468
+ */
469
+ alphaTarget: number;
470
+ /**
471
+ * @returns {number}
472
+ */
473
+ iterations: number;
474
+ }
475
+ /**
476
+ */
477
+ export class SphericalSpace {
478
+ free(): void;
479
+ /**
480
+ * @param {any} a
481
+ * @param {any} b
482
+ * @returns {any}
483
+ */
484
+ static toTangentSpace(a: any, b: any): any;
485
+ /**
486
+ * @param {any} a
487
+ * @param {any} b
488
+ * @returns {any}
489
+ */
490
+ static fromTangentSpace(a: any, b: any): any;
491
+ /**
492
+ * @param {number} i
493
+ * @param {Coordinates} riemann_space
494
+ * @param {Coordinates} tangent_space
495
+ */
496
+ static mapToTangentSpace(i: number, riemann_space: Coordinates, tangent_space: Coordinates): void;
497
+ /**
498
+ * @param {number} i
499
+ * @param {Coordinates} riemann_space
500
+ * @param {Coordinates} tangent_space
501
+ * @param {number} velocity_decay
502
+ */
503
+ static updatePosition(i: number, riemann_space: Coordinates, tangent_space: Coordinates, velocity_decay: number): void;
504
+ }
505
+ /**
506
+ */
507
+ export class StressMajorization {
508
+ free(): void;
509
+ /**
510
+ * @param {Graph} graph
511
+ * @param {Coordinates} coordinates
512
+ * @param {Function} f
513
+ */
514
+ constructor(graph: Graph, coordinates: Coordinates, f: Function);
515
+ /**
516
+ * @param {Coordinates} coordinates
517
+ * @returns {number}
518
+ */
519
+ apply(coordinates: Coordinates): number;
520
+ /**
521
+ * @param {Coordinates} coordinates
522
+ */
523
+ run(coordinates: Coordinates): void;
524
+ }
@@ -0,0 +1,2 @@
1
+ import * as wasm from "./egraph_wasm_bg.wasm";
2
+ export * from "./egraph_wasm_bg.js";
Binary file