egraph 5.0.0 → 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.
- package/dist/bundler/egraph_wasm.d.ts +333 -37
- package/dist/bundler/egraph_wasm_bg.wasm +0 -0
- package/dist/no-modules/egraph_wasm.d.ts +614 -261
- package/dist/no-modules/egraph_wasm.js +938 -203
- package/dist/no-modules/egraph_wasm_bg.wasm +0 -0
- package/dist/nodejs/egraph_wasm.d.ts +333 -37
- package/dist/nodejs/egraph_wasm.js +940 -204
- package/dist/nodejs/egraph_wasm_bg.wasm +0 -0
- package/dist/web/egraph_wasm.d.ts +418 -68
- package/dist/web/egraph_wasm.js +925 -200
- package/dist/web/egraph_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/umd/egraph.js +0 -840
- package/umd/egraph_bg.wasm +0 -0
|
@@ -3,22 +3,6 @@ let wasm_bindgen;
|
|
|
3
3
|
const __exports = {};
|
|
4
4
|
let wasm;
|
|
5
5
|
|
|
6
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
7
|
-
|
|
8
|
-
cachedTextDecoder.decode();
|
|
9
|
-
|
|
10
|
-
let cachegetUint8Memory0 = null;
|
|
11
|
-
function getUint8Memory0() {
|
|
12
|
-
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
13
|
-
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
14
|
-
}
|
|
15
|
-
return cachegetUint8Memory0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function getStringFromWasm0(ptr, len) {
|
|
19
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
6
|
const heap = new Array(32).fill(undefined);
|
|
23
7
|
|
|
24
8
|
heap.push(undefined, null, true, false);
|
|
@@ -48,6 +32,42 @@ function takeObject(idx) {
|
|
|
48
32
|
return ret;
|
|
49
33
|
}
|
|
50
34
|
|
|
35
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
36
|
+
|
|
37
|
+
cachedTextDecoder.decode();
|
|
38
|
+
|
|
39
|
+
let cachegetUint8Memory0 = null;
|
|
40
|
+
function getUint8Memory0() {
|
|
41
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
42
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
43
|
+
}
|
|
44
|
+
return cachegetUint8Memory0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getStringFromWasm0(ptr, len) {
|
|
48
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isLikeNone(x) {
|
|
52
|
+
return x === undefined || x === null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let cachegetFloat64Memory0 = null;
|
|
56
|
+
function getFloat64Memory0() {
|
|
57
|
+
if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
|
|
58
|
+
cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
59
|
+
}
|
|
60
|
+
return cachegetFloat64Memory0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let cachegetInt32Memory0 = null;
|
|
64
|
+
function getInt32Memory0() {
|
|
65
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
66
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
67
|
+
}
|
|
68
|
+
return cachegetInt32Memory0;
|
|
69
|
+
}
|
|
70
|
+
|
|
51
71
|
let WASM_VECTOR_LEN = 0;
|
|
52
72
|
|
|
53
73
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -103,26 +123,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
103
123
|
return ptr;
|
|
104
124
|
}
|
|
105
125
|
|
|
106
|
-
let cachegetInt32Memory0 = null;
|
|
107
|
-
function getInt32Memory0() {
|
|
108
|
-
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
109
|
-
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
110
|
-
}
|
|
111
|
-
return cachegetInt32Memory0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function isLikeNone(x) {
|
|
115
|
-
return x === undefined || x === null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
let cachegetFloat64Memory0 = null;
|
|
119
|
-
function getFloat64Memory0() {
|
|
120
|
-
if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
|
|
121
|
-
cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
122
|
-
}
|
|
123
|
-
return cachegetFloat64Memory0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
126
|
function debugString(val) {
|
|
127
127
|
// primitive types
|
|
128
128
|
const type = typeof val;
|
|
@@ -194,35 +194,6 @@ function _assertClass(instance, klass) {
|
|
|
194
194
|
}
|
|
195
195
|
return instance.ptr;
|
|
196
196
|
}
|
|
197
|
-
/**
|
|
198
|
-
* @param {Graph} graph
|
|
199
|
-
* @returns {any}
|
|
200
|
-
*/
|
|
201
|
-
__exports.initialPlacement = function(graph) {
|
|
202
|
-
_assertClass(graph, Graph);
|
|
203
|
-
var ret = wasm.initialPlacement(graph.ptr);
|
|
204
|
-
return takeObject(ret);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* @param {Graph} graph
|
|
209
|
-
* @returns {Array<any>}
|
|
210
|
-
*/
|
|
211
|
-
__exports.forceConnected = function(graph) {
|
|
212
|
-
_assertClass(graph, Graph);
|
|
213
|
-
var ret = wasm.forceConnected(graph.ptr);
|
|
214
|
-
return takeObject(ret);
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* @param {Graph} graph
|
|
219
|
-
* @returns {Array<any>}
|
|
220
|
-
*/
|
|
221
|
-
__exports.forceNonconnected = function(graph) {
|
|
222
|
-
_assertClass(graph, Graph);
|
|
223
|
-
var ret = wasm.forceNonconnected(graph.ptr);
|
|
224
|
-
return takeObject(ret);
|
|
225
|
-
};
|
|
226
197
|
|
|
227
198
|
let stack_pointer = 32;
|
|
228
199
|
|
|
@@ -233,49 +204,36 @@ function addBorrowedObject(obj) {
|
|
|
233
204
|
}
|
|
234
205
|
/**
|
|
235
206
|
* @param {Graph} graph
|
|
236
|
-
* @param {Function}
|
|
237
|
-
* @
|
|
207
|
+
* @param {Function} groups
|
|
208
|
+
* @param {Function} shrink_node
|
|
209
|
+
* @param {Function} shrink_edge
|
|
210
|
+
* @returns {any}
|
|
238
211
|
*/
|
|
239
|
-
__exports.
|
|
212
|
+
__exports.coarsen = function(graph, groups, shrink_node, shrink_edge) {
|
|
240
213
|
try {
|
|
241
214
|
_assertClass(graph, Graph);
|
|
242
|
-
var ret = wasm.
|
|
215
|
+
var ret = wasm.coarsen(graph.ptr, addBorrowedObject(groups), addBorrowedObject(shrink_node), addBorrowedObject(shrink_edge));
|
|
243
216
|
return takeObject(ret);
|
|
244
217
|
} finally {
|
|
245
218
|
heap[stack_pointer++] = undefined;
|
|
219
|
+
heap[stack_pointer++] = undefined;
|
|
220
|
+
heap[stack_pointer++] = undefined;
|
|
246
221
|
}
|
|
247
222
|
};
|
|
248
223
|
|
|
249
|
-
let cachegetUint32Memory0 = null;
|
|
250
|
-
function getUint32Memory0() {
|
|
251
|
-
if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
|
|
252
|
-
cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
253
|
-
}
|
|
254
|
-
return cachegetUint32Memory0;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
258
|
-
const ptr = malloc(array.length * 4);
|
|
259
|
-
const mem = getUint32Memory0();
|
|
260
|
-
for (let i = 0; i < array.length; i++) {
|
|
261
|
-
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
262
|
-
}
|
|
263
|
-
WASM_VECTOR_LEN = array.length;
|
|
264
|
-
return ptr;
|
|
265
|
-
}
|
|
266
224
|
/**
|
|
267
225
|
* @param {Graph} graph
|
|
268
226
|
* @param {any} coordinates
|
|
269
|
-
* @param {Function} _length
|
|
270
|
-
* @param {number} eps
|
|
271
|
-
* @param {number} width
|
|
272
|
-
* @param {number} height
|
|
273
227
|
* @returns {any}
|
|
274
228
|
*/
|
|
275
|
-
__exports.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
229
|
+
__exports.fdeb = function(graph, coordinates) {
|
|
230
|
+
try {
|
|
231
|
+
_assertClass(graph, Graph);
|
|
232
|
+
var ret = wasm.fdeb(graph.ptr, addBorrowedObject(coordinates));
|
|
233
|
+
return takeObject(ret);
|
|
234
|
+
} finally {
|
|
235
|
+
heap[stack_pointer++] = undefined;
|
|
236
|
+
}
|
|
279
237
|
};
|
|
280
238
|
|
|
281
239
|
/**
|
|
@@ -285,76 +243,283 @@ __exports.kamadaKawai = function(graph, coordinates, _length, eps, width, height
|
|
|
285
243
|
* @param {Function} _shrink_node
|
|
286
244
|
* @param {Function} _shrink_edge
|
|
287
245
|
* @param {Function} _link_distance_accessor
|
|
288
|
-
* @returns {
|
|
246
|
+
* @returns {Coordinates}
|
|
289
247
|
*/
|
|
290
248
|
__exports.fm3 = function(graph, min_size, step_iteration, _shrink_node, _shrink_edge, _link_distance_accessor) {
|
|
291
249
|
_assertClass(graph, Graph);
|
|
292
250
|
var ret = wasm.fm3(graph.ptr, min_size, step_iteration, addHeapObject(_shrink_node), addHeapObject(_shrink_edge), addHeapObject(_link_distance_accessor));
|
|
293
|
-
return
|
|
251
|
+
return Coordinates.__wrap(ret);
|
|
294
252
|
};
|
|
295
253
|
|
|
254
|
+
let cachegetFloat32Memory0 = null;
|
|
255
|
+
function getFloat32Memory0() {
|
|
256
|
+
if (cachegetFloat32Memory0 === null || cachegetFloat32Memory0.buffer !== wasm.memory.buffer) {
|
|
257
|
+
cachegetFloat32Memory0 = new Float32Array(wasm.memory.buffer);
|
|
258
|
+
}
|
|
259
|
+
return cachegetFloat32Memory0;
|
|
260
|
+
}
|
|
296
261
|
/**
|
|
297
262
|
* @param {Graph} graph
|
|
298
|
-
* @param {
|
|
263
|
+
* @param {Coordinates} coordinates
|
|
264
|
+
* @param {Function} _length
|
|
265
|
+
* @param {number} eps
|
|
266
|
+
* @param {number} width
|
|
267
|
+
* @param {number} height
|
|
299
268
|
* @returns {any}
|
|
300
269
|
*/
|
|
301
|
-
__exports.
|
|
270
|
+
__exports.kamadaKawai = function(graph, coordinates, _length, eps, width, height) {
|
|
271
|
+
_assertClass(graph, Graph);
|
|
272
|
+
_assertClass(coordinates, Coordinates);
|
|
273
|
+
var ret = wasm.kamadaKawai(graph.ptr, coordinates.ptr, addHeapObject(_length), eps, width, height);
|
|
274
|
+
return takeObject(ret);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
function handleError(f, args) {
|
|
302
278
|
try {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
} finally {
|
|
307
|
-
heap[stack_pointer++] = undefined;
|
|
279
|
+
return f.apply(this, args);
|
|
280
|
+
} catch (e) {
|
|
281
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
308
282
|
}
|
|
309
|
-
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
*/
|
|
286
|
+
class CollideForce {
|
|
310
287
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
288
|
+
static __wrap(ptr) {
|
|
289
|
+
const obj = Object.create(CollideForce.prototype);
|
|
290
|
+
obj.ptr = ptr;
|
|
291
|
+
|
|
292
|
+
return obj;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
__destroy_into_raw() {
|
|
296
|
+
const ptr = this.ptr;
|
|
297
|
+
this.ptr = 0;
|
|
315
298
|
|
|
316
|
-
|
|
317
|
-
|
|
299
|
+
return ptr;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
free() {
|
|
303
|
+
const ptr = this.__destroy_into_raw();
|
|
304
|
+
wasm.__wbg_collideforce_free(ptr);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @param {Graph} graph
|
|
308
|
+
* @param {Function} f
|
|
309
|
+
* @param {any} options
|
|
310
|
+
*/
|
|
311
|
+
constructor(graph, f, options) {
|
|
312
|
+
try {
|
|
313
|
+
_assertClass(graph, Graph);
|
|
314
|
+
var ret = wasm.collideforce_new(graph.ptr, addBorrowedObject(f), addBorrowedObject(options));
|
|
315
|
+
return CollideForce.__wrap(ret);
|
|
316
|
+
} finally {
|
|
317
|
+
heap[stack_pointer++] = undefined;
|
|
318
|
+
heap[stack_pointer++] = undefined;
|
|
318
319
|
}
|
|
319
|
-
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* @param {Coordinates} context
|
|
323
|
+
* @param {number} alpha
|
|
324
|
+
*/
|
|
325
|
+
apply(context, alpha) {
|
|
326
|
+
_assertClass(context, Coordinates);
|
|
327
|
+
wasm.collideforce_apply(this.ptr, context.ptr, alpha);
|
|
328
|
+
}
|
|
320
329
|
}
|
|
330
|
+
__exports.CollideForce = CollideForce;
|
|
321
331
|
/**
|
|
322
332
|
*/
|
|
323
|
-
class
|
|
333
|
+
class Coordinates {
|
|
324
334
|
|
|
325
|
-
|
|
335
|
+
static __wrap(ptr) {
|
|
336
|
+
const obj = Object.create(Coordinates.prototype);
|
|
337
|
+
obj.ptr = ptr;
|
|
338
|
+
|
|
339
|
+
return obj;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
__destroy_into_raw() {
|
|
326
343
|
const ptr = this.ptr;
|
|
327
344
|
this.ptr = 0;
|
|
328
345
|
|
|
329
|
-
|
|
346
|
+
return ptr;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
free() {
|
|
350
|
+
const ptr = this.__destroy_into_raw();
|
|
351
|
+
wasm.__wbg_coordinates_free(ptr);
|
|
330
352
|
}
|
|
331
353
|
/**
|
|
354
|
+
* @param {number} u
|
|
355
|
+
* @returns {number | undefined}
|
|
332
356
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
357
|
+
x(u) {
|
|
358
|
+
try {
|
|
359
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
360
|
+
wasm.coordinates_x(retptr, this.ptr, u);
|
|
361
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
362
|
+
var r1 = getFloat32Memory0()[retptr / 4 + 1];
|
|
363
|
+
return r0 === 0 ? undefined : r1;
|
|
364
|
+
} finally {
|
|
365
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* @param {number} u
|
|
370
|
+
* @returns {number | undefined}
|
|
371
|
+
*/
|
|
372
|
+
y(u) {
|
|
373
|
+
try {
|
|
374
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
+
wasm.coordinates_y(retptr, this.ptr, u);
|
|
376
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
377
|
+
var r1 = getFloat32Memory0()[retptr / 4 + 1];
|
|
378
|
+
return r0 === 0 ? undefined : r1;
|
|
379
|
+
} finally {
|
|
380
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @param {number} u
|
|
385
|
+
* @param {number} x
|
|
386
|
+
*/
|
|
387
|
+
setX(u, x) {
|
|
388
|
+
wasm.coordinates_setX(this.ptr, u, x);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* @param {number} u
|
|
392
|
+
* @param {number} y
|
|
393
|
+
*/
|
|
394
|
+
setY(u, y) {
|
|
395
|
+
wasm.coordinates_setY(this.ptr, u, y);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* @param {number} u
|
|
399
|
+
* @returns {number | undefined}
|
|
400
|
+
*/
|
|
401
|
+
vx(u) {
|
|
402
|
+
try {
|
|
403
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
404
|
+
wasm.coordinates_vx(retptr, this.ptr, u);
|
|
405
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
406
|
+
var r1 = getFloat32Memory0()[retptr / 4 + 1];
|
|
407
|
+
return r0 === 0 ? undefined : r1;
|
|
408
|
+
} finally {
|
|
409
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* @param {number} u
|
|
414
|
+
* @returns {number | undefined}
|
|
415
|
+
*/
|
|
416
|
+
vy(u) {
|
|
417
|
+
try {
|
|
418
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
419
|
+
wasm.coordinates_vy(retptr, this.ptr, u);
|
|
420
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
421
|
+
var r1 = getFloat32Memory0()[retptr / 4 + 1];
|
|
422
|
+
return r0 === 0 ? undefined : r1;
|
|
423
|
+
} finally {
|
|
424
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* @returns {number}
|
|
429
|
+
*/
|
|
430
|
+
len() {
|
|
431
|
+
var ret = wasm.coordinates_len(this.ptr);
|
|
432
|
+
return ret >>> 0;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* @returns {any}
|
|
436
|
+
*/
|
|
437
|
+
toJSON() {
|
|
438
|
+
var ret = wasm.coordinates_toJSON(this.ptr);
|
|
439
|
+
return takeObject(ret);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
*/
|
|
443
|
+
centralize() {
|
|
444
|
+
wasm.coordinates_centralize(this.ptr);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* @param {number} velocity_decay
|
|
448
|
+
*/
|
|
449
|
+
updatePosition(velocity_decay) {
|
|
450
|
+
wasm.coordinates_updatePosition(this.ptr, velocity_decay);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @param {number} x0
|
|
454
|
+
* @param {number} y0
|
|
455
|
+
* @param {number} x1
|
|
456
|
+
* @param {number} y1
|
|
457
|
+
*/
|
|
458
|
+
clampRegion(x0, y0, x1, y1) {
|
|
459
|
+
wasm.coordinates_clampRegion(this.ptr, x0, y0, x1, y1);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* @param {Graph} graph
|
|
463
|
+
* @returns {Coordinates}
|
|
464
|
+
*/
|
|
465
|
+
static initialPlacement(graph) {
|
|
466
|
+
_assertClass(graph, Graph);
|
|
467
|
+
var ret = wasm.coordinates_initialPlacement(graph.ptr);
|
|
468
|
+
return Coordinates.__wrap(ret);
|
|
336
469
|
}
|
|
337
470
|
}
|
|
338
|
-
__exports.
|
|
471
|
+
__exports.Coordinates = Coordinates;
|
|
339
472
|
/**
|
|
340
473
|
*/
|
|
341
|
-
class
|
|
474
|
+
class FruchtermanReingoldForce {
|
|
342
475
|
|
|
343
476
|
static __wrap(ptr) {
|
|
344
|
-
const obj = Object.create(
|
|
477
|
+
const obj = Object.create(FruchtermanReingoldForce.prototype);
|
|
345
478
|
obj.ptr = ptr;
|
|
346
479
|
|
|
347
480
|
return obj;
|
|
348
481
|
}
|
|
349
482
|
|
|
350
|
-
|
|
483
|
+
__destroy_into_raw() {
|
|
351
484
|
const ptr = this.ptr;
|
|
352
485
|
this.ptr = 0;
|
|
353
486
|
|
|
354
|
-
|
|
487
|
+
return ptr;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
free() {
|
|
491
|
+
const ptr = this.__destroy_into_raw();
|
|
492
|
+
wasm.__wbg_fruchtermanreingoldforce_free(ptr);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* @param {Graph} graph
|
|
496
|
+
* @param {number} k
|
|
497
|
+
* @param {number} min_distance
|
|
498
|
+
*/
|
|
499
|
+
constructor(graph, k, min_distance) {
|
|
500
|
+
_assertClass(graph, Graph);
|
|
501
|
+
var ret = wasm.fruchtermanreingoldforce_new(graph.ptr, k, min_distance);
|
|
502
|
+
return FruchtermanReingoldForce.__wrap(ret);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* @param {Coordinates} coordinates
|
|
506
|
+
* @param {number} alpha
|
|
507
|
+
*/
|
|
508
|
+
apply(coordinates, alpha) {
|
|
509
|
+
_assertClass(coordinates, Coordinates);
|
|
510
|
+
wasm.fruchtermanreingoldforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* @param {number} u
|
|
514
|
+
* @param {Coordinates} coordinates
|
|
515
|
+
* @param {number} alpha
|
|
516
|
+
*/
|
|
517
|
+
applyToNode(u, coordinates, alpha) {
|
|
518
|
+
_assertClass(coordinates, Coordinates);
|
|
519
|
+
wasm.fruchtermanreingoldforce_applyToNode(this.ptr, u, coordinates.ptr, alpha);
|
|
355
520
|
}
|
|
356
521
|
}
|
|
357
|
-
__exports.
|
|
522
|
+
__exports.FruchtermanReingoldForce = FruchtermanReingoldForce;
|
|
358
523
|
/**
|
|
359
524
|
*/
|
|
360
525
|
class Graph {
|
|
@@ -366,10 +531,15 @@ class Graph {
|
|
|
366
531
|
return obj;
|
|
367
532
|
}
|
|
368
533
|
|
|
369
|
-
|
|
534
|
+
__destroy_into_raw() {
|
|
370
535
|
const ptr = this.ptr;
|
|
371
536
|
this.ptr = 0;
|
|
372
537
|
|
|
538
|
+
return ptr;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
free() {
|
|
542
|
+
const ptr = this.__destroy_into_raw();
|
|
373
543
|
wasm.__wbg_graph_free(ptr);
|
|
374
544
|
}
|
|
375
545
|
/**
|
|
@@ -523,25 +693,352 @@ class Graph {
|
|
|
523
693
|
var ret = wasm.graph_edgeIndices(this.ptr);
|
|
524
694
|
return takeObject(ret);
|
|
525
695
|
}
|
|
696
|
+
/**
|
|
697
|
+
* @param {Function} node_map
|
|
698
|
+
* @param {Function} edge_map
|
|
699
|
+
* @returns {Graph}
|
|
700
|
+
*/
|
|
701
|
+
map(node_map, edge_map) {
|
|
702
|
+
try {
|
|
703
|
+
var ret = wasm.graph_map(this.ptr, addBorrowedObject(node_map), addBorrowedObject(edge_map));
|
|
704
|
+
return Graph.__wrap(ret);
|
|
705
|
+
} finally {
|
|
706
|
+
heap[stack_pointer++] = undefined;
|
|
707
|
+
heap[stack_pointer++] = undefined;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* @param {Function} node_map
|
|
712
|
+
* @param {Function} edge_map
|
|
713
|
+
* @returns {Graph}
|
|
714
|
+
*/
|
|
715
|
+
filterMap(node_map, edge_map) {
|
|
716
|
+
try {
|
|
717
|
+
var ret = wasm.graph_filterMap(this.ptr, addBorrowedObject(node_map), addBorrowedObject(edge_map));
|
|
718
|
+
return Graph.__wrap(ret);
|
|
719
|
+
} finally {
|
|
720
|
+
heap[stack_pointer++] = undefined;
|
|
721
|
+
heap[stack_pointer++] = undefined;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
526
724
|
}
|
|
527
725
|
__exports.Graph = Graph;
|
|
528
726
|
/**
|
|
529
727
|
*/
|
|
530
|
-
class
|
|
531
|
-
|
|
532
|
-
free() {
|
|
533
|
-
const ptr = this.ptr;
|
|
534
|
-
this.ptr = 0;
|
|
728
|
+
class GroupLinkForce {
|
|
535
729
|
|
|
730
|
+
static __wrap(ptr) {
|
|
731
|
+
const obj = Object.create(GroupLinkForce.prototype);
|
|
732
|
+
obj.ptr = ptr;
|
|
733
|
+
|
|
734
|
+
return obj;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
__destroy_into_raw() {
|
|
738
|
+
const ptr = this.ptr;
|
|
739
|
+
this.ptr = 0;
|
|
740
|
+
|
|
741
|
+
return ptr;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
free() {
|
|
745
|
+
const ptr = this.__destroy_into_raw();
|
|
746
|
+
wasm.__wbg_grouplinkforce_free(ptr);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* @param {Graph} graph
|
|
750
|
+
* @param {Function} group_accessor
|
|
751
|
+
* @param {Function} inter_link_accessor
|
|
752
|
+
* @param {Function} intra_link_accessor
|
|
753
|
+
*/
|
|
754
|
+
constructor(graph, group_accessor, inter_link_accessor, intra_link_accessor) {
|
|
755
|
+
try {
|
|
756
|
+
_assertClass(graph, Graph);
|
|
757
|
+
var ret = wasm.grouplinkforce_new(graph.ptr, addBorrowedObject(group_accessor), addBorrowedObject(inter_link_accessor), addBorrowedObject(intra_link_accessor));
|
|
758
|
+
return GroupLinkForce.__wrap(ret);
|
|
759
|
+
} finally {
|
|
760
|
+
heap[stack_pointer++] = undefined;
|
|
761
|
+
heap[stack_pointer++] = undefined;
|
|
762
|
+
heap[stack_pointer++] = undefined;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* @param {Coordinates} coordinates
|
|
767
|
+
* @param {number} alpha
|
|
768
|
+
*/
|
|
769
|
+
apply(coordinates, alpha) {
|
|
770
|
+
_assertClass(coordinates, Coordinates);
|
|
771
|
+
wasm.grouplinkforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
__exports.GroupLinkForce = GroupLinkForce;
|
|
775
|
+
/**
|
|
776
|
+
*/
|
|
777
|
+
class GroupManyBodyForce {
|
|
778
|
+
|
|
779
|
+
static __wrap(ptr) {
|
|
780
|
+
const obj = Object.create(GroupManyBodyForce.prototype);
|
|
781
|
+
obj.ptr = ptr;
|
|
782
|
+
|
|
783
|
+
return obj;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
__destroy_into_raw() {
|
|
787
|
+
const ptr = this.ptr;
|
|
788
|
+
this.ptr = 0;
|
|
789
|
+
|
|
790
|
+
return ptr;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
free() {
|
|
794
|
+
const ptr = this.__destroy_into_raw();
|
|
795
|
+
wasm.__wbg_groupmanybodyforce_free(ptr);
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* @param {Graph} graph
|
|
799
|
+
* @param {Function} node_accessor
|
|
800
|
+
*/
|
|
801
|
+
constructor(graph, node_accessor) {
|
|
802
|
+
try {
|
|
803
|
+
_assertClass(graph, Graph);
|
|
804
|
+
var ret = wasm.groupmanybodyforce_new(graph.ptr, addBorrowedObject(node_accessor));
|
|
805
|
+
return GroupManyBodyForce.__wrap(ret);
|
|
806
|
+
} finally {
|
|
807
|
+
heap[stack_pointer++] = undefined;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* @param {Coordinates} coordinates
|
|
812
|
+
* @param {number} alpha
|
|
813
|
+
*/
|
|
814
|
+
apply(coordinates, alpha) {
|
|
815
|
+
_assertClass(coordinates, Coordinates);
|
|
816
|
+
wasm.groupmanybodyforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
__exports.GroupManyBodyForce = GroupManyBodyForce;
|
|
820
|
+
/**
|
|
821
|
+
*/
|
|
822
|
+
class GroupPositionForce {
|
|
823
|
+
|
|
824
|
+
static __wrap(ptr) {
|
|
825
|
+
const obj = Object.create(GroupPositionForce.prototype);
|
|
826
|
+
obj.ptr = ptr;
|
|
827
|
+
|
|
828
|
+
return obj;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
__destroy_into_raw() {
|
|
832
|
+
const ptr = this.ptr;
|
|
833
|
+
this.ptr = 0;
|
|
834
|
+
|
|
835
|
+
return ptr;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
free() {
|
|
839
|
+
const ptr = this.__destroy_into_raw();
|
|
840
|
+
wasm.__wbg_grouppositionforce_free(ptr);
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* @param {Graph} graph
|
|
844
|
+
* @param {Function} node_accessor
|
|
845
|
+
* @param {Function} group_accessor
|
|
846
|
+
*/
|
|
847
|
+
constructor(graph, node_accessor, group_accessor) {
|
|
848
|
+
try {
|
|
849
|
+
_assertClass(graph, Graph);
|
|
850
|
+
var ret = wasm.grouppositionforce_new(graph.ptr, addBorrowedObject(node_accessor), addBorrowedObject(group_accessor));
|
|
851
|
+
return GroupPositionForce.__wrap(ret);
|
|
852
|
+
} finally {
|
|
853
|
+
heap[stack_pointer++] = undefined;
|
|
854
|
+
heap[stack_pointer++] = undefined;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* @param {Coordinates} coordinates
|
|
859
|
+
* @param {number} alpha
|
|
860
|
+
*/
|
|
861
|
+
apply(coordinates, alpha) {
|
|
862
|
+
_assertClass(coordinates, Coordinates);
|
|
863
|
+
wasm.grouppositionforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
__exports.GroupPositionForce = GroupPositionForce;
|
|
867
|
+
/**
|
|
868
|
+
*/
|
|
869
|
+
class HyperbolicSpace {
|
|
870
|
+
|
|
871
|
+
__destroy_into_raw() {
|
|
872
|
+
const ptr = this.ptr;
|
|
873
|
+
this.ptr = 0;
|
|
874
|
+
|
|
875
|
+
return ptr;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
free() {
|
|
879
|
+
const ptr = this.__destroy_into_raw();
|
|
880
|
+
wasm.__wbg_hyperbolicspace_free(ptr);
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* @param {any} a
|
|
884
|
+
* @param {any} b
|
|
885
|
+
* @returns {any}
|
|
886
|
+
*/
|
|
887
|
+
static toTangentSpace(a, b) {
|
|
888
|
+
var ret = wasm.hyperbolicspace_toTangentSpace(addHeapObject(a), addHeapObject(b));
|
|
889
|
+
return takeObject(ret);
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* @param {any} a
|
|
893
|
+
* @param {any} b
|
|
894
|
+
* @returns {any}
|
|
895
|
+
*/
|
|
896
|
+
static fromTangentSpace(a, b) {
|
|
897
|
+
var ret = wasm.hyperbolicspace_fromTangentSpace(addHeapObject(a), addHeapObject(b));
|
|
898
|
+
return takeObject(ret);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* @param {number} i
|
|
902
|
+
* @param {Coordinates} riemann_space
|
|
903
|
+
* @param {Coordinates} tangent_space
|
|
904
|
+
*/
|
|
905
|
+
static mapToTangentSpace(i, riemann_space, tangent_space) {
|
|
906
|
+
_assertClass(riemann_space, Coordinates);
|
|
907
|
+
_assertClass(tangent_space, Coordinates);
|
|
908
|
+
wasm.hyperbolicspace_mapToTangentSpace(i, riemann_space.ptr, tangent_space.ptr);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* @param {number} i
|
|
912
|
+
* @param {Coordinates} riemann_space
|
|
913
|
+
* @param {Coordinates} tangent_space
|
|
914
|
+
* @param {number} velocity_decay
|
|
915
|
+
*/
|
|
916
|
+
static updatePosition(i, riemann_space, tangent_space, velocity_decay) {
|
|
917
|
+
_assertClass(riemann_space, Coordinates);
|
|
918
|
+
_assertClass(tangent_space, Coordinates);
|
|
919
|
+
wasm.hyperbolicspace_updatePosition(i, riemann_space.ptr, tangent_space.ptr, velocity_decay);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
__exports.HyperbolicSpace = HyperbolicSpace;
|
|
923
|
+
/**
|
|
924
|
+
*/
|
|
925
|
+
class KamadaKawai {
|
|
926
|
+
|
|
927
|
+
static __wrap(ptr) {
|
|
928
|
+
const obj = Object.create(KamadaKawai.prototype);
|
|
929
|
+
obj.ptr = ptr;
|
|
930
|
+
|
|
931
|
+
return obj;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
__destroy_into_raw() {
|
|
935
|
+
const ptr = this.ptr;
|
|
936
|
+
this.ptr = 0;
|
|
937
|
+
|
|
938
|
+
return ptr;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
free() {
|
|
942
|
+
const ptr = this.__destroy_into_raw();
|
|
943
|
+
wasm.__wbg_kamadakawai_free(ptr);
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* @param {Graph} graph
|
|
947
|
+
* @param {Function} f
|
|
948
|
+
*/
|
|
949
|
+
constructor(graph, f) {
|
|
950
|
+
try {
|
|
951
|
+
_assertClass(graph, Graph);
|
|
952
|
+
var ret = wasm.kamadakawai_new(graph.ptr, addBorrowedObject(f));
|
|
953
|
+
return KamadaKawai.__wrap(ret);
|
|
954
|
+
} finally {
|
|
955
|
+
heap[stack_pointer++] = undefined;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* @param {Coordinates} coordinates
|
|
960
|
+
* @returns {number | undefined}
|
|
961
|
+
*/
|
|
962
|
+
selectNode(coordinates) {
|
|
963
|
+
try {
|
|
964
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
965
|
+
_assertClass(coordinates, Coordinates);
|
|
966
|
+
wasm.kamadakawai_selectNode(retptr, this.ptr, coordinates.ptr);
|
|
967
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
968
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
969
|
+
return r0 === 0 ? undefined : r1 >>> 0;
|
|
970
|
+
} finally {
|
|
971
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* @param {number} m
|
|
976
|
+
* @param {Coordinates} coordinates
|
|
977
|
+
*/
|
|
978
|
+
applyToNode(m, coordinates) {
|
|
979
|
+
_assertClass(coordinates, Coordinates);
|
|
980
|
+
wasm.kamadakawai_applyToNode(this.ptr, m, coordinates.ptr);
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* @param {Coordinates} coordinates
|
|
984
|
+
*/
|
|
985
|
+
run(coordinates) {
|
|
986
|
+
_assertClass(coordinates, Coordinates);
|
|
987
|
+
wasm.kamadakawai_run(this.ptr, coordinates.ptr);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
__exports.KamadaKawai = KamadaKawai;
|
|
991
|
+
/**
|
|
992
|
+
*/
|
|
993
|
+
class LinkForce {
|
|
994
|
+
|
|
995
|
+
static __wrap(ptr) {
|
|
996
|
+
const obj = Object.create(LinkForce.prototype);
|
|
997
|
+
obj.ptr = ptr;
|
|
998
|
+
|
|
999
|
+
return obj;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
__destroy_into_raw() {
|
|
1003
|
+
const ptr = this.ptr;
|
|
1004
|
+
this.ptr = 0;
|
|
1005
|
+
|
|
1006
|
+
return ptr;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
free() {
|
|
1010
|
+
const ptr = this.__destroy_into_raw();
|
|
536
1011
|
wasm.__wbg_linkforce_free(ptr);
|
|
537
1012
|
}
|
|
538
1013
|
/**
|
|
539
1014
|
* @param {Graph} graph
|
|
1015
|
+
* @param {Function} f
|
|
540
1016
|
*/
|
|
541
|
-
constructor(graph) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
1017
|
+
constructor(graph, f) {
|
|
1018
|
+
try {
|
|
1019
|
+
_assertClass(graph, Graph);
|
|
1020
|
+
var ret = wasm.linkforce_new(graph.ptr, addBorrowedObject(f));
|
|
1021
|
+
return LinkForce.__wrap(ret);
|
|
1022
|
+
} finally {
|
|
1023
|
+
heap[stack_pointer++] = undefined;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* @param {Coordinates} coordinates
|
|
1028
|
+
* @param {number} alpha
|
|
1029
|
+
*/
|
|
1030
|
+
apply(coordinates, alpha) {
|
|
1031
|
+
_assertClass(coordinates, Coordinates);
|
|
1032
|
+
wasm.linkforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* @param {number} u
|
|
1036
|
+
* @param {Coordinates} coordinates
|
|
1037
|
+
* @param {number} alpha
|
|
1038
|
+
*/
|
|
1039
|
+
applyToNode(u, coordinates, alpha) {
|
|
1040
|
+
_assertClass(coordinates, Coordinates);
|
|
1041
|
+
wasm.linkforce_applyToNode(this.ptr, u, coordinates.ptr, alpha);
|
|
545
1042
|
}
|
|
546
1043
|
}
|
|
547
1044
|
__exports.LinkForce = LinkForce;
|
|
@@ -549,38 +1046,77 @@ __exports.LinkForce = LinkForce;
|
|
|
549
1046
|
*/
|
|
550
1047
|
class ManyBodyForce {
|
|
551
1048
|
|
|
552
|
-
|
|
1049
|
+
static __wrap(ptr) {
|
|
1050
|
+
const obj = Object.create(ManyBodyForce.prototype);
|
|
1051
|
+
obj.ptr = ptr;
|
|
1052
|
+
|
|
1053
|
+
return obj;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
__destroy_into_raw() {
|
|
553
1057
|
const ptr = this.ptr;
|
|
554
1058
|
this.ptr = 0;
|
|
555
1059
|
|
|
1060
|
+
return ptr;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
free() {
|
|
1064
|
+
const ptr = this.__destroy_into_raw();
|
|
556
1065
|
wasm.__wbg_manybodyforce_free(ptr);
|
|
557
1066
|
}
|
|
558
1067
|
/**
|
|
559
1068
|
* @param {Graph} graph
|
|
1069
|
+
* @param {Function} f
|
|
560
1070
|
*/
|
|
561
|
-
constructor(graph) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
1071
|
+
constructor(graph, f) {
|
|
1072
|
+
try {
|
|
1073
|
+
_assertClass(graph, Graph);
|
|
1074
|
+
var ret = wasm.manybodyforce_new(graph.ptr, addBorrowedObject(f));
|
|
1075
|
+
return ManyBodyForce.__wrap(ret);
|
|
1076
|
+
} finally {
|
|
1077
|
+
heap[stack_pointer++] = undefined;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* @param {Coordinates} coordinates
|
|
1082
|
+
* @param {number} alpha
|
|
1083
|
+
*/
|
|
1084
|
+
apply(coordinates, alpha) {
|
|
1085
|
+
_assertClass(coordinates, Coordinates);
|
|
1086
|
+
wasm.manybodyforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* @param {number} u
|
|
1090
|
+
* @param {Coordinates} coordinates
|
|
1091
|
+
* @param {number} alpha
|
|
1092
|
+
*/
|
|
1093
|
+
applyToNode(u, coordinates, alpha) {
|
|
1094
|
+
_assertClass(coordinates, Coordinates);
|
|
1095
|
+
wasm.manybodyforce_applyToNode(this.ptr, u, coordinates.ptr, alpha);
|
|
565
1096
|
}
|
|
566
1097
|
}
|
|
567
1098
|
__exports.ManyBodyForce = ManyBodyForce;
|
|
568
1099
|
/**
|
|
569
1100
|
*/
|
|
570
|
-
class
|
|
1101
|
+
class PositionForce {
|
|
571
1102
|
|
|
572
1103
|
static __wrap(ptr) {
|
|
573
|
-
const obj = Object.create(
|
|
1104
|
+
const obj = Object.create(PositionForce.prototype);
|
|
574
1105
|
obj.ptr = ptr;
|
|
575
1106
|
|
|
576
1107
|
return obj;
|
|
577
1108
|
}
|
|
578
1109
|
|
|
579
|
-
|
|
1110
|
+
__destroy_into_raw() {
|
|
580
1111
|
const ptr = this.ptr;
|
|
581
1112
|
this.ptr = 0;
|
|
582
1113
|
|
|
583
|
-
|
|
1114
|
+
return ptr;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
free() {
|
|
1118
|
+
const ptr = this.__destroy_into_raw();
|
|
1119
|
+
wasm.__wbg_positionforce_free(ptr);
|
|
584
1120
|
}
|
|
585
1121
|
/**
|
|
586
1122
|
* @param {Graph} graph
|
|
@@ -589,32 +1125,129 @@ class Simulation {
|
|
|
589
1125
|
constructor(graph, f) {
|
|
590
1126
|
try {
|
|
591
1127
|
_assertClass(graph, Graph);
|
|
592
|
-
var ret = wasm.
|
|
593
|
-
return
|
|
1128
|
+
var ret = wasm.positionforce_new(graph.ptr, addBorrowedObject(f));
|
|
1129
|
+
return PositionForce.__wrap(ret);
|
|
594
1130
|
} finally {
|
|
595
1131
|
heap[stack_pointer++] = undefined;
|
|
596
1132
|
}
|
|
597
1133
|
}
|
|
598
1134
|
/**
|
|
599
|
-
* @param {
|
|
600
|
-
* @
|
|
1135
|
+
* @param {Coordinates} coordinates
|
|
1136
|
+
* @param {number} alpha
|
|
601
1137
|
*/
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
1138
|
+
apply(coordinates, alpha) {
|
|
1139
|
+
_assertClass(coordinates, Coordinates);
|
|
1140
|
+
wasm.positionforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* @param {number} u
|
|
1144
|
+
* @param {Coordinates} coordinates
|
|
1145
|
+
* @param {number} alpha
|
|
1146
|
+
*/
|
|
1147
|
+
applyToNode(u, coordinates, alpha) {
|
|
1148
|
+
_assertClass(coordinates, Coordinates);
|
|
1149
|
+
wasm.positionforce_applyToNode(this.ptr, u, coordinates.ptr, alpha);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
__exports.PositionForce = PositionForce;
|
|
1153
|
+
/**
|
|
1154
|
+
*/
|
|
1155
|
+
class RadialForce {
|
|
1156
|
+
|
|
1157
|
+
static __wrap(ptr) {
|
|
1158
|
+
const obj = Object.create(RadialForce.prototype);
|
|
1159
|
+
obj.ptr = ptr;
|
|
1160
|
+
|
|
1161
|
+
return obj;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
__destroy_into_raw() {
|
|
1165
|
+
const ptr = this.ptr;
|
|
1166
|
+
this.ptr = 0;
|
|
1167
|
+
|
|
1168
|
+
return ptr;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
free() {
|
|
1172
|
+
const ptr = this.__destroy_into_raw();
|
|
1173
|
+
wasm.__wbg_radialforce_free(ptr);
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @param {Graph} graph
|
|
1177
|
+
* @param {Function} f
|
|
1178
|
+
*/
|
|
1179
|
+
constructor(graph, f) {
|
|
1180
|
+
_assertClass(graph, Graph);
|
|
1181
|
+
var ret = wasm.radialforce_new(graph.ptr, addHeapObject(f));
|
|
1182
|
+
return RadialForce.__wrap(ret);
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* @param {Coordinates} coordinates
|
|
1186
|
+
* @param {number} alpha
|
|
1187
|
+
*/
|
|
1188
|
+
apply(coordinates, alpha) {
|
|
1189
|
+
_assertClass(coordinates, Coordinates);
|
|
1190
|
+
wasm.radialforce_apply(this.ptr, coordinates.ptr, alpha);
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* @param {number} u
|
|
1194
|
+
* @param {Coordinates} coordinates
|
|
1195
|
+
* @param {number} alpha
|
|
1196
|
+
*/
|
|
1197
|
+
applyToNode(u, coordinates, alpha) {
|
|
1198
|
+
_assertClass(coordinates, Coordinates);
|
|
1199
|
+
wasm.radialforce_applyToNode(this.ptr, u, coordinates.ptr, alpha);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
__exports.RadialForce = RadialForce;
|
|
1203
|
+
/**
|
|
1204
|
+
*/
|
|
1205
|
+
class Simulation {
|
|
1206
|
+
|
|
1207
|
+
static __wrap(ptr) {
|
|
1208
|
+
const obj = Object.create(Simulation.prototype);
|
|
1209
|
+
obj.ptr = ptr;
|
|
1210
|
+
|
|
1211
|
+
return obj;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
__destroy_into_raw() {
|
|
1215
|
+
const ptr = this.ptr;
|
|
1216
|
+
this.ptr = 0;
|
|
1217
|
+
|
|
1218
|
+
return ptr;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
free() {
|
|
1222
|
+
const ptr = this.__destroy_into_raw();
|
|
1223
|
+
wasm.__wbg_simulation_free(ptr);
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
*/
|
|
1227
|
+
constructor() {
|
|
1228
|
+
var ret = wasm.simulation_new();
|
|
1229
|
+
return Simulation.__wrap(ret);
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* @param {Function} f
|
|
1233
|
+
*/
|
|
1234
|
+
run(f) {
|
|
1235
|
+
try {
|
|
1236
|
+
wasm.simulation_run(this.ptr, addBorrowedObject(f));
|
|
1237
|
+
} finally {
|
|
1238
|
+
heap[stack_pointer++] = undefined;
|
|
1239
|
+
}
|
|
607
1240
|
}
|
|
608
1241
|
/**
|
|
609
1242
|
* @param {number} n
|
|
610
|
-
* @param {
|
|
611
|
-
* @returns {any}
|
|
1243
|
+
* @param {Function} f
|
|
612
1244
|
*/
|
|
613
|
-
runStep(n,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
1245
|
+
runStep(n, f) {
|
|
1246
|
+
try {
|
|
1247
|
+
wasm.simulation_runStep(this.ptr, n, addBorrowedObject(f));
|
|
1248
|
+
} finally {
|
|
1249
|
+
heap[stack_pointer++] = undefined;
|
|
1250
|
+
}
|
|
618
1251
|
}
|
|
619
1252
|
/**
|
|
620
1253
|
* @returns {boolean}
|
|
@@ -640,7 +1273,7 @@ class Simulation {
|
|
|
640
1273
|
* @param {number} value
|
|
641
1274
|
*/
|
|
642
1275
|
set alphaStart(value) {
|
|
643
|
-
wasm.
|
|
1276
|
+
wasm.simulation_set_alpha(this.ptr, value);
|
|
644
1277
|
}
|
|
645
1278
|
/**
|
|
646
1279
|
* @returns {number}
|
|
@@ -671,35 +1304,132 @@ class Simulation {
|
|
|
671
1304
|
/**
|
|
672
1305
|
* @returns {number}
|
|
673
1306
|
*/
|
|
674
|
-
get
|
|
675
|
-
var ret = wasm.
|
|
676
|
-
return ret;
|
|
1307
|
+
get iterations() {
|
|
1308
|
+
var ret = wasm.simulation_iterations(this.ptr);
|
|
1309
|
+
return ret >>> 0;
|
|
677
1310
|
}
|
|
678
1311
|
/**
|
|
679
1312
|
* @param {number} value
|
|
680
1313
|
*/
|
|
681
|
-
set
|
|
682
|
-
wasm.
|
|
1314
|
+
set iterations(value) {
|
|
1315
|
+
wasm.simulation_set_iterations(this.ptr, value);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
__exports.Simulation = Simulation;
|
|
1319
|
+
/**
|
|
1320
|
+
*/
|
|
1321
|
+
class SphericalSpace {
|
|
1322
|
+
|
|
1323
|
+
__destroy_into_raw() {
|
|
1324
|
+
const ptr = this.ptr;
|
|
1325
|
+
this.ptr = 0;
|
|
1326
|
+
|
|
1327
|
+
return ptr;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
free() {
|
|
1331
|
+
const ptr = this.__destroy_into_raw();
|
|
1332
|
+
wasm.__wbg_sphericalspace_free(ptr);
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* @param {any} a
|
|
1336
|
+
* @param {any} b
|
|
1337
|
+
* @returns {any}
|
|
1338
|
+
*/
|
|
1339
|
+
static toTangentSpace(a, b) {
|
|
1340
|
+
var ret = wasm.sphericalspace_toTangentSpace(addHeapObject(a), addHeapObject(b));
|
|
1341
|
+
return takeObject(ret);
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* @param {any} a
|
|
1345
|
+
* @param {any} b
|
|
1346
|
+
* @returns {any}
|
|
1347
|
+
*/
|
|
1348
|
+
static fromTangentSpace(a, b) {
|
|
1349
|
+
var ret = wasm.sphericalspace_fromTangentSpace(addHeapObject(a), addHeapObject(b));
|
|
1350
|
+
return takeObject(ret);
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* @param {number} i
|
|
1354
|
+
* @param {Coordinates} riemann_space
|
|
1355
|
+
* @param {Coordinates} tangent_space
|
|
1356
|
+
*/
|
|
1357
|
+
static mapToTangentSpace(i, riemann_space, tangent_space) {
|
|
1358
|
+
_assertClass(riemann_space, Coordinates);
|
|
1359
|
+
_assertClass(tangent_space, Coordinates);
|
|
1360
|
+
wasm.sphericalspace_mapToTangentSpace(i, riemann_space.ptr, tangent_space.ptr);
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* @param {number} i
|
|
1364
|
+
* @param {Coordinates} riemann_space
|
|
1365
|
+
* @param {Coordinates} tangent_space
|
|
1366
|
+
* @param {number} velocity_decay
|
|
1367
|
+
*/
|
|
1368
|
+
static updatePosition(i, riemann_space, tangent_space, velocity_decay) {
|
|
1369
|
+
_assertClass(riemann_space, Coordinates);
|
|
1370
|
+
_assertClass(tangent_space, Coordinates);
|
|
1371
|
+
wasm.sphericalspace_updatePosition(i, riemann_space.ptr, tangent_space.ptr, velocity_decay);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
__exports.SphericalSpace = SphericalSpace;
|
|
1375
|
+
/**
|
|
1376
|
+
*/
|
|
1377
|
+
class StressMajorization {
|
|
1378
|
+
|
|
1379
|
+
static __wrap(ptr) {
|
|
1380
|
+
const obj = Object.create(StressMajorization.prototype);
|
|
1381
|
+
obj.ptr = ptr;
|
|
1382
|
+
|
|
1383
|
+
return obj;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
__destroy_into_raw() {
|
|
1387
|
+
const ptr = this.ptr;
|
|
1388
|
+
this.ptr = 0;
|
|
1389
|
+
|
|
1390
|
+
return ptr;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
free() {
|
|
1394
|
+
const ptr = this.__destroy_into_raw();
|
|
1395
|
+
wasm.__wbg_stressmajorization_free(ptr);
|
|
683
1396
|
}
|
|
684
1397
|
/**
|
|
1398
|
+
* @param {Graph} graph
|
|
1399
|
+
* @param {Coordinates} coordinates
|
|
1400
|
+
* @param {Function} f
|
|
1401
|
+
*/
|
|
1402
|
+
constructor(graph, coordinates, f) {
|
|
1403
|
+
try {
|
|
1404
|
+
_assertClass(graph, Graph);
|
|
1405
|
+
_assertClass(coordinates, Coordinates);
|
|
1406
|
+
var ret = wasm.stressmajorization_new(graph.ptr, coordinates.ptr, addBorrowedObject(f));
|
|
1407
|
+
return StressMajorization.__wrap(ret);
|
|
1408
|
+
} finally {
|
|
1409
|
+
heap[stack_pointer++] = undefined;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* @param {Coordinates} coordinates
|
|
685
1414
|
* @returns {number}
|
|
686
1415
|
*/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
1416
|
+
apply(coordinates) {
|
|
1417
|
+
_assertClass(coordinates, Coordinates);
|
|
1418
|
+
var ret = wasm.stressmajorization_apply(this.ptr, coordinates.ptr);
|
|
1419
|
+
return ret;
|
|
690
1420
|
}
|
|
691
1421
|
/**
|
|
692
|
-
* @param {
|
|
1422
|
+
* @param {Coordinates} coordinates
|
|
693
1423
|
*/
|
|
694
|
-
|
|
695
|
-
|
|
1424
|
+
run(coordinates) {
|
|
1425
|
+
_assertClass(coordinates, Coordinates);
|
|
1426
|
+
wasm.stressmajorization_run(this.ptr, coordinates.ptr);
|
|
696
1427
|
}
|
|
697
1428
|
}
|
|
698
|
-
__exports.
|
|
1429
|
+
__exports.StressMajorization = StressMajorization;
|
|
699
1430
|
|
|
700
1431
|
async function load(module, imports) {
|
|
701
1432
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
702
|
-
|
|
703
1433
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
704
1434
|
try {
|
|
705
1435
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
@@ -718,7 +1448,6 @@ async function load(module, imports) {
|
|
|
718
1448
|
return await WebAssembly.instantiate(bytes, imports);
|
|
719
1449
|
|
|
720
1450
|
} else {
|
|
721
|
-
|
|
722
1451
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
723
1452
|
|
|
724
1453
|
if (instance instanceof WebAssembly.Instance) {
|
|
@@ -742,10 +1471,6 @@ async function init(input) {
|
|
|
742
1471
|
}
|
|
743
1472
|
const imports = {};
|
|
744
1473
|
imports.wbg = {};
|
|
745
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
746
|
-
var ret = getStringFromWasm0(arg0, arg1);
|
|
747
|
-
return addHeapObject(ret);
|
|
748
|
-
};
|
|
749
1474
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
750
1475
|
var ret = arg0;
|
|
751
1476
|
return addHeapObject(ret);
|
|
@@ -753,6 +1478,28 @@ async function init(input) {
|
|
|
753
1478
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
754
1479
|
takeObject(arg0);
|
|
755
1480
|
};
|
|
1481
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1482
|
+
var ret = getStringFromWasm0(arg0, arg1);
|
|
1483
|
+
return addHeapObject(ret);
|
|
1484
|
+
};
|
|
1485
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
1486
|
+
const obj = getObject(arg1);
|
|
1487
|
+
var ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1488
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
1489
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
1490
|
+
};
|
|
1491
|
+
imports.wbg.__wbg_graph_new = function(arg0) {
|
|
1492
|
+
var ret = Graph.__wrap(arg0);
|
|
1493
|
+
return addHeapObject(ret);
|
|
1494
|
+
};
|
|
1495
|
+
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
1496
|
+
var ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1497
|
+
return addHeapObject(ret);
|
|
1498
|
+
};
|
|
1499
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
1500
|
+
var ret = getObject(arg0) === null;
|
|
1501
|
+
return ret;
|
|
1502
|
+
};
|
|
756
1503
|
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
757
1504
|
const obj = getObject(arg1);
|
|
758
1505
|
var ret = JSON.stringify(obj === undefined ? null : obj);
|
|
@@ -765,44 +1512,30 @@ async function init(input) {
|
|
|
765
1512
|
var ret = getObject(arg0);
|
|
766
1513
|
return addHeapObject(ret);
|
|
767
1514
|
};
|
|
768
|
-
imports.wbg.
|
|
769
|
-
var ret =
|
|
770
|
-
return
|
|
771
|
-
};
|
|
772
|
-
imports.wbg.__wbg_get_a8b9619536c590d4 = function(arg0, arg1) {
|
|
773
|
-
var ret = getObject(arg0)[arg1 >>> 0];
|
|
774
|
-
return addHeapObject(ret);
|
|
1515
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
1516
|
+
var ret = getObject(arg0) === undefined;
|
|
1517
|
+
return ret;
|
|
775
1518
|
};
|
|
776
|
-
imports.wbg.
|
|
1519
|
+
imports.wbg.__wbg_get_800098c980b31ea2 = function() { return handleError(function (arg0, arg1) {
|
|
777
1520
|
var ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
778
1521
|
return addHeapObject(ret);
|
|
779
|
-
});
|
|
780
|
-
imports.wbg.
|
|
1522
|
+
}, arguments) };
|
|
1523
|
+
imports.wbg.__wbg_new_515b65a8e7699d00 = function() {
|
|
781
1524
|
var ret = new Array();
|
|
782
1525
|
return addHeapObject(ret);
|
|
783
1526
|
};
|
|
784
|
-
imports.wbg.
|
|
1527
|
+
imports.wbg.__wbg_push_b7f68478f81d358b = function(arg0, arg1) {
|
|
785
1528
|
var ret = getObject(arg0).push(getObject(arg1));
|
|
786
1529
|
return ret;
|
|
787
1530
|
};
|
|
788
|
-
imports.wbg.
|
|
1531
|
+
imports.wbg.__wbg_call_3fc07b7d5fc9022d = function() { return handleError(function (arg0, arg1, arg2) {
|
|
789
1532
|
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
790
1533
|
return addHeapObject(ret);
|
|
791
|
-
});
|
|
792
|
-
imports.wbg.
|
|
793
|
-
var ret =
|
|
1534
|
+
}, arguments) };
|
|
1535
|
+
imports.wbg.__wbg_call_2c06c503c0d359bd = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1536
|
+
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
794
1537
|
return addHeapObject(ret);
|
|
795
|
-
};
|
|
796
|
-
imports.wbg.__wbg_set_3afd31f38e771338 = handleError(function(arg0, arg1, arg2) {
|
|
797
|
-
var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
798
|
-
return ret;
|
|
799
|
-
});
|
|
800
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
801
|
-
const obj = getObject(arg1);
|
|
802
|
-
var ret = typeof(obj) === 'number' ? obj : undefined;
|
|
803
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
804
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
805
|
-
};
|
|
1538
|
+
}, arguments) };
|
|
806
1539
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
807
1540
|
var ret = debugString(getObject(arg1));
|
|
808
1541
|
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -821,6 +1554,8 @@ async function init(input) {
|
|
|
821
1554
|
input = fetch(input);
|
|
822
1555
|
}
|
|
823
1556
|
|
|
1557
|
+
|
|
1558
|
+
|
|
824
1559
|
const { instance, module } = await load(await input, imports);
|
|
825
1560
|
|
|
826
1561
|
wasm = instance.exports;
|