@graphty/graphty-element 2.5.2 → 2.6.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/ai.js +3 -3
- package/dist/catalog.d.ts +16 -0
- package/dist/catalog.js +34 -32
- package/dist/chunks/{AiManager-CrbvKdEK.js → AiManager-4iQpsJW1.js} +4 -4
- package/dist/chunks/{DataSource-qU-nLhXN.js → DataSource-BL2UzPff.js} +2 -2
- package/dist/chunks/GraphSession-BhuHSXIo.js +12819 -0
- package/dist/chunks/{GraphtyLogger-DOTwCiMR.js → GraphtyLogger-B_O67a6c.js} +1 -1
- package/dist/chunks/{VoiceInputAdapter-D4NrRL_1.js → VoiceInputAdapter-Cc6mHXTI.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-Uqa47vmo.js → XRPivotCameraController-BLa89LXn.js} +2 -2
- package/dist/chunks/{algorithms-D-ab-Auu.js → algorithms-BJ6DQMOe.js} +931 -781
- package/dist/chunks/{capability-check-Vw3IcqiE.js → capability-check-Am2zliFj.js} +1 -1
- package/dist/chunks/{detect-B4Qrw976.js → detect-fyuVnlCT.js} +1 -1
- package/dist/chunks/{format-detection-r2IfNFXO.js → format-detection-BHwrAVzW.js} +1 -1
- package/dist/chunks/{index-J9MgLio9.js → index-BkBLbvui.js} +2691 -2434
- package/dist/chunks/optionsFromZod-CKMYSwTz.js +3636 -0
- package/dist/chunks/{paletteRegistry-Kt-6CeoN.js → paletteRegistry-BCFSwJGK.js} +224 -189
- package/dist/chunks/parse-BMTqt4SS.js +3658 -0
- package/dist/chunks/{types-C_c53VgR.js → types-DFchv4Ny.js} +4 -1
- package/dist/custom-elements.json +1 -1
- package/dist/extend.d.ts +10 -8
- package/dist/extend.js +6 -6
- package/dist/graphty-catalog.json +75 -38
- package/dist/graphty.bundle.js +55368 -48970
- package/dist/graphty.js +19 -19
- package/dist/index.d.ts +1 -1
- package/dist/logging.js +2 -2
- package/dist/schema.d.ts +15 -1
- package/dist/schema.js +1 -1
- package/dist/session.d.ts +30 -7
- package/dist/session.js +40 -37
- package/dist/src/Graph.d.ts +35 -7
- package/dist/src/acceleration/types.d.ts +79 -43
- package/dist/src/algorithms/Algorithm.d.ts +52 -4
- package/dist/src/algorithms/BFSAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/BellmanFordAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/BetweennessCentralityAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/BipartiteMatchingAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/ClosenessCentralityAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/ConnectedComponentsAlgorithm.d.ts +4 -1
- package/dist/src/algorithms/DFSAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/DegreeAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/DijkstraAlgorithm.d.ts +6 -0
- package/dist/src/algorithms/EigenvectorCentralityAlgorithm.d.ts +2 -0
- package/dist/src/algorithms/FloydWarshallAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/GirvanNewmanAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/HITSAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/KCoreAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/KatzCentralityAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/KruskalAlgorithm.d.ts +4 -1
- package/dist/src/algorithms/LabelPropagationAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/LeidenAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/LinkPredictionAlgorithm.d.ts +4 -1
- package/dist/src/algorithms/LouvainAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/MaxFlowAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/MinCutAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/PageRankAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/PrimAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/StronglyConnectedComponentsAlgorithm.d.ts +3 -0
- package/dist/src/algorithms/input/ScopedInput.d.ts +185 -0
- package/dist/src/algorithms/input/derivedInputs.d.ts +199 -0
- package/dist/src/algorithms/input/maskBack.d.ts +37 -0
- package/dist/src/algorithms/metrics/MetricAlgorithm.d.ts +3 -3
- package/dist/src/algorithms/results/DeclaredAlgorithm.d.ts +4 -3
- package/dist/src/algorithms/results/types.d.ts +28 -6
- package/dist/src/algorithms/utils/communityUtils.d.ts +0 -48
- package/dist/src/algorithms/utils/graphUtils.d.ts +2 -68
- package/dist/src/algorithms/utils/snapshotGraph.d.ts +3 -1
- package/dist/src/catalog/algorithms.d.ts +3 -0
- package/dist/src/catalog/layouts.d.ts +2 -0
- package/dist/src/catalog/sets/canonical.d.ts +68 -0
- package/dist/src/catalog/sets/hash.d.ts +126 -0
- package/dist/src/catalog/sets/parse.d.ts +115 -0
- package/dist/src/catalog/types.d.ts +329 -8
- package/dist/src/data/GraphStore.d.ts +73 -1
- package/dist/src/data/edgeIdentity.d.ts +202 -1
- package/dist/src/data/ingest.d.ts +3 -1
- package/dist/src/data/report.d.ts +20 -0
- package/dist/src/graphty-element.d.ts +42 -6
- package/dist/src/layout/D3GraphLayoutEngine.d.ts +11 -0
- package/dist/src/layout/LayoutEngine.d.ts +56 -0
- package/dist/src/layout/NGraphLayoutEngine.d.ts +10 -0
- package/dist/src/layout/SimulationLayoutEngine.d.ts +11 -0
- package/dist/src/managers/AlgorithmManager.d.ts +8 -0
- package/dist/src/managers/DataManager.d.ts +11 -0
- package/dist/src/managers/LayoutManager.d.ts +126 -2
- package/dist/src/managers/StatsManager.d.ts +1 -0
- package/dist/src/session/GraphSession.d.ts +48 -0
- package/dist/src/session/attributes.d.ts +121 -1
- package/dist/src/session/cost/estimate.d.ts +20 -0
- package/dist/src/session/cost/index.d.ts +1 -1
- package/dist/src/session/planning.d.ts +32 -2
- package/dist/src/session/query.d.ts +7 -0
- package/dist/src/session/results/ResultsApi.d.ts +14 -1
- package/dist/src/session/runs/Run.d.ts +65 -4
- package/dist/src/session/runs/RunsApi.d.ts +58 -2
- package/dist/src/session/runs/runId.d.ts +55 -6
- package/dist/src/session/runs/types.d.ts +36 -8
- package/dist/src/session/scope/ElementMask.d.ts +14 -1
- package/dist/src/session/scope/ScopeApi.d.ts +160 -31
- package/dist/src/session/scope/index.d.ts +1 -1
- package/dist/src/session/selection/SelectionApi.d.ts +15 -10
- package/dist/src/session/selection/index.d.ts +1 -1
- package/dist/src/session/selection/targets.d.ts +6 -7
- package/dist/src/session/sets/SetsApi.d.ts +110 -0
- package/dist/src/session/sets/algebra.d.ts +124 -0
- package/dist/src/session/sets/cache.d.ts +197 -0
- package/dist/src/session/sets/captures.d.ts +83 -0
- package/dist/src/session/sets/dependencies.d.ts +167 -0
- package/dist/src/session/sets/layers.d.ts +101 -0
- package/dist/src/session/sets/notify.d.ts +122 -0
- package/dist/src/session/sets/offers.d.ts +103 -0
- package/dist/src/session/sets/path.d.ts +37 -0
- package/dist/src/session/sets/prepare.d.ts +209 -0
- package/dist/src/session/sets/resolve.d.ts +311 -0
- package/dist/src/session/sets/signature.d.ts +77 -0
- package/dist/src/session/sets/status.d.ts +98 -0
- package/dist/src/session/sets/store.d.ts +196 -0
- package/dist/src/session/sets/types.d.ts +386 -0
- package/dist/src/session/styles/Layer.d.ts +9 -2
- package/dist/src/session/styles/StylesApi.d.ts +5 -2
- package/dist/src/session/styles/explain.d.ts +5 -2
- package/dist/src/session/styles/predicate.d.ts +41 -2
- package/dist/src/session/styles/repaint.d.ts +19 -0
- package/dist/src/session/styles/selector.d.ts +16 -5
- package/dist/src/session/types.d.ts +18 -0
- package/dist/src/session/visibility/VisibilityApi.d.ts +47 -3
- package/dist/src/session/visibility/filter.d.ts +86 -51
- package/dist/src/session/visibility/index.d.ts +1 -1
- package/dist/src/testing/fakeAccelerator.d.ts +5 -0
- package/dist/src/utils/queue-migration.d.ts +17 -0
- package/package.json +15 -9
- package/dist/chunks/GraphSession-DuAhRgCd.js +0 -8622
- package/dist/chunks/optionsFromZod-B9RncoTX.js +0 -2578
- package/dist/chunks/scales-CJCRwi2J.js +0 -3220
- package/dist/src/algorithms/utils/index.d.ts +0 -6
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type AcceleratedAlgorithms, type Graph as AlgorithmGraph } from "@graphty/algorithms";
|
|
2
2
|
import { type GraphSnapshot, type U32 } from "@graphty/graph-format";
|
|
3
3
|
import { type AccelerationPrecision } from "../acceleration/types";
|
|
4
|
-
import type { AlgorithmDescriptor, FieldDescriptor, NodeId } from "../catalog/types";
|
|
4
|
+
import type { AlgorithmDescriptor, EdgeId, FieldDescriptor, NodeId } from "../catalog/types";
|
|
5
5
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
6
6
|
import { Graph } from "../Graph";
|
|
7
7
|
import type { RunResult } from "../session/results";
|
|
8
|
-
import type {
|
|
8
|
+
import type { InputOrientation, SimplifyPolicy } from "./input/derivedInputs";
|
|
9
|
+
import { type ElementScopedInput, type ScopedInputOptions, type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
10
|
+
import type { RunControls } from "./results/types";
|
|
9
11
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
10
12
|
import { type AlgorithmGraphMode } from "./utils/snapshotGraph";
|
|
11
13
|
/**
|
|
@@ -73,6 +75,11 @@ export interface AlgorithmStatics {
|
|
|
73
75
|
* and nothing at all identifying the code that actually did the work.
|
|
74
76
|
*/
|
|
75
77
|
version?: string;
|
|
78
|
+
/**
|
|
79
|
+
* What a run over a scope computes on. See {@link Algorithm.scopeInput}; `register` publishes
|
|
80
|
+
* it as the descriptor's `scopeInput`.
|
|
81
|
+
*/
|
|
82
|
+
scopeInput?: ScopeInputDeclaration;
|
|
76
83
|
optionsSchema: OptionsSchema;
|
|
77
84
|
/** @deprecated Use getZodOptionsSchema() instead */
|
|
78
85
|
getOptionsSchema(): OptionsSchema;
|
|
@@ -104,7 +111,8 @@ export interface AcceleratedAlgorithmRun {
|
|
|
104
111
|
* The snapshot the work runs over: the declared one for `"directed"`, the undirected view for
|
|
105
112
|
* `"undirected"`, in either case with every group of parallel edges collapsed to one edge
|
|
106
113
|
* carrying the group's summed weight. Its `ids` map is how a node id becomes the index every
|
|
107
|
-
* result is keyed by
|
|
114
|
+
* result is keyed by: the declared node space for the whole graph, the scope's compact one
|
|
115
|
+
* for an algorithm that declares a scoped input.
|
|
108
116
|
*/
|
|
109
117
|
readonly snapshot: GraphSnapshot;
|
|
110
118
|
/**
|
|
@@ -178,6 +186,26 @@ export declare abstract class Algorithm<TOptions extends Record<string, unknown>
|
|
|
178
186
|
* This is the new unified system that provides both validation and UI metadata.
|
|
179
187
|
*/
|
|
180
188
|
static zodOptionsSchema?: ZodOptionsSchema;
|
|
189
|
+
/**
|
|
190
|
+
* Whether this algorithm computes over its run's scope. `"subgraph"`: the run context's
|
|
191
|
+
* `input` hands the algorithm its scope (the compact snapshot, and the scope's masks over the
|
|
192
|
+
* full graph), and the planner estimates the run over the scope. Absent or `"none"`: the whole
|
|
193
|
+
* graph, of whose values the element keeps the scope's, with a caveat saying so; the planner
|
|
194
|
+
* estimates and refuses the run as a whole-graph one.
|
|
195
|
+
*
|
|
196
|
+
* THE ONE DECLARATION: the input, the caveat and the published `descriptor.scopeInput` all
|
|
197
|
+
* read it. Declare it only once every node list, edge read and count the class takes comes
|
|
198
|
+
* from the input, because an algorithm that lists its nodes some other way would compute over
|
|
199
|
+
* a scoped topology while reporting every node.
|
|
200
|
+
*/
|
|
201
|
+
static scopeInput?: ScopeInputDeclaration;
|
|
202
|
+
/**
|
|
203
|
+
* How this class's input merges a group of parallel edges into one: `"sum"` when absent, the
|
|
204
|
+
* element's reading of a repeated edge as more connection. A shortest path wants `"min"`, the
|
|
205
|
+
* cheapest of the group. Both seams read it, and the run's caveat names it.
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
208
|
+
static parallelEdges?: SimplifyPolicy;
|
|
181
209
|
protected graph: Graph;
|
|
182
210
|
/**
|
|
183
211
|
* Resolved options for this algorithm instance
|
|
@@ -217,6 +245,26 @@ export declare abstract class Algorithm<TOptions extends Record<string, unknown>
|
|
|
217
245
|
* @returns a freshly built Graph for the algorithm package
|
|
218
246
|
*/
|
|
219
247
|
protected algorithmGraph(mode: AlgorithmGraphMode): AlgorithmGraph;
|
|
248
|
+
/**
|
|
249
|
+
* The graph this run computes over, in one orientation: its scope's compact snapshot when the
|
|
250
|
+
* class declares {@link Algorithm.scopeInput} and runs as a run, else the whole graph. Both
|
|
251
|
+
* seams below read through it.
|
|
252
|
+
* @param orientation - `"declared"` or `"undirected"`.
|
|
253
|
+
* @param options - How parallel edges merge; the class's {@link Algorithm.parallelEdges} by
|
|
254
|
+
* default, else `"sum"`.
|
|
255
|
+
* @returns The input.
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
protected input(orientation: InputOrientation, options?: ScopedInputOptions): ElementScopedInput;
|
|
259
|
+
/**
|
|
260
|
+
* One edge's record, by the id an input named it by: for an attribute the snapshot does not
|
|
261
|
+
* carry yet, such as a flow capacity. It is not a topology read -- the ids come from the input
|
|
262
|
+
* -- and it goes away once the store carries attribute columns.
|
|
263
|
+
* @param id - The edge's session id, from `scopeEdges`.
|
|
264
|
+
* @returns The record the edge was loaded from, or undefined.
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
protected edgeRecord(id: EdgeId): Readonly<Record<string, unknown>> | undefined;
|
|
220
268
|
/**
|
|
221
269
|
* The route an algorithm with an accelerated implementation takes.
|
|
222
270
|
*
|
|
@@ -295,7 +343,7 @@ export declare abstract class Algorithm<TOptions extends Record<string, unknown>
|
|
|
295
343
|
* @throws A `GraphtyError` with code `E_UNSUPPORTED` when this algorithm has no result to
|
|
296
344
|
* publish.
|
|
297
345
|
*/
|
|
298
|
-
publishResult(_context:
|
|
346
|
+
publishResult(_context: RunControls, runId: string, _fields?: readonly FieldDescriptor[]): Promise<RunResult | undefined>;
|
|
299
347
|
/**
|
|
300
348
|
* Registers an algorithm class in the global registry
|
|
301
349
|
* @param cls - The algorithm class to register
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -19,6 +20,8 @@ interface BFSOptions extends Record<string, unknown> {
|
|
|
19
20
|
export declare class BFSAlgorithm extends DeclaredAlgorithm<BFSOptions> {
|
|
20
21
|
static namespace: string;
|
|
21
22
|
static type: string;
|
|
23
|
+
/** Walks the run's scope: the node list and the graph both come from the input. */
|
|
24
|
+
static scopeInput: ScopeInputDeclaration;
|
|
22
25
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
23
26
|
/**
|
|
24
27
|
* Options schema for BFS algorithm
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -17,6 +18,8 @@ interface BellmanFordOptions extends Record<string, unknown> {
|
|
|
17
18
|
export declare class BellmanFordAlgorithm extends DeclaredAlgorithm<BellmanFordOptions> {
|
|
18
19
|
static namespace: string;
|
|
19
20
|
static type: string;
|
|
21
|
+
/** Searches the run's scope: the node and edge lists and the graph all come from the input. */
|
|
22
|
+
static scopeInput: ScopeInputDeclaration;
|
|
20
23
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
21
24
|
static optionsSchema: OptionsSchema;
|
|
22
25
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
3
4
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,8 @@ import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
|
11
12
|
export declare class BetweennessCentralityAlgorithm extends MetricAlgorithm {
|
|
12
13
|
static namespace: string;
|
|
13
14
|
static type: string;
|
|
15
|
+
/** Computes over the run's scope: the node list and the graph both come from the input. */
|
|
16
|
+
static scopeInput: ScopeInputDeclaration;
|
|
14
17
|
/**
|
|
15
18
|
* The fields a betweenness result publishes.
|
|
16
19
|
* @returns The uniform node-metric fields.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* A matching is a set of edges without common vertices.
|
|
6
6
|
* Maximum matching has the largest possible number of edges.
|
|
7
7
|
*/
|
|
8
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
8
9
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
9
10
|
/**
|
|
10
11
|
* Bipartite Matching algorithm for finding maximum matchings
|
|
@@ -15,6 +16,8 @@ import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } fro
|
|
|
15
16
|
export declare class BipartiteMatchingAlgorithm extends DeclaredAlgorithm {
|
|
16
17
|
static namespace: string;
|
|
17
18
|
static type: string;
|
|
19
|
+
/** Pairs within the run's scope: the edge list and the graph both come from the input. */
|
|
20
|
+
static scopeInput: ScopeInputDeclaration;
|
|
18
21
|
/**
|
|
19
22
|
* Pair up the two sides of a two-sided graph so that as many nodes as possible get a partner.
|
|
20
23
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
3
4
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
4
5
|
/**
|
|
@@ -10,6 +11,8 @@ import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
|
10
11
|
export declare class ClosenessCentralityAlgorithm extends MetricAlgorithm {
|
|
11
12
|
static namespace: string;
|
|
12
13
|
static type: string;
|
|
14
|
+
/** Computes over the run's scope: the node list and the graph both come from the input. */
|
|
15
|
+
static scopeInput: ScopeInputDeclaration;
|
|
13
16
|
/**
|
|
14
17
|
* The fields a closeness result publishes.
|
|
15
18
|
* @returns The uniform node-metric fields.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
1
2
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Connected components: the separate pieces of the graph, or of the run's scope.
|
|
4
5
|
*/
|
|
5
6
|
export declare class ConnectedComponentsAlgorithm extends DeclaredAlgorithm {
|
|
6
7
|
static namespace: string;
|
|
7
8
|
static type: string;
|
|
9
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
10
|
+
static scopeInput: ScopeInputDeclaration;
|
|
8
11
|
/**
|
|
9
12
|
* Find the separate pieces of the graph.
|
|
10
13
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -23,6 +24,8 @@ interface DFSOptions extends Record<string, unknown> {
|
|
|
23
24
|
export declare class DFSAlgorithm extends DeclaredAlgorithm<DFSOptions> {
|
|
24
25
|
static namespace: string;
|
|
25
26
|
static type: string;
|
|
27
|
+
/** Walks the run's scope: the node list and the graph both come from the input. */
|
|
28
|
+
static scopeInput: ScopeInputDeclaration;
|
|
26
29
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
27
30
|
/**
|
|
28
31
|
* Options schema for DFS algorithm
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
3
4
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,8 @@ import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
|
11
12
|
export declare class DegreeAlgorithm extends MetricAlgorithm {
|
|
12
13
|
static namespace: string;
|
|
13
14
|
static type: string;
|
|
15
|
+
/** Counts over the run's scope: the node list and the graph both come from the input. */
|
|
16
|
+
static scopeInput: ScopeInputDeclaration;
|
|
14
17
|
/**
|
|
15
18
|
* The fields a degree result publishes.
|
|
16
19
|
* @returns The uniform node-metric fields, plus `inDegree` and `outDegree`.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import type { SimplifyPolicy } from "./input/derivedInputs";
|
|
3
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
4
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
5
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
4
6
|
/**
|
|
@@ -21,6 +23,10 @@ interface DijkstraOptions extends Record<string, unknown> {
|
|
|
21
23
|
export declare class DijkstraAlgorithm extends DeclaredAlgorithm<DijkstraOptions> {
|
|
22
24
|
static namespace: string;
|
|
23
25
|
static type: string;
|
|
26
|
+
/** Searches the run's scope: the node and edge lists and the graph all come from the input. */
|
|
27
|
+
static scopeInput: ScopeInputDeclaration;
|
|
28
|
+
/** A route takes the cheapest of a group of parallel edges, not their sum. */
|
|
29
|
+
static parallelEdges: SimplifyPolicy;
|
|
24
30
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
25
31
|
/**
|
|
26
32
|
* Options schema for Dijkstra algorithm
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
2
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
3
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
3
4
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
4
5
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
5
6
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
@@ -29,6 +30,7 @@ interface EigenvectorCentralityOptions extends Record<string, unknown> {
|
|
|
29
30
|
export declare class EigenvectorCentralityAlgorithm extends MetricAlgorithm<EigenvectorCentralityOptions> {
|
|
30
31
|
static namespace: string;
|
|
31
32
|
static type: string;
|
|
33
|
+
static scopeInput: ScopeInputDeclaration;
|
|
32
34
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
33
35
|
static optionsSchema: OptionsSchema;
|
|
34
36
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
1
2
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
@@ -5,6 +6,8 @@ import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } fro
|
|
|
5
6
|
export declare class FloydWarshallAlgorithm extends DeclaredAlgorithm {
|
|
6
7
|
static namespace: string;
|
|
7
8
|
static type: string;
|
|
9
|
+
/** Measures every pair of the run's scope: the node list and the graph both come from the input. */
|
|
10
|
+
static scopeInput: ScopeInputDeclaration;
|
|
8
11
|
/**
|
|
9
12
|
* Measure the distance between every pair of nodes, and give each node the distance to the
|
|
10
13
|
* node furthest from it.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -18,6 +19,8 @@ interface GirvanNewmanOptions extends Record<string, unknown> {
|
|
|
18
19
|
export declare class GirvanNewmanAlgorithm extends DeclaredAlgorithm<GirvanNewmanOptions> {
|
|
19
20
|
static namespace: string;
|
|
20
21
|
static type: string;
|
|
22
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
23
|
+
static scopeInput: ScopeInputDeclaration;
|
|
21
24
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
22
25
|
static optionsSchema: OptionsSchema;
|
|
23
26
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
2
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
3
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
3
4
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
4
5
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
5
6
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
@@ -29,6 +30,8 @@ interface HITSOptions extends Record<string, unknown> {
|
|
|
29
30
|
export declare class HITSAlgorithm extends MetricAlgorithm<HITSOptions> {
|
|
30
31
|
static namespace: string;
|
|
31
32
|
static type: string;
|
|
33
|
+
/** Computes over the run's scope: the node list and the graph both come from the input. */
|
|
34
|
+
static scopeInput: ScopeInputDeclaration;
|
|
32
35
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
33
36
|
static optionsSchema: OptionsSchema;
|
|
34
37
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
3
4
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,8 @@ import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
|
11
12
|
export declare class KCoreAlgorithm extends MetricAlgorithm {
|
|
12
13
|
static namespace: string;
|
|
13
14
|
static type: string;
|
|
15
|
+
/** Computes over the run's scope: the node list and the graph both come from the input. */
|
|
16
|
+
static scopeInput: ScopeInputDeclaration;
|
|
14
17
|
/**
|
|
15
18
|
* The fields a k-core result publishes.
|
|
16
19
|
* @returns The uniform node-metric fields.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
2
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
3
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
3
4
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
4
5
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
5
6
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
@@ -31,6 +32,8 @@ interface KatzCentralityOptions extends Record<string, unknown> {
|
|
|
31
32
|
export declare class KatzCentralityAlgorithm extends MetricAlgorithm<KatzCentralityOptions> {
|
|
32
33
|
static namespace: string;
|
|
33
34
|
static type: string;
|
|
35
|
+
/** Computes over the run's scope: the node list and the graph both come from the input. */
|
|
36
|
+
static scopeInput: ScopeInputDeclaration;
|
|
34
37
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
35
38
|
static optionsSchema: OptionsSchema;
|
|
36
39
|
/**
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
* algorithm. It returns an edge set: every edge says whether it is in the tree, and the run
|
|
6
6
|
* publishes what the tree costs in total.
|
|
7
7
|
*/
|
|
8
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
8
9
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Kruskal's minimum spanning tree: the cheapest edges that join the graph, or the run's scope.
|
|
11
12
|
*/
|
|
12
13
|
export declare class KruskalAlgorithm extends DeclaredAlgorithm {
|
|
13
14
|
static namespace: string;
|
|
14
15
|
static type: string;
|
|
16
|
+
/** Spans the run's scope: the edge list and the graph both come from the input. */
|
|
17
|
+
static scopeInput: ScopeInputDeclaration;
|
|
15
18
|
/**
|
|
16
19
|
* Find the cheapest set of edges that still joins every node.
|
|
17
20
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -16,6 +17,8 @@ interface LabelPropagationOptions extends Record<string, unknown> {
|
|
|
16
17
|
export declare class LabelPropagationAlgorithm extends DeclaredAlgorithm<LabelPropagationOptions> {
|
|
17
18
|
static namespace: string;
|
|
18
19
|
static type: string;
|
|
20
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
21
|
+
static scopeInput: ScopeInputDeclaration;
|
|
19
22
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
20
23
|
static optionsSchema: OptionsSchema;
|
|
21
24
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -20,6 +21,8 @@ interface LeidenOptions extends Record<string, unknown> {
|
|
|
20
21
|
export declare class LeidenAlgorithm extends DeclaredAlgorithm<LeidenOptions> {
|
|
21
22
|
static namespace: string;
|
|
22
23
|
static type: string;
|
|
24
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
25
|
+
static scopeInput: ScopeInputDeclaration;
|
|
23
26
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
24
27
|
static optionsSchema: OptionsSchema;
|
|
25
28
|
/**
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { adamicAdarPrediction, commonNeighborsPrediction } from "@graphty/algorithms";
|
|
10
10
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
11
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
11
12
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
12
13
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
13
14
|
/** The two scoring methods, by the name the `method` option takes. */
|
|
@@ -29,10 +30,12 @@ interface LinkPredictionOptions extends Record<string, unknown> {
|
|
|
29
30
|
export declare class LinkPredictionAlgorithm extends DeclaredAlgorithm<LinkPredictionOptions> {
|
|
30
31
|
static namespace: string;
|
|
31
32
|
static type: string;
|
|
33
|
+
static scopeInput: ScopeInputDeclaration;
|
|
32
34
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
33
35
|
static optionsSchema: OptionsSchema;
|
|
34
36
|
/**
|
|
35
|
-
* Score every unconnected pair of nodes and keep the best.
|
|
37
|
+
* Score every unconnected pair of the run's nodes and keep the best. A pair is published as a
|
|
38
|
+
* row of the result and never written into the graph.
|
|
36
39
|
* @param context - What the element gave the run.
|
|
37
40
|
* @returns The scored pairs, best first, or null when the graph has no nodes.
|
|
38
41
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
2
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
2
3
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
3
4
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
4
5
|
/**
|
|
@@ -20,6 +21,8 @@ interface LouvainOptions extends Record<string, unknown> {
|
|
|
20
21
|
export declare class LouvainAlgorithm extends DeclaredAlgorithm<LouvainOptions> {
|
|
21
22
|
static namespace: string;
|
|
22
23
|
static type: string;
|
|
24
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
25
|
+
static scopeInput: ScopeInputDeclaration;
|
|
23
26
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
24
27
|
static optionsSchema: OptionsSchema;
|
|
25
28
|
/**
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* in a flow network using the Ford-Fulkerson method.
|
|
6
6
|
*/
|
|
7
7
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
8
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
8
9
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
9
10
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
10
11
|
/**
|
|
@@ -24,6 +25,8 @@ interface MaxFlowOptions extends Record<string, unknown> {
|
|
|
24
25
|
export declare class MaxFlowAlgorithm extends DeclaredAlgorithm<MaxFlowOptions> {
|
|
25
26
|
static namespace: string;
|
|
26
27
|
static type: string;
|
|
28
|
+
/** Flows within the run's scope: the node and edge lists come from the input. */
|
|
29
|
+
static scopeInput: ScopeInputDeclaration;
|
|
27
30
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
28
31
|
/**
|
|
29
32
|
* Options schema for Max Flow algorithm
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* or the global minimum cut of a graph. Uses the max-flow min-cut theorem.
|
|
6
6
|
*/
|
|
7
7
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
8
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
8
9
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
9
10
|
import { type OptionsSchema } from "./types/OptionSchema";
|
|
10
11
|
/**
|
|
@@ -31,6 +32,8 @@ interface MinCutOptions extends Record<string, unknown> {
|
|
|
31
32
|
export declare class MinCutAlgorithm extends DeclaredAlgorithm<MinCutOptions> {
|
|
32
33
|
static namespace: string;
|
|
33
34
|
static type: string;
|
|
35
|
+
/** Cuts the run's scope: the node and edge lists and the graph all come from the input. */
|
|
36
|
+
static scopeInput: ScopeInputDeclaration;
|
|
34
37
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
35
38
|
/**
|
|
36
39
|
* Options schema for Min Cut algorithm
|
|
@@ -3,6 +3,7 @@ import { z } from "zod/v4";
|
|
|
3
3
|
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
4
4
|
import { type InferOptions } from "../config";
|
|
5
5
|
import type { Graph } from "../Graph";
|
|
6
|
+
import type { ScopeInputDeclaration } from "./input/ScopedInput";
|
|
6
7
|
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
7
8
|
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
8
9
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
@@ -80,6 +81,8 @@ interface PageRankOptions extends PageRankSchemaOptions, Record<string, unknown>
|
|
|
80
81
|
export declare class PageRankAlgorithm extends MetricAlgorithm<PageRankOptions> {
|
|
81
82
|
static namespace: string;
|
|
82
83
|
static type: string;
|
|
84
|
+
/** Ranks over the run's scope: the node list and the graph both come from the input. */
|
|
85
|
+
static scopeInput: ScopeInputDeclaration;
|
|
83
86
|
/**
|
|
84
87
|
* NEW: Zod-based options schema for unified validation and UI metadata
|
|
85
88
|
*
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* from a starting node, which can be optionally configured.
|
|
10
10
|
*/
|
|
11
11
|
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
12
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
12
13
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
13
14
|
import type { OptionsSchema } from "./types/OptionSchema";
|
|
14
15
|
/**
|
|
@@ -27,6 +28,8 @@ interface PrimOptions extends Record<string, unknown> {
|
|
|
27
28
|
export declare class PrimAlgorithm extends DeclaredAlgorithm<PrimOptions> {
|
|
28
29
|
static namespace: string;
|
|
29
30
|
static type: string;
|
|
31
|
+
/** Spans the run's scope: the edge list and the graph both come from the input. */
|
|
32
|
+
static scopeInput: ScopeInputDeclaration;
|
|
30
33
|
static zodOptionsSchema: ZodOptionsSchema;
|
|
31
34
|
static optionsSchema: OptionsSchema;
|
|
32
35
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ScopeInputDeclaration } from "./input/ScopedInput";
|
|
1
2
|
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
@@ -5,6 +6,8 @@ import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } fro
|
|
|
5
6
|
export declare class StronglyConnectedComponentsAlgorithm extends DeclaredAlgorithm {
|
|
6
7
|
static namespace: string;
|
|
7
8
|
static type: string;
|
|
9
|
+
/** Groups over the run's scope: the node list and the graph both come from the input. */
|
|
10
|
+
static scopeInput: ScopeInputDeclaration;
|
|
8
11
|
/**
|
|
9
12
|
* Find the pieces of the graph that a directed path can cross both ways.
|
|
10
13
|
*
|