@graphty/cytoscape-extensions 0.0.0-placeholder.0 → 0.0.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/LICENSE +21 -0
- package/NOTICE +10 -0
- package/README.md +73 -7
- package/package.json +124 -14
- package/src/algorithm-options.ts +277 -0
- package/src/algorithms.ts +1911 -0
- package/src/elements.ts +357 -0
- package/src/gpu-platform-browser.ts +29 -0
- package/src/gpu-platform-node.ts +35 -0
- package/src/gpu.ts +407 -0
- package/src/graph-data.ts +165 -0
- package/src/index.ts +73 -0
- package/src/io.ts +205 -0
- package/src/layouts.ts +886 -0
- package/src/lazy.ts +35 -0
- package/src/samples.ts +273 -0
- package/src/snapshot.ts +281 -0
- package/src/webgpu-provider.ts +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Adam Powers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@graphty/cytoscape-extensions
|
|
2
|
+
Copyright (c) 2024 Adam Powers. The code is under the MIT License (see LICENSE).
|
|
3
|
+
|
|
4
|
+
cy.graphtyDataset() loads sample datasets from the @graphty/graph-samples package (or, for the large
|
|
5
|
+
ones, from https://graphty.app/data/graph-samples/v1/). This package contains none of that data,
|
|
6
|
+
and the datasets are not under its MIT License: each has its own source, citation and license, as
|
|
7
|
+
far as it is known, listed in the NOTICE file of @graphty/graph-samples
|
|
8
|
+
(https://github.com/graphty-org/graphty-monorepo/blob/master/graph-samples/NOTICE) and in that
|
|
9
|
+
package's DATASETS metadata. Several are licensed only "for scientific use" or have no clear
|
|
10
|
+
license; check a dataset's entry before redistributing it.
|
package/README.md
CHANGED
|
@@ -1,9 +1,75 @@
|
|
|
1
|
-
# @graphty/cytoscape-extensions
|
|
1
|
+
# @graphty/cytoscape-extensions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Graph layouts and graph algorithms for [Cytoscape.js](https://js.cytoscape.org/) 3.x, added with one
|
|
4
|
+
`cytoscape.use()` call: 16 layouts registered as `graphty-<name>` (ForceAtlas2, Fruchterman-Reingold, Kamada-Kawai,
|
|
5
|
+
radial, shell and more), 63 algorithm methods on every collection and on the core named `graphty<Name>` (PageRank,
|
|
6
|
+
betweenness, Louvain, Leiden, Dijkstra, max flow, link prediction and more), seeded graph generators, sample
|
|
7
|
+
datasets, and import and export of GraphML, GEXF, GML, DOT, Pajek, CSV, JSON, Neo4j and CX2 files. The force
|
|
8
|
+
simulations and 17 of the algorithms run on WebGPU when the browser or Node has a usable device, with nothing extra
|
|
9
|
+
to import.
|
|
5
10
|
|
|
6
|
-
The package
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
The package is not on npm yet. The names and install commands below are the ones it will be published under.
|
|
12
|
+
|
|
13
|
+
- Documentation: [graphty.app/docs/cytoscape-extensions](https://graphty.app/docs/cytoscape-extensions/)
|
|
14
|
+
- Demo: [every layout and algorithm in a live graph](https://graphty.app/storybook/cytoscape-extensions/)
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install cytoscape @graphty/cytoscape-extensions @graphty/algorithms @graphty/layout @graphty/graph-format
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
@graphty/algorithms, @graphty/layout and @graphty/graph-format are peer dependencies. Cytoscape.js 3.31.0 or later is
|
|
23
|
+
required.
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import cytoscape from "cytoscape";
|
|
29
|
+
import graphtyCytoscape from "@graphty/cytoscape-extensions";
|
|
30
|
+
|
|
31
|
+
cytoscape.use(graphtyCytoscape);
|
|
32
|
+
|
|
33
|
+
const cy = cytoscape({
|
|
34
|
+
container: document.getElementById("cy"),
|
|
35
|
+
style: [{ selector: "node", style: { width: "mapData(rank, 0, 0.035, 8, 48)" } }],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async function draw() {
|
|
39
|
+
await cy.graphtyGenerate("barabasi-albert", { n: 300, m: 2, seed: 1 }); // or cy.add() your own elements
|
|
40
|
+
cy.elements().graphtyPageRank({ field: "rank" }); // writes data("rank"), which the style maps to a width
|
|
41
|
+
cy.layout({ name: "graphty-forceatlas2", animate: true }).run();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
draw();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Loading
|
|
48
|
+
|
|
49
|
+
- With npm and a bundler (Vite, webpack, esbuild, Rollup), import the package as above. It is ES modules only; the
|
|
50
|
+
WebGPU code, the generators, each dataset and the file formats load on first use.
|
|
51
|
+
- With no build step, import the ES module build from a CDN:
|
|
52
|
+
`https://cdn.jsdelivr.net/npm/@graphty/cytoscape-extensions/dist/cdn/cytoscape-extensions.js`.
|
|
53
|
+
- With a classic `<script src>` tag, load `dist/cytoscape-extensions.bundle.js` after Cytoscape. It registers
|
|
54
|
+
itself, so there is no `use()` call.
|
|
55
|
+
|
|
56
|
+
[Installation](https://graphty.app/docs/cytoscape-extensions/guide/installation) covers each of these, CommonJS,
|
|
57
|
+
TypeScript and the supported versions.
|
|
58
|
+
|
|
59
|
+
## Documentation
|
|
60
|
+
|
|
61
|
+
- [Getting started](https://graphty.app/docs/cytoscape-extensions/guide/getting-started)
|
|
62
|
+
- [Layouts](https://graphty.app/docs/cytoscape-extensions/guide/layouts)
|
|
63
|
+
- [Algorithms](https://graphty.app/docs/cytoscape-extensions/guide/algorithms)
|
|
64
|
+
- [WebGPU](https://graphty.app/docs/cytoscape-extensions/guide/webgpu)
|
|
65
|
+
- [Graphs in and out](https://graphty.app/docs/cytoscape-extensions/guide/graphs-in-and-out)
|
|
66
|
+
- [Migrating from Cytoscape's built-ins](https://graphty.app/docs/cytoscape-extensions/guide/migrating-from-cytoscape)
|
|
67
|
+
- [Troubleshooting](https://graphty.app/docs/cytoscape-extensions/guide/troubleshooting)
|
|
68
|
+
- Reference: [layouts](https://graphty.app/docs/cytoscape-extensions/reference/layouts),
|
|
69
|
+
[algorithms](https://graphty.app/docs/cytoscape-extensions/reference/algorithms),
|
|
70
|
+
[generators, datasets and formats](https://graphty.app/docs/cytoscape-extensions/reference/graphs)
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT. The sample datasets are their authors' work under their own licenses, listed in the
|
|
75
|
+
[dataset reference](https://graphty.app/docs/cytoscape-extensions/reference/graphs#datasets).
|
package/package.json
CHANGED
|
@@ -1,16 +1,126 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"name": "@graphty/cytoscape-extensions",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Graphty layouts, algorithms, graph generators, sample datasets and file import/export as Cytoscape.js extensions",
|
|
5
|
+
"author": "Adam Powers <apowers@ato.ms>",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"unpkg": "dist/cytoscape-extensions.bundle.js",
|
|
10
|
+
"jsdelivr": "dist/cytoscape-extensions.bundle.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
11
16
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
+
"./io": {
|
|
18
|
+
"types": "./dist/io.d.ts",
|
|
19
|
+
"import": "./dist/io.js",
|
|
20
|
+
"default": "./dist/io.js"
|
|
21
|
+
},
|
|
22
|
+
"./samples": {
|
|
23
|
+
"types": "./dist/samples.d.ts",
|
|
24
|
+
"import": "./dist/samples.js",
|
|
25
|
+
"default": "./dist/samples.js"
|
|
26
|
+
},
|
|
27
|
+
"./bundle": "./dist/cytoscape-extensions.bundle.js"
|
|
28
|
+
},
|
|
29
|
+
"imports": {
|
|
30
|
+
"#gpu-platform": {
|
|
31
|
+
"types": "./src/gpu-platform-browser.ts",
|
|
32
|
+
"node": "./dist/gpu-platform-node.js",
|
|
33
|
+
"default": "./dist/gpu-platform-browser.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"sideEffects": [
|
|
37
|
+
"./dist/cytoscape-extensions.bundle.js"
|
|
38
|
+
],
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/",
|
|
41
|
+
"!dist/*.tsbuildinfo",
|
|
42
|
+
"src/",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE",
|
|
45
|
+
"NOTICE"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18.19.0"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/graphty-org/graphty-monorepo.git",
|
|
57
|
+
"directory": "cytoscape-extensions"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"graph",
|
|
61
|
+
"layout",
|
|
62
|
+
"cytoscape",
|
|
63
|
+
"cytoscape-extension",
|
|
64
|
+
"forceatlas2",
|
|
65
|
+
"graph-format",
|
|
66
|
+
"webgpu"
|
|
67
|
+
],
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/graphty-org/graphty-monorepo/issues"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/graphty-org/graphty-monorepo/tree/master/cytoscape-extensions#readme",
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@graphty/graph-io": "^0.3.28",
|
|
75
|
+
"@graphty/graph-samples": "^0.1.23",
|
|
76
|
+
"@graphty/webgpu-graph-algorithms": "^0.6.37"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@graphty/algorithms": "^3.0.0",
|
|
80
|
+
"@graphty/graph-format": "^1.0.0",
|
|
81
|
+
"@graphty/layout": "^2.0.0",
|
|
82
|
+
"cytoscape": "^3.31.0",
|
|
83
|
+
"webgpu": ">=0.4.0 <1.0.0"
|
|
84
|
+
},
|
|
85
|
+
"peerDependenciesMeta": {
|
|
86
|
+
"webgpu": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@storybook/addon-docs": "^9.0.11",
|
|
92
|
+
"@storybook/html-vite": "^9.0.11",
|
|
93
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
94
|
+
"@vitest/ui": "4.1.11",
|
|
95
|
+
"cytoscape": "^3.34.3",
|
|
96
|
+
"eslint": "^9.29.0",
|
|
97
|
+
"prettier": "^3.4.2",
|
|
98
|
+
"storybook": "^9.0.11",
|
|
99
|
+
"typedoc": "^0.28.15",
|
|
100
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
101
|
+
"typedoc-vitepress-theme": "^1.1.2",
|
|
102
|
+
"typescript": "^5.9.3",
|
|
103
|
+
"vite": "^7.0.5",
|
|
104
|
+
"vitest": "4.1.11",
|
|
105
|
+
"@graphty/algorithms": "^3.3.8",
|
|
106
|
+
"@graphty/graph-format": "^1.3.8",
|
|
107
|
+
"@graphty/layout": "^2.2.9"
|
|
108
|
+
},
|
|
109
|
+
"scripts": {
|
|
110
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && vite build --config vite.bundle.config.ts --mode cdn --logLevel warn && vite build --config vite.bundle.config.ts --logLevel warn",
|
|
111
|
+
"lint": "eslint && tsc --noEmit -p tsconfig.json",
|
|
112
|
+
"lint:fix": "eslint --fix",
|
|
113
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
114
|
+
"test": "vitest",
|
|
115
|
+
"test:ui": "vitest --ui",
|
|
116
|
+
"test:run": "vitest run",
|
|
117
|
+
"coverage": "vitest run --coverage",
|
|
118
|
+
"coverage:preview": "npx serve coverage -p ${PORT:?start it through servherd, which sets PORT}",
|
|
119
|
+
"storybook": "storybook dev -p ${PORT:?start it through servherd, which sets PORT} --host ${HOST:-localhost} ${HTTPS_CERT_PATH:+--https --ssl-cert $HTTPS_CERT_PATH --ssl-key $HTTPS_KEY_PATH} --no-open",
|
|
120
|
+
"build-storybook": "storybook build",
|
|
121
|
+
"ready:commit": "npm run build && npm run lint && npm run test:run",
|
|
122
|
+
"docs:reference": "UPDATE_REFERENCE=1 vitest run test/reference.test.ts",
|
|
123
|
+
"docs:api": "typedoc && node ../tools/sanitize-api-docs.js docs/api/generated",
|
|
124
|
+
"size": "node scripts/size.mjs"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// THIS FILE IS AUTO GENERATED: DO NOT EDIT THIS FILE. INSTEAD EDIT scripts/reference.ts (npm run docs:reference
|
|
2
|
+
// regenerates it from the algorithm option types in src/algorithms.ts and the generator types in src/samples.ts).
|
|
3
|
+
|
|
4
|
+
/** The options each algorithm method takes, by method name; any other option is refused. */
|
|
5
|
+
export const OPTION_NAMES: Readonly<Record<string, readonly string[]>> = {
|
|
6
|
+
graphtyAStar: ["directed", "goal", "gpu", "heuristic", "root", "weight"],
|
|
7
|
+
graphtyAdamicAdarForPairs: ["directed", "gpu", "pairs"],
|
|
8
|
+
graphtyAdamicAdarPrediction: ["directed", "gpu", "includeExisting", "topK"],
|
|
9
|
+
graphtyAdamicAdarScore: ["directed", "gpu", "source", "target"],
|
|
10
|
+
graphtyAllPairsShortestPath: ["directed", "gpu", "maxNodes", "method", "paths", "weight"],
|
|
11
|
+
graphtyBellmanFord: ["cutoff", "directed", "field", "gpu", "root", "weight"],
|
|
12
|
+
graphtyBetweennessCentrality: ["directed", "endpoints", "field", "gpu", "k", "normalized", "sources"],
|
|
13
|
+
graphtyBidirectionalDijkstra: ["directed", "goal", "gpu", "root", "weight"],
|
|
14
|
+
graphtyBreadthFirstSearch: ["directed", "field", "goal", "gpu", "maxDepth", "root"],
|
|
15
|
+
graphtyClosenessCentrality: [
|
|
16
|
+
"cutoff",
|
|
17
|
+
"directed",
|
|
18
|
+
"field",
|
|
19
|
+
"gpu",
|
|
20
|
+
"harmonic",
|
|
21
|
+
"k",
|
|
22
|
+
"normalized",
|
|
23
|
+
"sources",
|
|
24
|
+
"weight",
|
|
25
|
+
],
|
|
26
|
+
graphtyCommonNeighborsForPairs: ["directed", "gpu", "pairs"],
|
|
27
|
+
graphtyCommonNeighborsPrediction: ["directed", "gpu", "includeExisting", "topK"],
|
|
28
|
+
graphtyCommonNeighborsScore: ["directed", "gpu", "source", "target"],
|
|
29
|
+
graphtyCompareAdamicAdarWithCommonNeighbors: ["directed", "edges", "gpu", "nonEdges"],
|
|
30
|
+
graphtyCondensation: ["directed", "field", "gpu"],
|
|
31
|
+
graphtyConnectedComponents: ["directed", "field", "gpu"],
|
|
32
|
+
graphtyDegreeCentrality: ["directed", "field", "gpu", "mode", "normalized"],
|
|
33
|
+
graphtyDegrees: ["directed", "gpu"],
|
|
34
|
+
graphtyDeltaPageRank: [
|
|
35
|
+
"dampingFactor",
|
|
36
|
+
"deltaThreshold",
|
|
37
|
+
"directed",
|
|
38
|
+
"field",
|
|
39
|
+
"gpu",
|
|
40
|
+
"maxIterations",
|
|
41
|
+
"personalization",
|
|
42
|
+
"priority",
|
|
43
|
+
"tolerance",
|
|
44
|
+
"weight",
|
|
45
|
+
],
|
|
46
|
+
graphtyDepthFirstSearch: ["directed", "field", "goal", "gpu", "order", "root"],
|
|
47
|
+
graphtyDijkstra: ["cutoff", "directed", "field", "gpu", "root", "weight"],
|
|
48
|
+
graphtyDirectionOptimizedBfs: ["alpha", "beta", "directed", "field", "gpu", "root"],
|
|
49
|
+
graphtyEdgeBetweennessCentrality: ["directed", "field", "gpu", "k", "normalized", "sources"],
|
|
50
|
+
graphtyEigenvectorCentrality: [
|
|
51
|
+
"directed",
|
|
52
|
+
"field",
|
|
53
|
+
"gpu",
|
|
54
|
+
"maxIterations",
|
|
55
|
+
"mode",
|
|
56
|
+
"normalized",
|
|
57
|
+
"startVector",
|
|
58
|
+
"tolerance",
|
|
59
|
+
],
|
|
60
|
+
graphtyEvaluateAdamicAdar: ["directed", "edges", "gpu", "nonEdges"],
|
|
61
|
+
graphtyEvaluateCommonNeighbors: ["directed", "edges", "gpu", "nonEdges"],
|
|
62
|
+
graphtyFindAllIsomorphisms: ["directed", "edgeMatch", "gpu", "nodeMatch", "other"],
|
|
63
|
+
graphtyGirvanNewman: ["directed", "field", "gpu", "maxCommunities", "maxIterations", "minCommunitySize", "weight"],
|
|
64
|
+
graphtyGreedyBipartiteMatching: ["arcs", "directed", "gpu", "left", "right"],
|
|
65
|
+
graphtyGrsbm: [
|
|
66
|
+
"directed",
|
|
67
|
+
"field",
|
|
68
|
+
"gpu",
|
|
69
|
+
"maxDepth",
|
|
70
|
+
"maxIterations",
|
|
71
|
+
"minClusterSize",
|
|
72
|
+
"seed",
|
|
73
|
+
"tolerance",
|
|
74
|
+
"weight",
|
|
75
|
+
],
|
|
76
|
+
graphtyHasCycle: ["directed", "gpu"],
|
|
77
|
+
graphtyHierarchicalClustering: ["directed", "gpu", "linkage"],
|
|
78
|
+
graphtyHits: ["directed", "field", "gpu", "maxIterations", "normalized", "tolerance", "weight"],
|
|
79
|
+
graphtyIsBipartite: ["arcs", "directed", "field", "gpu"],
|
|
80
|
+
graphtyIsGraphIsomorphic: ["directed", "edgeMatch", "gpu", "nodeMatch", "other"],
|
|
81
|
+
graphtyKCoreDecomposition: ["directed", "field", "gpu"],
|
|
82
|
+
graphtyKargerMinCut: ["directed", "field", "gpu", "iterations", "randomSeed", "weight"],
|
|
83
|
+
graphtyKatzCentrality: [
|
|
84
|
+
"alpha",
|
|
85
|
+
"beta",
|
|
86
|
+
"directed",
|
|
87
|
+
"field",
|
|
88
|
+
"gpu",
|
|
89
|
+
"maxIterations",
|
|
90
|
+
"normalized",
|
|
91
|
+
"tolerance",
|
|
92
|
+
"weight",
|
|
93
|
+
],
|
|
94
|
+
graphtyKruskalMST: ["directed", "gpu", "weight"],
|
|
95
|
+
graphtyLabelPropagation: ["directed", "field", "gpu", "maxIterations", "randomSeed", "weight"],
|
|
96
|
+
graphtyLabelPropagationSemiSupervised: [
|
|
97
|
+
"directed",
|
|
98
|
+
"field",
|
|
99
|
+
"gpu",
|
|
100
|
+
"maxIterations",
|
|
101
|
+
"randomSeed",
|
|
102
|
+
"seeds",
|
|
103
|
+
"weight",
|
|
104
|
+
],
|
|
105
|
+
graphtyLabelPropagationSynchronous: ["directed", "field", "gpu", "maxIterations", "weight"],
|
|
106
|
+
graphtyLeiden: ["directed", "field", "gpu", "maxIterations", "randomSeed", "resolution", "threshold", "weight"],
|
|
107
|
+
graphtyLouvain: ["directed", "field", "gpu", "maxIterations", "resolution", "tolerance", "weight"],
|
|
108
|
+
graphtyMarkovClustering: [
|
|
109
|
+
"directed",
|
|
110
|
+
"expansion",
|
|
111
|
+
"field",
|
|
112
|
+
"gpu",
|
|
113
|
+
"inflation",
|
|
114
|
+
"maxIterations",
|
|
115
|
+
"pruningThreshold",
|
|
116
|
+
"selfLoops",
|
|
117
|
+
"tolerance",
|
|
118
|
+
"weight",
|
|
119
|
+
],
|
|
120
|
+
graphtyMaxFlow: ["algorithm", "directed", "field", "gpu", "sink", "source", "weight"],
|
|
121
|
+
graphtyMaximumBipartiteMatching: ["arcs", "directed", "gpu", "left", "right"],
|
|
122
|
+
graphtyMinSTCut: ["algorithm", "directed", "field", "gpu", "sink", "source", "weight"],
|
|
123
|
+
graphtyModularity: ["clusters", "directed", "gpu", "resolution", "weight"],
|
|
124
|
+
graphtyNodeClosenessCentrality: ["cutoff", "directed", "gpu", "harmonic", "normalized", "root", "weight"],
|
|
125
|
+
graphtyPageRank: [
|
|
126
|
+
"convergenceNorm",
|
|
127
|
+
"dampingFactor",
|
|
128
|
+
"directed",
|
|
129
|
+
"field",
|
|
130
|
+
"gpu",
|
|
131
|
+
"initialRanks",
|
|
132
|
+
"maxIterations",
|
|
133
|
+
"tolerance",
|
|
134
|
+
"weight",
|
|
135
|
+
],
|
|
136
|
+
graphtyPersonalizedPageRank: [
|
|
137
|
+
"convergenceNorm",
|
|
138
|
+
"dampingFactor",
|
|
139
|
+
"directed",
|
|
140
|
+
"field",
|
|
141
|
+
"gpu",
|
|
142
|
+
"initialRanks",
|
|
143
|
+
"maxIterations",
|
|
144
|
+
"personalization",
|
|
145
|
+
"tolerance",
|
|
146
|
+
"weight",
|
|
147
|
+
],
|
|
148
|
+
graphtyPrimMST: ["directed", "forest", "gpu", "root", "weight"],
|
|
149
|
+
graphtySpectralClustering: [
|
|
150
|
+
"directed",
|
|
151
|
+
"field",
|
|
152
|
+
"gpu",
|
|
153
|
+
"k",
|
|
154
|
+
"laplacianType",
|
|
155
|
+
"maxIterations",
|
|
156
|
+
"seed",
|
|
157
|
+
"tolerance",
|
|
158
|
+
"weight",
|
|
159
|
+
],
|
|
160
|
+
graphtyStoerWagner: ["directed", "field", "gpu", "weight"],
|
|
161
|
+
graphtyStronglyConnectedComponents: ["directed", "field", "gpu"],
|
|
162
|
+
graphtySyncClustering: [
|
|
163
|
+
"directed",
|
|
164
|
+
"field",
|
|
165
|
+
"gpu",
|
|
166
|
+
"lambda",
|
|
167
|
+
"learningRate",
|
|
168
|
+
"maxIterations",
|
|
169
|
+
"numClusters",
|
|
170
|
+
"seed",
|
|
171
|
+
"tolerance",
|
|
172
|
+
],
|
|
173
|
+
graphtyTeraHAC: ["directed", "distanceThreshold", "field", "gpu", "linkage", "numClusters", "useGraphDistance"],
|
|
174
|
+
graphtyTopAdamicAdarCandidatesForNode: ["candidates", "directed", "gpu", "includeExisting", "root", "topK"],
|
|
175
|
+
graphtyTopCandidatesForNode: ["candidates", "directed", "gpu", "includeExisting", "root", "topK"],
|
|
176
|
+
graphtyTopologicalSort: ["directed", "gpu"],
|
|
177
|
+
graphtyTriangleCount: ["directed", "field", "gpu"],
|
|
178
|
+
graphtyWeaklyConnectedComponents: ["directed", "field", "gpu"],
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/** The options each generator takes, by generator name; any other option is refused. */
|
|
182
|
+
export const GENERATOR_OPTION_NAMES: Readonly<Record<string, readonly string[]>> = {
|
|
183
|
+
ak: ["k"],
|
|
184
|
+
"balanced-tree": ["branching", "height", "seed", "weights"],
|
|
185
|
+
"barabasi-albert": ["m", "n", "seed", "triadProbability", "weights"],
|
|
186
|
+
barbell: ["cliqueSize", "pathLength", "seed", "weights"],
|
|
187
|
+
"bianconi-barabasi": ["fitness", "m", "n", "seed", "weights"],
|
|
188
|
+
"bipartite-configuration-model": ["leftDegrees", "multiEdges", "rightDegrees", "seed", "weights"],
|
|
189
|
+
caveman: ["cliques", "seed", "size", "weights"],
|
|
190
|
+
"chung-lu": ["expectedDegrees", "seed", "weights"],
|
|
191
|
+
"circular-ladder": ["n", "seed", "weights"],
|
|
192
|
+
complete: ["n", "seed", "weights"],
|
|
193
|
+
"complete-bipartite": ["a", "b", "seed", "weights"],
|
|
194
|
+
"complete-multipartite": ["seed", "sizes", "weights"],
|
|
195
|
+
"configuration-model": ["degrees", "multiEdges", "seed", "selfLoops", "weights"],
|
|
196
|
+
"connected-caveman": ["cliques", "seed", "size", "weights"],
|
|
197
|
+
cycle: ["n", "seed", "weights"],
|
|
198
|
+
"degree-corrected-sbm": ["expectedDegrees", "mixing", "seed", "sizes", "weights"],
|
|
199
|
+
"directed-configuration-model": ["inDegrees", "multiEdges", "outDegrees", "seed", "selfLoops", "weights"],
|
|
200
|
+
"duplication-divergence": ["n", "retention", "seed", "weights"],
|
|
201
|
+
empty: ["n", "seed", "weights"],
|
|
202
|
+
"erdos-renyi": ["directed", "n", "p", "seed", "weights"],
|
|
203
|
+
"erdos-renyi-gnm": ["m", "n", "seed", "weights"],
|
|
204
|
+
"forest-fire": ["backward", "forward", "maxBurn", "n", "seed", "weights"],
|
|
205
|
+
genrmf: ["a", "b", "c1", "c2", "seed"],
|
|
206
|
+
grid: ["cols", "diagonals", "directed", "obstacles", "periodic", "positions", "rows", "seed", "weights"],
|
|
207
|
+
"grid-3d": [
|
|
208
|
+
"cols",
|
|
209
|
+
"diagonals",
|
|
210
|
+
"directed",
|
|
211
|
+
"layers",
|
|
212
|
+
"obstacles",
|
|
213
|
+
"periodic",
|
|
214
|
+
"positions",
|
|
215
|
+
"rows",
|
|
216
|
+
"seed",
|
|
217
|
+
"weights",
|
|
218
|
+
],
|
|
219
|
+
"grid-flow-network": ["cols", "maxCapacity", "minCapacity", "rows", "seed"],
|
|
220
|
+
"hexagonal-lattice": ["cols", "positions", "rows", "seed", "weights"],
|
|
221
|
+
hyperbolic: ["averageDegree", "exponent", "n", "seed", "temperature", "weights"],
|
|
222
|
+
hypercube: ["dimension", "seed", "weights"],
|
|
223
|
+
knn: ["clusters", "dimension", "directed", "k", "n", "seed", "spread", "weights"],
|
|
224
|
+
kronecker: ["directed", "edges", "initiator", "multiEdges", "permute", "power", "seed", "selfLoops", "weights"],
|
|
225
|
+
ladder: ["n", "seed", "weights"],
|
|
226
|
+
"layered-flow-network": ["layers", "maxCapacity", "minCapacity", "p", "seed"],
|
|
227
|
+
lfr: [
|
|
228
|
+
"communityExponent",
|
|
229
|
+
"degreeExponent",
|
|
230
|
+
"maxCommunity",
|
|
231
|
+
"maxDegree",
|
|
232
|
+
"minCommunity",
|
|
233
|
+
"minDegree",
|
|
234
|
+
"mixing",
|
|
235
|
+
"n",
|
|
236
|
+
"seed",
|
|
237
|
+
"weights",
|
|
238
|
+
],
|
|
239
|
+
lollipop: ["cliqueSize", "pathLength", "seed", "weights"],
|
|
240
|
+
"mobius-ladder": ["n", "seed", "weights"],
|
|
241
|
+
named: ["name", "seed", "weights"],
|
|
242
|
+
"newman-watts": ["k", "n", "p", "seed", "weights"],
|
|
243
|
+
path: ["n", "seed", "weights"],
|
|
244
|
+
petersen: ["seed", "weights"],
|
|
245
|
+
"planted-partition": ["groupSize", "groups", "pIn", "pOut", "seed", "weights"],
|
|
246
|
+
price: ["attractiveness", "citations", "n", "seed", "weights"],
|
|
247
|
+
"random-apollonian": ["n", "seed", "weights"],
|
|
248
|
+
"random-bipartite": ["n1", "n2", "p", "perfectMatching", "seed", "weights"],
|
|
249
|
+
"random-dag": ["layers", "p", "seed", "weights"],
|
|
250
|
+
"random-geometric": ["dimension", "n", "periodic", "radius", "seed", "weights"],
|
|
251
|
+
"random-order-dag": ["n", "p", "seed", "weights"],
|
|
252
|
+
"random-recursive-tree": ["n", "seed", "weights"],
|
|
253
|
+
"random-regular": ["d", "n", "seed", "weights"],
|
|
254
|
+
"random-tree": ["n", "seed", "weights"],
|
|
255
|
+
"ring-of-cliques": ["cliques", "seed", "size", "weights"],
|
|
256
|
+
rmat: [
|
|
257
|
+
"a",
|
|
258
|
+
"b",
|
|
259
|
+
"c",
|
|
260
|
+
"d",
|
|
261
|
+
"directed",
|
|
262
|
+
"edgeFactor",
|
|
263
|
+
"multiEdges",
|
|
264
|
+
"permute",
|
|
265
|
+
"scale",
|
|
266
|
+
"seed",
|
|
267
|
+
"selfLoops",
|
|
268
|
+
"weights",
|
|
269
|
+
],
|
|
270
|
+
star: ["n", "seed", "weights"],
|
|
271
|
+
"stochastic-block-model": ["probabilities", "seed", "sizes", "weights"],
|
|
272
|
+
"triangular-lattice": ["cols", "positions", "rows", "seed", "weights"],
|
|
273
|
+
"watts-strogatz": ["beta", "k", "n", "seed", "weights"],
|
|
274
|
+
waxman: ["alpha", "beta", "n", "seed", "weights"],
|
|
275
|
+
wheel: ["n", "seed", "weights"],
|
|
276
|
+
"wilson-maze": ["cols", "rows", "seed", "weights"],
|
|
277
|
+
};
|