egraph 6.0.0-alpha.9 → 6.0.0-beta.1
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/README.md +76 -36
- package/package.json +1 -1
- package/pkg/README.md +76 -36
- package/pkg/egraph_wasm.d.ts +1336 -1154
- package/pkg/egraph_wasm.js +13444 -8529
- package/pkg/egraph_wasm_bg.wasm +0 -0
- package/pkg/index.d.ts +1840 -1270
- package/pkg/index.js +189 -76
package/pkg/index.js
CHANGED
|
@@ -10,8 +10,10 @@ import init, {
|
|
|
10
10
|
BackboneSolver,
|
|
11
11
|
ChebyshevDogKernel,
|
|
12
12
|
ClassDensityResult,
|
|
13
|
+
ClassicalMds,
|
|
13
14
|
ClusterAreaReport,
|
|
14
15
|
ClusterRefineSolver,
|
|
16
|
+
CoarseBackbone,
|
|
15
17
|
CoarseBackboneResult,
|
|
16
18
|
CoarsenedGraphResult,
|
|
17
19
|
CoarsenedHierarchyResult,
|
|
@@ -24,27 +26,34 @@ import init, {
|
|
|
24
26
|
DijkstraWorkspace,
|
|
25
27
|
DogStats,
|
|
26
28
|
DogVaradhanLandmarks,
|
|
29
|
+
DrGraphSolver as _DrGraphSolver,
|
|
27
30
|
DynamicKdTree as _DynamicKdTree,
|
|
31
|
+
EdgePolylines as _EdgePolylines,
|
|
28
32
|
EffectiveResistanceResult,
|
|
29
33
|
EigenResult,
|
|
30
|
-
FdebSolver
|
|
34
|
+
FdebSolver,
|
|
31
35
|
FitFieldStats,
|
|
32
36
|
ForbidOverlapRemoval,
|
|
33
37
|
ForceAtlas2Solver as _ForceAtlas2Solver,
|
|
34
38
|
FruchtermanReingoldSolver as _FruchtermanReingoldSolver,
|
|
35
39
|
GTreeOverlapRemoval,
|
|
36
40
|
GemSolver,
|
|
41
|
+
GraphCneSolver as _GraphCneSolver,
|
|
37
42
|
GripSolver,
|
|
38
43
|
GroupInABoxSolver,
|
|
39
44
|
GuMapSolver as _GuMapSolver,
|
|
45
|
+
Hde,
|
|
40
46
|
HybridKnnResult,
|
|
41
47
|
IbUmapSolver,
|
|
42
48
|
KMeansResult as _KMeansResult,
|
|
43
49
|
KamadaKawaiSolver as _KamadaKawaiSolver,
|
|
44
50
|
KnnGraph,
|
|
51
|
+
KorenSpectral,
|
|
45
52
|
LabelPropagationResult as _LabelPropagationResult,
|
|
53
|
+
LargeVisSolver as _LargeVisSolver,
|
|
46
54
|
LargestConnectedComponentResult,
|
|
47
55
|
Layout2d as _Layout2d,
|
|
56
|
+
Layout3d as _Layout3d,
|
|
48
57
|
LayoutDegeneracy,
|
|
49
58
|
LayoutNd as _LayoutNd,
|
|
50
59
|
LeidenResult as _LeidenResult,
|
|
@@ -56,10 +65,13 @@ import init, {
|
|
|
56
65
|
MinimumAngleSummary,
|
|
57
66
|
NorMetricsResult,
|
|
58
67
|
PacmapBackboneResult,
|
|
68
|
+
PacmapGraphSolver as _PacmapGraphSolver,
|
|
59
69
|
PartitionAgreementResult,
|
|
60
70
|
PfsPrimeOverlapRemoval,
|
|
71
|
+
PivotMds,
|
|
61
72
|
PrismDistortion,
|
|
62
73
|
PrismOverlapRemoval,
|
|
74
|
+
RdMds,
|
|
63
75
|
ResistanceCurvatureFlowResult,
|
|
64
76
|
ResistanceCurvatureStep,
|
|
65
77
|
RhghLandmarks,
|
|
@@ -70,8 +82,10 @@ import init, {
|
|
|
70
82
|
ScreenedPoissonResult,
|
|
71
83
|
SelLayoutSolver,
|
|
72
84
|
SeparationConstraint,
|
|
73
|
-
|
|
85
|
+
SfcLayout,
|
|
86
|
+
Sgd2Solver as _Sgd2Solver,
|
|
74
87
|
SgdSolver as _SgdSolver,
|
|
88
|
+
SnapTFdpSolver as _SnapTFdpSolver,
|
|
75
89
|
Sparse12HopPairs,
|
|
76
90
|
SparseBarrierStats,
|
|
77
91
|
SparseProbabilities,
|
|
@@ -83,7 +97,7 @@ import init, {
|
|
|
83
97
|
SpectralMomentStats,
|
|
84
98
|
StressEvaluation,
|
|
85
99
|
StressMajorizationSolver as _StressMajorizationSolver,
|
|
86
|
-
TFdpSolver,
|
|
100
|
+
TFdpSolver as _TFdpSolver,
|
|
87
101
|
TorusCrossing,
|
|
88
102
|
TsNetSolver as _TsNetSolver,
|
|
89
103
|
TsNetStage,
|
|
@@ -92,108 +106,142 @@ import init, {
|
|
|
92
106
|
TwoHopKnnResult,
|
|
93
107
|
YifanHuSolver as _YifanHuSolver,
|
|
94
108
|
_calinskiHarabaszScore2d,
|
|
109
|
+
_calinskiHarabaszScore3d,
|
|
95
110
|
_calinskiHarabaszScoreManifold,
|
|
96
111
|
_calinskiHarabaszScoreNd,
|
|
97
112
|
_cqHac2d,
|
|
113
|
+
_cqHac3d,
|
|
98
114
|
_cqHacManifold,
|
|
99
115
|
_cqHacNd,
|
|
100
116
|
_cqKmeans2d,
|
|
117
|
+
_cqKmeans3d,
|
|
101
118
|
_cqKmeansManifold,
|
|
102
119
|
_cqKmeansNd,
|
|
103
120
|
_crossingEdgesTorus2d,
|
|
104
121
|
_crossingEdgesTorusManifold,
|
|
105
122
|
_daviesBouldinScore2d,
|
|
123
|
+
_daviesBouldinScore3d,
|
|
106
124
|
_daviesBouldinScoreManifold,
|
|
107
125
|
_daviesBouldinScoreNd,
|
|
108
126
|
_dggPreservation2d,
|
|
127
|
+
_dggPreservation3d,
|
|
109
128
|
_dggPreservationManifold,
|
|
110
129
|
_dggPreservationNd,
|
|
111
130
|
_distanceConsistency2d,
|
|
131
|
+
_distanceConsistency3d,
|
|
112
132
|
_distanceConsistencyManifold,
|
|
113
133
|
_distanceConsistencyNd,
|
|
114
134
|
_distributionConsistency2d,
|
|
135
|
+
_distributionConsistency3d,
|
|
115
136
|
_distributionConsistencyManifold,
|
|
116
137
|
_distributionConsistencyNd,
|
|
117
138
|
_drngPreservation2d,
|
|
139
|
+
_drngPreservation3d,
|
|
118
140
|
_drngPreservationManifold,
|
|
119
141
|
_drngPreservationNd,
|
|
120
142
|
_evaluateMetrics2d,
|
|
121
143
|
_evaluateMetrics2dWithOriginal,
|
|
144
|
+
_evaluateMetrics3d,
|
|
122
145
|
_evaluateMetricsManifold,
|
|
123
146
|
_evaluateMetricsNd,
|
|
124
147
|
_gabrielGraphEdges2d,
|
|
148
|
+
_gabrielGraphEdges3d,
|
|
125
149
|
_gabrielGraphEdgesManifold,
|
|
126
150
|
_gabrielGraphEdgesNd,
|
|
127
151
|
_gabrielGraphProperty2d,
|
|
152
|
+
_gabrielGraphProperty3d,
|
|
128
153
|
_gabrielGraphPropertyManifold,
|
|
129
154
|
_gabrielGraphPropertyNd,
|
|
130
155
|
_idealEdgeLengths2d,
|
|
156
|
+
_idealEdgeLengths3d,
|
|
131
157
|
_idealEdgeLengthsManifold,
|
|
132
158
|
_idealEdgeLengthsNd,
|
|
133
159
|
_idealEdgeLengthsWithUnit2d,
|
|
160
|
+
_idealEdgeLengthsWithUnit3d,
|
|
134
161
|
_idealEdgeLengthsWithUnitManifold,
|
|
135
162
|
_idealEdgeLengthsWithUnitNd,
|
|
136
163
|
_landmarkStratifiedRta2d,
|
|
164
|
+
_landmarkStratifiedRta3d,
|
|
137
165
|
_landmarkStratifiedRtaDetail2d,
|
|
166
|
+
_landmarkStratifiedRtaDetail3d,
|
|
138
167
|
_landmarkStratifiedRtaDetailManifold,
|
|
139
168
|
_landmarkStratifiedRtaDetailNd,
|
|
140
169
|
_landmarkStratifiedRtaFromLandmarks2d,
|
|
170
|
+
_landmarkStratifiedRtaFromLandmarks3d,
|
|
141
171
|
_landmarkStratifiedRtaFromLandmarksManifold,
|
|
142
172
|
_landmarkStratifiedRtaFromLandmarksNd,
|
|
143
173
|
_landmarkStratifiedRtaManifold,
|
|
144
174
|
_landmarkStratifiedRtaNd,
|
|
145
175
|
_layoutDegeneracy2d,
|
|
176
|
+
_layoutDegeneracy3d,
|
|
146
177
|
_layoutDegeneracyManifold,
|
|
147
178
|
_layoutDegeneracyNd,
|
|
148
179
|
_neighborhoodHit2d,
|
|
180
|
+
_neighborhoodHit3d,
|
|
149
181
|
_neighborhoodHitManifold,
|
|
150
182
|
_neighborhoodHitNd,
|
|
151
183
|
_neighborhoodPreservation1Hop2d,
|
|
184
|
+
_neighborhoodPreservation1Hop3d,
|
|
152
185
|
_neighborhoodPreservation1HopManifold,
|
|
153
186
|
_neighborhoodPreservation1HopNd,
|
|
154
187
|
_neighborhoodPreservation2Hop2d,
|
|
188
|
+
_neighborhoodPreservation2Hop3d,
|
|
155
189
|
_neighborhoodPreservation2HopManifold,
|
|
156
190
|
_neighborhoodPreservation2HopNd,
|
|
157
191
|
_nodeResolution2d,
|
|
192
|
+
_nodeResolution3d,
|
|
158
193
|
_nodeResolutionManifold,
|
|
159
194
|
_nodeResolutionNd,
|
|
160
195
|
_pairwiseDistanceOverlapError2d,
|
|
196
|
+
_pairwiseDistanceOverlapError3d,
|
|
161
197
|
_pairwiseDistanceOverlapErrorManifold,
|
|
162
198
|
_pairwiseDistanceOverlapErrorNd,
|
|
163
199
|
_relativeNeighborhoodEdges2d,
|
|
200
|
+
_relativeNeighborhoodEdges3d,
|
|
164
201
|
_relativeNeighborhoodEdgesManifold,
|
|
165
202
|
_relativeNeighborhoodEdgesNd,
|
|
166
203
|
_sampledNp12d,
|
|
204
|
+
_sampledNp13d,
|
|
167
205
|
_sampledNp1Manifold,
|
|
168
206
|
_sampledNp1Nd,
|
|
169
207
|
_sampledNp22d,
|
|
208
|
+
_sampledNp23d,
|
|
170
209
|
_sampledNp2Manifold,
|
|
171
210
|
_sampledNp2Nd,
|
|
172
211
|
_sampledScaleNormalizedStress2d,
|
|
212
|
+
_sampledScaleNormalizedStress3d,
|
|
173
213
|
_sampledScaleNormalizedStressManifold,
|
|
174
214
|
_sampledScaleNormalizedStressNd,
|
|
175
215
|
_scaleNormalizedStress2d,
|
|
216
|
+
_scaleNormalizedStress3d,
|
|
176
217
|
_scaleNormalizedStressDetail2d,
|
|
218
|
+
_scaleNormalizedStressDetail3d,
|
|
177
219
|
_scaleNormalizedStressDetailManifold,
|
|
178
220
|
_scaleNormalizedStressDetailNd,
|
|
179
221
|
_scaleNormalizedStressFromDistances2d,
|
|
222
|
+
_scaleNormalizedStressFromDistances3d,
|
|
180
223
|
_scaleNormalizedStressFromDistancesManifold,
|
|
181
224
|
_scaleNormalizedStressFromDistancesNd,
|
|
182
225
|
_scaleNormalizedStressManifold,
|
|
183
226
|
_scaleNormalizedStressNd,
|
|
184
227
|
_sepmeGab2d,
|
|
228
|
+
_sepmeGab3d,
|
|
185
229
|
_sepmeGabManifold,
|
|
186
230
|
_sepmeGabNd,
|
|
187
231
|
_sepmeGong2d,
|
|
232
|
+
_sepmeGong3d,
|
|
188
233
|
_sepmeGongManifold,
|
|
189
234
|
_sepmeGongNd,
|
|
190
235
|
_sepmeKnng2d,
|
|
236
|
+
_sepmeKnng3d,
|
|
191
237
|
_sepmeKnngManifold,
|
|
192
238
|
_sepmeKnngNd,
|
|
193
239
|
_sepmeRng2d,
|
|
240
|
+
_sepmeRng3d,
|
|
194
241
|
_sepmeRngManifold,
|
|
195
242
|
_sepmeRngNd,
|
|
196
243
|
_silhouetteScore2d,
|
|
244
|
+
_silhouetteScore3d,
|
|
197
245
|
_silhouetteScoreManifold,
|
|
198
246
|
_silhouetteScoreNd,
|
|
199
247
|
_torusCrossingNumber2d,
|
|
@@ -354,6 +402,12 @@ import init, {
|
|
|
354
402
|
wrapTorusPoint,
|
|
355
403
|
} from "./egraph_wasm.js";
|
|
356
404
|
|
|
405
|
+
function makeDispatchError(code, message) {
|
|
406
|
+
const err = new TypeError(message);
|
|
407
|
+
err.code = code;
|
|
408
|
+
return err;
|
|
409
|
+
}
|
|
410
|
+
|
|
357
411
|
function attachCoordsView(LayoutClass) {
|
|
358
412
|
if (typeof LayoutClass.prototype.coordsView !== "function") {
|
|
359
413
|
LayoutClass.prototype.coordsView = function coordsView() {
|
|
@@ -397,46 +451,94 @@ function attachTypedView(ResultClass, methodName, ptrFn, lenFn, TypedCtor, cache
|
|
|
397
451
|
return ResultClass;
|
|
398
452
|
}
|
|
399
453
|
|
|
400
|
-
function attachSolverDispatch(
|
|
454
|
+
function attachSolverDispatch(
|
|
455
|
+
SolverClass,
|
|
456
|
+
{ supports3d = false, supportsNd = false, supportsManifold = false } = {},
|
|
457
|
+
) {
|
|
401
458
|
const proto = SolverClass.prototype;
|
|
402
459
|
proto.step = function step(layout) {
|
|
403
460
|
if (layout instanceof _Layout2d) return this._step2d(layout);
|
|
461
|
+
if (supports3d && layout instanceof _Layout3d) return this._step3d(layout);
|
|
404
462
|
if (supportsNd && layout instanceof _LayoutNd) return this._stepNd(layout);
|
|
405
463
|
if (supportsManifold && layout instanceof _ManifoldLayout2d) return this._stepManifold(layout);
|
|
406
|
-
throw
|
|
464
|
+
throw makeDispatchError("UnsupportedOperation", `${SolverClass.name}.step: unsupported layout type`);
|
|
407
465
|
};
|
|
408
466
|
proto.runSteps = function runSteps(layout, steps) {
|
|
409
467
|
if (layout instanceof _Layout2d) return this._runSteps2d(layout, steps);
|
|
468
|
+
if (supports3d && layout instanceof _Layout3d) return this._runSteps3d(layout, steps);
|
|
410
469
|
if (supportsNd && layout instanceof _LayoutNd) return this._runStepsNd(layout, steps);
|
|
411
470
|
if (supportsManifold && layout instanceof _ManifoldLayout2d) {
|
|
412
471
|
return this._runStepsManifold(layout, steps);
|
|
413
472
|
}
|
|
414
|
-
throw
|
|
473
|
+
throw makeDispatchError("UnsupportedOperation", `${SolverClass.name}.runSteps: unsupported layout type`);
|
|
415
474
|
};
|
|
416
475
|
proto.run = function run(layout) {
|
|
417
476
|
if (layout instanceof _Layout2d) return this._run2d(layout);
|
|
477
|
+
if (supports3d && layout instanceof _Layout3d) return this._run3d(layout);
|
|
418
478
|
if (supportsNd && layout instanceof _LayoutNd) return this._runNd(layout);
|
|
419
479
|
if (supportsManifold && layout instanceof _ManifoldLayout2d) return this._runManifold(layout);
|
|
420
|
-
throw
|
|
480
|
+
throw makeDispatchError("UnsupportedOperation", `${SolverClass.name}.run: unsupported layout type`);
|
|
421
481
|
};
|
|
422
482
|
return SolverClass;
|
|
423
483
|
}
|
|
424
484
|
|
|
425
|
-
function
|
|
485
|
+
function attachScheduleWindow(SolverClass) {
|
|
486
|
+
SolverClass.prototype.runScheduleWindow = function runScheduleWindow(layout, startIter, count) {
|
|
487
|
+
if (layout instanceof _Layout2d) return this._runScheduleWindow2d(layout, startIter, count);
|
|
488
|
+
if (layout instanceof _Layout3d) return this._runScheduleWindow3d(layout, startIter, count);
|
|
489
|
+
if (layout instanceof _LayoutNd) return this._runScheduleWindowNd(layout, startIter, count);
|
|
490
|
+
if (layout instanceof _ManifoldLayout2d) {
|
|
491
|
+
return this._runScheduleWindowManifold(layout, startIter, count);
|
|
492
|
+
}
|
|
493
|
+
throw makeDispatchError(
|
|
494
|
+
"UnsupportedOperation",
|
|
495
|
+
`${SolverClass.name}.runScheduleWindow: unsupported layout type`,
|
|
496
|
+
);
|
|
497
|
+
};
|
|
498
|
+
return SolverClass;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function attachEdgePolylines(PolyClass) {
|
|
502
|
+
attachTypedView(PolyClass, "edgeOffsetsView", "edgeOffsetsPtr", "edgeOffsetsLen", Uint32Array, "_edgeOffsetsView");
|
|
503
|
+
attachTypedView(PolyClass, "pointsView", "pointsPtr", "pointsLen", Float32Array, "_pointsView");
|
|
504
|
+
PolyClass.straightLineFromGraph = function straightLineFromGraph(graph, layout) {
|
|
505
|
+
if (layout instanceof _Layout2d) return PolyClass._straightLineFromGraph2d(graph, layout);
|
|
506
|
+
if (layout instanceof _Layout3d) return PolyClass._straightLineFromGraph3d(graph, layout);
|
|
507
|
+
if (layout instanceof _LayoutNd) return PolyClass._straightLineFromGraphNd(graph, layout);
|
|
508
|
+
throw makeDispatchError(
|
|
509
|
+
"UnsupportedOperation",
|
|
510
|
+
"EdgePolylines.straightLineFromGraph: expected Layout2d, Layout3d, or LayoutNd",
|
|
511
|
+
);
|
|
512
|
+
};
|
|
513
|
+
PolyClass.fromParts = function fromParts(edgeOffsets, points) {
|
|
514
|
+
if (points instanceof _Layout2d) return PolyClass._fromParts2d(edgeOffsets, points);
|
|
515
|
+
if (points instanceof _Layout3d) return PolyClass._fromParts3d(edgeOffsets, points);
|
|
516
|
+
if (points instanceof _LayoutNd) return PolyClass._fromPartsNd(edgeOffsets, points);
|
|
517
|
+
throw makeDispatchError(
|
|
518
|
+
"UnsupportedOperation",
|
|
519
|
+
"EdgePolylines.fromParts: expected points to be Layout2d, Layout3d, or LayoutNd",
|
|
520
|
+
);
|
|
521
|
+
};
|
|
522
|
+
return PolyClass;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function dispatchLayout4(name, fn2d, fn3d, fnNd, fnManifold) {
|
|
426
526
|
return function (layout, ...args) {
|
|
427
527
|
if (layout instanceof _Layout2d) return fn2d(layout, ...args);
|
|
528
|
+
if (fn3d && layout instanceof _Layout3d) return fn3d(layout, ...args);
|
|
428
529
|
if (fnNd && layout instanceof _LayoutNd) return fnNd(layout, ...args);
|
|
429
530
|
if (fnManifold && layout instanceof _ManifoldLayout2d) return fnManifold(layout, ...args);
|
|
430
|
-
throw
|
|
531
|
+
throw makeDispatchError("UnsupportedOperation", `${name}: unsupported layout type`);
|
|
431
532
|
};
|
|
432
533
|
}
|
|
433
534
|
|
|
434
|
-
function
|
|
535
|
+
function dispatchGraphLayout4(name, fn2d, fn3d, fnNd, fnManifold) {
|
|
435
536
|
return function (graph, layout, ...args) {
|
|
436
537
|
if (layout instanceof _Layout2d) return fn2d(graph, layout, ...args);
|
|
538
|
+
if (fn3d && layout instanceof _Layout3d) return fn3d(graph, layout, ...args);
|
|
437
539
|
if (fnNd && layout instanceof _LayoutNd) return fnNd(graph, layout, ...args);
|
|
438
540
|
if (fnManifold && layout instanceof _ManifoldLayout2d) return fnManifold(graph, layout, ...args);
|
|
439
|
-
throw
|
|
541
|
+
throw makeDispatchError("UnsupportedOperation", `${name}: unsupported layout type`);
|
|
440
542
|
};
|
|
441
543
|
}
|
|
442
544
|
|
|
@@ -445,7 +547,8 @@ function dispatchGraphLayout3(name, fn2d, fnNd, fnManifold) {
|
|
|
445
547
|
* yielding back to the browser event loop via `requestAnimationFrame` (or `setTimeout`
|
|
446
548
|
* in Node.js) between batches.
|
|
447
549
|
*
|
|
448
|
-
* Accepts `Layout2d`, `LayoutNd`, or `
|
|
550
|
+
* Accepts `Layout2d`, `Layout3d`, `LayoutNd`, `ManifoldLayout2d`, or `EdgePolylines`
|
|
551
|
+
* (for `FdebSolver`) polymorphically.
|
|
449
552
|
*/
|
|
450
553
|
export function runProgressive(solver, layout, onFrame, options = {}) {
|
|
451
554
|
const {
|
|
@@ -570,8 +673,10 @@ export function runProgressive(solver, layout, onFrame, options = {}) {
|
|
|
570
673
|
}
|
|
571
674
|
|
|
572
675
|
export const Layout2d = attachCoordsView(_Layout2d);
|
|
676
|
+
export const Layout3d = attachCoordsView(_Layout3d);
|
|
573
677
|
export const LayoutNd = attachCoordsView(_LayoutNd);
|
|
574
678
|
export const ManifoldLayout2d = attachCoordsView(_ManifoldLayout2d);
|
|
679
|
+
export const EdgePolylines = attachEdgePolylines(_EdgePolylines);
|
|
575
680
|
|
|
576
681
|
export const LouvainResult = attachTypedView(_LouvainResult, "labelsView", "labelsPtr", "labelsLen", Uint32Array, "_labelsView");
|
|
577
682
|
export const LeidenResult = attachTypedView(_LeidenResult, "labelsView", "labelsPtr", "labelsLen", Uint32Array, "_labelsView");
|
|
@@ -586,51 +691,52 @@ export const KMeansResult = attachTypedView(
|
|
|
586
691
|
"_centroidsView",
|
|
587
692
|
);
|
|
588
693
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
if (layout instanceof _Layout2d) return this._runScheduleWindow2d(layout, startIter, count);
|
|
592
|
-
if (layout instanceof _ManifoldLayout2d) return this._runScheduleWindowManifold(layout, startIter, count);
|
|
593
|
-
throw new TypeError("SgdSolver.runScheduleWindow: expected Layout2d or ManifoldLayout2d");
|
|
594
|
-
};
|
|
694
|
+
const allTargetFlags = { supports3d: true, supportsNd: true, supportsManifold: true };
|
|
695
|
+
const euclideanTargetFlags = { supports3d: true, supportsNd: true };
|
|
595
696
|
|
|
596
|
-
export const
|
|
597
|
-
export const
|
|
598
|
-
export const
|
|
697
|
+
export const SgdSolver = attachScheduleWindow(attachSolverDispatch(_SgdSolver, allTargetFlags));
|
|
698
|
+
export const Sgd2Solver = attachScheduleWindow(attachSolverDispatch(_Sgd2Solver, allTargetFlags));
|
|
699
|
+
export const PacmapGraphSolver = attachSolverDispatch(_PacmapGraphSolver, allTargetFlags);
|
|
700
|
+
export const LargeVisSolver = attachSolverDispatch(_LargeVisSolver, allTargetFlags);
|
|
701
|
+
export const DrGraphSolver = attachSolverDispatch(_DrGraphSolver, allTargetFlags);
|
|
702
|
+
export const GraphCneSolver = attachSolverDispatch(_GraphCneSolver, allTargetFlags);
|
|
703
|
+
export const SnapTFdpSolver = attachSolverDispatch(_SnapTFdpSolver, allTargetFlags);
|
|
599
704
|
|
|
600
|
-
export const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
if (layout instanceof _ManifoldLayout2d) return this._computeStressManifold(layout);
|
|
605
|
-
throw new TypeError("StressMajorizationSolver.computeStress: unsupported layout type");
|
|
606
|
-
};
|
|
705
|
+
export const TsNetSolver = attachSolverDispatch(_TsNetSolver, allTargetFlags);
|
|
706
|
+
export const GuMapSolver = attachSolverDispatch(_GuMapSolver, allTargetFlags);
|
|
707
|
+
export const FruchtermanReingoldSolver = attachSolverDispatch(_FruchtermanReingoldSolver, allTargetFlags);
|
|
708
|
+
export const KamadaKawaiSolver = attachSolverDispatch(_KamadaKawaiSolver, allTargetFlags);
|
|
607
709
|
|
|
608
|
-
export const
|
|
609
|
-
|
|
710
|
+
export const StressMajorizationSolver = attachSolverDispatch(_StressMajorizationSolver, allTargetFlags);
|
|
711
|
+
StressMajorizationSolver.prototype.computeStress = function computeStress(layout) {
|
|
610
712
|
if (layout instanceof _Layout2d) return this._computeStress2d(layout);
|
|
713
|
+
if (layout instanceof _Layout3d) return this._computeStress3d(layout);
|
|
611
714
|
if (layout instanceof _LayoutNd) return this._computeStressNd(layout);
|
|
612
715
|
if (layout instanceof _ManifoldLayout2d) return this._computeStressManifold(layout);
|
|
613
|
-
throw
|
|
716
|
+
throw makeDispatchError("UnsupportedOperation", "StressMajorizationSolver.computeStress: unsupported layout type");
|
|
614
717
|
};
|
|
615
718
|
|
|
616
|
-
export const LinLogSolver = attachSolverDispatch(_LinLogSolver,
|
|
719
|
+
export const LinLogSolver = attachSolverDispatch(_LinLogSolver, euclideanTargetFlags);
|
|
617
720
|
LinLogSolver.prototype.energy = function energy(layout) {
|
|
618
721
|
if (layout instanceof _Layout2d) return this._energy2d(layout);
|
|
722
|
+
if (layout instanceof _Layout3d) return this._energy3d(layout);
|
|
619
723
|
if (layout instanceof _LayoutNd) return this._energyNd(layout);
|
|
620
|
-
throw
|
|
724
|
+
throw makeDispatchError("UnsupportedOperation", "LinLogSolver.energy: expected Layout2d, Layout3d, or LayoutNd");
|
|
621
725
|
};
|
|
622
726
|
|
|
623
|
-
export const ForceAtlas2Solver = attachSolverDispatch(_ForceAtlas2Solver,
|
|
624
|
-
export const YifanHuSolver = attachSolverDispatch(_YifanHuSolver,
|
|
625
|
-
export const MaxentStressSolver = attachSolverDispatch(_MaxentStressSolver,
|
|
626
|
-
export const
|
|
727
|
+
export const ForceAtlas2Solver = attachSolverDispatch(_ForceAtlas2Solver, euclideanTargetFlags);
|
|
728
|
+
export const YifanHuSolver = attachSolverDispatch(_YifanHuSolver, euclideanTargetFlags);
|
|
729
|
+
export const MaxentStressSolver = attachSolverDispatch(_MaxentStressSolver, euclideanTargetFlags);
|
|
730
|
+
export const TFdpSolver = attachSolverDispatch(_TFdpSolver, euclideanTargetFlags);
|
|
627
731
|
|
|
628
732
|
export const ArenaOctree3d = _ArenaOctree3d;
|
|
629
733
|
ArenaOctree3d.prototype.build = function build(coordsOrLayout) {
|
|
734
|
+
if (coordsOrLayout instanceof _Layout3d) return this.build3d(coordsOrLayout);
|
|
630
735
|
if (coordsOrLayout instanceof _LayoutNd) return this.buildNd(coordsOrLayout);
|
|
631
736
|
return this._buildFlat(coordsOrLayout);
|
|
632
737
|
};
|
|
633
738
|
ArenaOctree3d.prototype.buildWeighted = function buildWeighted(coordsOrLayout, masses) {
|
|
739
|
+
if (coordsOrLayout instanceof _Layout3d) return this.buildWeighted3d(coordsOrLayout, masses);
|
|
634
740
|
if (coordsOrLayout instanceof _LayoutNd) return this.buildWeightedNd(coordsOrLayout, masses);
|
|
635
741
|
return this._buildWeightedFlat(coordsOrLayout, masses);
|
|
636
742
|
};
|
|
@@ -645,6 +751,7 @@ export const DynamicKdTree = new Proxy(_DynamicKdTree, {
|
|
|
645
751
|
});
|
|
646
752
|
|
|
647
753
|
export function evaluateMetrics(graph, layout, targets, ...args) {
|
|
754
|
+
if (layout instanceof _Layout3d) return _evaluateMetrics3d(graph, layout, targets, ...args);
|
|
648
755
|
if (layout instanceof _LayoutNd) return _evaluateMetricsNd(graph, layout, targets, ...args);
|
|
649
756
|
if (layout instanceof _ManifoldLayout2d) return _evaluateMetricsManifold(graph, layout, targets, ...args);
|
|
650
757
|
if (layout instanceof _Layout2d) {
|
|
@@ -654,45 +761,45 @@ export function evaluateMetrics(graph, layout, targets, ...args) {
|
|
|
654
761
|
}
|
|
655
762
|
return _evaluateMetrics2d(graph, layout, targets, ...args);
|
|
656
763
|
}
|
|
657
|
-
throw
|
|
764
|
+
throw makeDispatchError("UnsupportedOperation", "evaluateMetrics: unsupported layout type");
|
|
658
765
|
}
|
|
659
766
|
|
|
660
|
-
export const scaleNormalizedStress =
|
|
661
|
-
export const scaleNormalizedStressDetail =
|
|
662
|
-
export const sampledScaleNormalizedStress =
|
|
663
|
-
export const scaleNormalizedStressFromDistances =
|
|
664
|
-
export const neighborhoodPreservation1Hop =
|
|
665
|
-
export const neighborhoodPreservation2Hop =
|
|
666
|
-
export const sampledNp1 =
|
|
667
|
-
export const sampledNp2 =
|
|
668
|
-
export const gabrielGraphProperty =
|
|
669
|
-
export const nodeResolution =
|
|
670
|
-
export const drngPreservation =
|
|
671
|
-
export const dggPreservation =
|
|
672
|
-
export const idealEdgeLengths =
|
|
673
|
-
export const idealEdgeLengthsWithUnit =
|
|
674
|
-
export const layoutDegeneracy =
|
|
675
|
-
export const gabrielGraphEdges =
|
|
676
|
-
export const relativeNeighborhoodEdges =
|
|
677
|
-
export const landmarkStratifiedRta =
|
|
678
|
-
export const landmarkStratifiedRtaDetail =
|
|
679
|
-
export const landmarkStratifiedRtaFromLandmarks =
|
|
680
|
-
export const torusCrossingNumber =
|
|
681
|
-
export const crossingEdgesTorus =
|
|
682
|
-
export const torusLayoutEdgeSegments =
|
|
683
|
-
export const cqKmeans =
|
|
684
|
-
export const cqHac =
|
|
685
|
-
export const distanceConsistency =
|
|
686
|
-
export const distributionConsistency =
|
|
687
|
-
export const sepmeKnng =
|
|
688
|
-
export const sepmeRng =
|
|
689
|
-
export const sepmeGab =
|
|
690
|
-
export const sepmeGong =
|
|
691
|
-
export const neighborhoodHit =
|
|
692
|
-
export const silhouetteScore =
|
|
693
|
-
export const calinskiHarabaszScore =
|
|
694
|
-
export const daviesBouldinScore =
|
|
695
|
-
export const pairwiseDistanceOverlapError =
|
|
767
|
+
export const scaleNormalizedStress = dispatchGraphLayout4("scaleNormalizedStress", _scaleNormalizedStress2d, _scaleNormalizedStress3d, _scaleNormalizedStressNd, _scaleNormalizedStressManifold);
|
|
768
|
+
export const scaleNormalizedStressDetail = dispatchGraphLayout4("scaleNormalizedStressDetail", _scaleNormalizedStressDetail2d, _scaleNormalizedStressDetail3d, _scaleNormalizedStressDetailNd, _scaleNormalizedStressDetailManifold);
|
|
769
|
+
export const sampledScaleNormalizedStress = dispatchGraphLayout4("sampledScaleNormalizedStress", _sampledScaleNormalizedStress2d, _sampledScaleNormalizedStress3d, _sampledScaleNormalizedStressNd, _sampledScaleNormalizedStressManifold);
|
|
770
|
+
export const scaleNormalizedStressFromDistances = dispatchLayout4("scaleNormalizedStressFromDistances", _scaleNormalizedStressFromDistances2d, _scaleNormalizedStressFromDistances3d, _scaleNormalizedStressFromDistancesNd, _scaleNormalizedStressFromDistancesManifold);
|
|
771
|
+
export const neighborhoodPreservation1Hop = dispatchGraphLayout4("neighborhoodPreservation1Hop", _neighborhoodPreservation1Hop2d, _neighborhoodPreservation1Hop3d, _neighborhoodPreservation1HopNd, _neighborhoodPreservation1HopManifold);
|
|
772
|
+
export const neighborhoodPreservation2Hop = dispatchGraphLayout4("neighborhoodPreservation2Hop", _neighborhoodPreservation2Hop2d, _neighborhoodPreservation2Hop3d, _neighborhoodPreservation2HopNd, _neighborhoodPreservation2HopManifold);
|
|
773
|
+
export const sampledNp1 = dispatchGraphLayout4("sampledNp1", _sampledNp12d, _sampledNp13d, _sampledNp1Nd, _sampledNp1Manifold);
|
|
774
|
+
export const sampledNp2 = dispatchGraphLayout4("sampledNp2", _sampledNp22d, _sampledNp23d, _sampledNp2Nd, _sampledNp2Manifold);
|
|
775
|
+
export const gabrielGraphProperty = dispatchGraphLayout4("gabrielGraphProperty", _gabrielGraphProperty2d, _gabrielGraphProperty3d, _gabrielGraphPropertyNd, _gabrielGraphPropertyManifold);
|
|
776
|
+
export const nodeResolution = dispatchLayout4("nodeResolution", _nodeResolution2d, _nodeResolution3d, _nodeResolutionNd, _nodeResolutionManifold);
|
|
777
|
+
export const drngPreservation = dispatchGraphLayout4("drngPreservation", _drngPreservation2d, _drngPreservation3d, _drngPreservationNd, _drngPreservationManifold);
|
|
778
|
+
export const dggPreservation = dispatchGraphLayout4("dggPreservation", _dggPreservation2d, _dggPreservation3d, _dggPreservationNd, _dggPreservationManifold);
|
|
779
|
+
export const idealEdgeLengths = dispatchGraphLayout4("idealEdgeLengths", _idealEdgeLengths2d, _idealEdgeLengths3d, _idealEdgeLengthsNd, _idealEdgeLengthsManifold);
|
|
780
|
+
export const idealEdgeLengthsWithUnit = dispatchGraphLayout4("idealEdgeLengthsWithUnit", _idealEdgeLengthsWithUnit2d, _idealEdgeLengthsWithUnit3d, _idealEdgeLengthsWithUnitNd, _idealEdgeLengthsWithUnitManifold);
|
|
781
|
+
export const layoutDegeneracy = dispatchGraphLayout4("layoutDegeneracy", _layoutDegeneracy2d, _layoutDegeneracy3d, _layoutDegeneracyNd, _layoutDegeneracyManifold);
|
|
782
|
+
export const gabrielGraphEdges = dispatchLayout4("gabrielGraphEdges", _gabrielGraphEdges2d, _gabrielGraphEdges3d, _gabrielGraphEdgesNd, _gabrielGraphEdgesManifold);
|
|
783
|
+
export const relativeNeighborhoodEdges = dispatchLayout4("relativeNeighborhoodEdges", _relativeNeighborhoodEdges2d, _relativeNeighborhoodEdges3d, _relativeNeighborhoodEdgesNd, _relativeNeighborhoodEdgesManifold);
|
|
784
|
+
export const landmarkStratifiedRta = dispatchGraphLayout4("landmarkStratifiedRta", _landmarkStratifiedRta2d, _landmarkStratifiedRta3d, _landmarkStratifiedRtaNd, _landmarkStratifiedRtaManifold);
|
|
785
|
+
export const landmarkStratifiedRtaDetail = dispatchGraphLayout4("landmarkStratifiedRtaDetail", _landmarkStratifiedRtaDetail2d, _landmarkStratifiedRtaDetail3d, _landmarkStratifiedRtaDetailNd, _landmarkStratifiedRtaDetailManifold);
|
|
786
|
+
export const landmarkStratifiedRtaFromLandmarks = dispatchLayout4("landmarkStratifiedRtaFromLandmarks", _landmarkStratifiedRtaFromLandmarks2d, _landmarkStratifiedRtaFromLandmarks3d, _landmarkStratifiedRtaFromLandmarksNd, _landmarkStratifiedRtaFromLandmarksManifold);
|
|
787
|
+
export const torusCrossingNumber = dispatchGraphLayout4("torusCrossingNumber", _torusCrossingNumber2d, null, null, _torusCrossingNumberManifold);
|
|
788
|
+
export const crossingEdgesTorus = dispatchGraphLayout4("crossingEdgesTorus", _crossingEdgesTorus2d, null, null, _crossingEdgesTorusManifold);
|
|
789
|
+
export const torusLayoutEdgeSegments = dispatchGraphLayout4("torusLayoutEdgeSegments", _torusLayoutEdgeSegments2d, null, null, _torusLayoutEdgeSegmentsManifold);
|
|
790
|
+
export const cqKmeans = dispatchLayout4("cqKmeans", _cqKmeans2d, _cqKmeans3d, _cqKmeansNd, _cqKmeansManifold);
|
|
791
|
+
export const cqHac = dispatchLayout4("cqHac", _cqHac2d, _cqHac3d, _cqHacNd, _cqHacManifold);
|
|
792
|
+
export const distanceConsistency = dispatchLayout4("distanceConsistency", _distanceConsistency2d, _distanceConsistency3d, _distanceConsistencyNd, _distanceConsistencyManifold);
|
|
793
|
+
export const distributionConsistency = dispatchLayout4("distributionConsistency", _distributionConsistency2d, _distributionConsistency3d, _distributionConsistencyNd, _distributionConsistencyManifold);
|
|
794
|
+
export const sepmeKnng = dispatchLayout4("sepmeKnng", _sepmeKnng2d, _sepmeKnng3d, _sepmeKnngNd, _sepmeKnngManifold);
|
|
795
|
+
export const sepmeRng = dispatchLayout4("sepmeRng", _sepmeRng2d, _sepmeRng3d, _sepmeRngNd, _sepmeRngManifold);
|
|
796
|
+
export const sepmeGab = dispatchLayout4("sepmeGab", _sepmeGab2d, _sepmeGab3d, _sepmeGabNd, _sepmeGabManifold);
|
|
797
|
+
export const sepmeGong = dispatchLayout4("sepmeGong", _sepmeGong2d, _sepmeGong3d, _sepmeGongNd, _sepmeGongManifold);
|
|
798
|
+
export const neighborhoodHit = dispatchLayout4("neighborhoodHit", _neighborhoodHit2d, _neighborhoodHit3d, _neighborhoodHitNd, _neighborhoodHitManifold);
|
|
799
|
+
export const silhouetteScore = dispatchLayout4("silhouetteScore", _silhouetteScore2d, _silhouetteScore3d, _silhouetteScoreNd, _silhouetteScoreManifold);
|
|
800
|
+
export const calinskiHarabaszScore = dispatchLayout4("calinskiHarabaszScore", _calinskiHarabaszScore2d, _calinskiHarabaszScore3d, _calinskiHarabaszScoreNd, _calinskiHarabaszScoreManifold);
|
|
801
|
+
export const daviesBouldinScore = dispatchLayout4("daviesBouldinScore", _daviesBouldinScore2d, _daviesBouldinScore3d, _daviesBouldinScoreNd, _daviesBouldinScoreManifold);
|
|
802
|
+
export const pairwiseDistanceOverlapError = dispatchLayout4("pairwiseDistanceOverlapError", _pairwiseDistanceOverlapError2d, _pairwiseDistanceOverlapError3d, _pairwiseDistanceOverlapErrorNd, _pairwiseDistanceOverlapErrorManifold);
|
|
696
803
|
|
|
697
804
|
export {
|
|
698
805
|
AdjustedPatchNigDetail,
|
|
@@ -704,8 +811,10 @@ export {
|
|
|
704
811
|
BackboneSolver,
|
|
705
812
|
ChebyshevDogKernel,
|
|
706
813
|
ClassDensityResult,
|
|
814
|
+
ClassicalMds,
|
|
707
815
|
ClusterAreaReport,
|
|
708
816
|
ClusterRefineSolver,
|
|
817
|
+
CoarseBackbone,
|
|
709
818
|
CoarseBackboneResult,
|
|
710
819
|
CoarsenedGraphResult,
|
|
711
820
|
CoarsenedHierarchyResult,
|
|
@@ -720,15 +829,18 @@ export {
|
|
|
720
829
|
DogVaradhanLandmarks,
|
|
721
830
|
EffectiveResistanceResult,
|
|
722
831
|
EigenResult,
|
|
832
|
+
FdebSolver,
|
|
723
833
|
FitFieldStats,
|
|
724
834
|
ForbidOverlapRemoval,
|
|
725
835
|
GTreeOverlapRemoval,
|
|
726
836
|
GemSolver,
|
|
727
837
|
GripSolver,
|
|
728
838
|
GroupInABoxSolver,
|
|
839
|
+
Hde,
|
|
729
840
|
HybridKnnResult,
|
|
730
841
|
IbUmapSolver,
|
|
731
842
|
KnnGraph,
|
|
843
|
+
KorenSpectral,
|
|
732
844
|
LargestConnectedComponentResult,
|
|
733
845
|
LayoutDegeneracy,
|
|
734
846
|
MetricReport,
|
|
@@ -737,8 +849,10 @@ export {
|
|
|
737
849
|
PacmapBackboneResult,
|
|
738
850
|
PartitionAgreementResult,
|
|
739
851
|
PfsPrimeOverlapRemoval,
|
|
852
|
+
PivotMds,
|
|
740
853
|
PrismDistortion,
|
|
741
854
|
PrismOverlapRemoval,
|
|
855
|
+
RdMds,
|
|
742
856
|
ResistanceCurvatureFlowResult,
|
|
743
857
|
ResistanceCurvatureStep,
|
|
744
858
|
RhghLandmarks,
|
|
@@ -749,7 +863,7 @@ export {
|
|
|
749
863
|
ScreenedPoissonResult,
|
|
750
864
|
SelLayoutSolver,
|
|
751
865
|
SeparationConstraint,
|
|
752
|
-
|
|
866
|
+
SfcLayout,
|
|
753
867
|
Sparse12HopPairs,
|
|
754
868
|
SparseBarrierStats,
|
|
755
869
|
SparseProbabilities,
|
|
@@ -759,7 +873,6 @@ export {
|
|
|
759
873
|
SpectralEmbeddingResult,
|
|
760
874
|
SpectralMomentStats,
|
|
761
875
|
StressEvaluation,
|
|
762
|
-
TFdpSolver,
|
|
763
876
|
TorusCrossing,
|
|
764
877
|
TsNetStage,
|
|
765
878
|
TwinDeclutterer,
|