@kortexya/nodus 0.1.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/LICENSE +37 -0
- package/README.md +60 -0
- package/__vite-plugin-wasm-helper-1Aiokjk5.js +24 -0
- package/assets/hypergraphWorker-DV0aFI3L.js +1 -0
- package/assets/layoutWorker-DwDJwbgr.js +285 -0
- package/assets/nodus_wasm-C0vDfO5K.js +1 -0
- package/chunk-DmhlhrBa.js +11 -0
- package/nodus.src.bundle.js +33577 -0
- package/nodus_render_wasm-Bs6hlsx-.js +2617 -0
- package/nodus_wasm-DKYQVSUZ.js +2789 -0
- package/package.json +61 -0
- package/types/Nodus.d.ts +100 -0
- package/types/algorithms/concentric/index.d.ts +29 -0
- package/types/algorithms/concentricFactory.d.ts +43 -0
- package/types/algorithms/force/Alea.d.ts +13 -0
- package/types/algorithms/force/BVH.d.ts +35 -0
- package/types/algorithms/force/LayoutData.d.ts +40 -0
- package/types/algorithms/force/Packing.d.ts +31 -0
- package/types/algorithms/force/Physics.d.ts +61 -0
- package/types/algorithms/force/SEC.d.ts +14 -0
- package/types/algorithms/force/Topology.d.ts +3 -0
- package/types/algorithms/force/index.d.ts +54 -0
- package/types/algorithms/force-gpu/ParticleSystem.d.ts +45 -0
- package/types/algorithms/force-gpu/Settings.d.ts +60 -0
- package/types/algorithms/force-gpu/Simulation.d.ts +7 -0
- package/types/algorithms/force-gpu/getGlContext.d.ts +10 -0
- package/types/algorithms/force-gpu/gpuLayout.d.ts +14 -0
- package/types/algorithms/force-gpu/index.d.ts +2 -0
- package/types/algorithms/force-gpu/kernels/index.d.ts +176 -0
- package/types/algorithms/force-gpu/kernels/utils.d.ts +31 -0
- package/types/algorithms/force-gpu/shaders/aabb.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/bhExpand.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/bhTranslate.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/cellLookup.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/index.d.ts +9 -0
- package/types/algorithms/force-gpu/shaders/integrate.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/morton.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/sortIntervals.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/sortKeys.d.ts +2 -0
- package/types/algorithms/force-gpu/shaders/types.d.ts +10 -0
- package/types/algorithms/force-gpu/webgl/helpers.d.ts +24 -0
- package/types/algorithms/force-gpu/webgl/index.d.ts +4 -0
- package/types/algorithms/force-gpu/webgl/program.d.ts +15 -0
- package/types/algorithms/forceFactory.d.ts +55 -0
- package/types/algorithms/forceLinkFactory.d.ts +40 -0
- package/types/algorithms/grid/index.d.ts +26 -0
- package/types/algorithms/gridFactory.d.ts +30 -0
- package/types/algorithms/hierarchical/index.d.ts +80 -0
- package/types/algorithms/hierarchical/sugiyama.d.ts +144 -0
- package/types/algorithms/hierarchicalFactory.d.ts +49 -0
- package/types/algorithms/index.d.ts +13 -0
- package/types/algorithms/radial/index.d.ts +33 -0
- package/types/algorithms/radialFactory.d.ts +54 -0
- package/types/algorithms/sequential/index.d.ts +37 -0
- package/types/algorithms/sequentialFactory.d.ts +37 -0
- package/types/core/Edge.d.ts +67 -0
- package/types/core/EdgeList.d.ts +86 -0
- package/types/core/Node.d.ts +89 -0
- package/types/core/NodeList.d.ts +105 -0
- package/types/core/Transformation.d.ts +108 -0
- package/types/core/enums.d.ts +16 -0
- package/types/geometry/BoundingBox.d.ts +41 -0
- package/types/geometry/index.d.ts +276 -0
- package/types/geometry/types.d.ts +27 -0
- package/types/hypergraph/Hypergraph.d.ts +74 -0
- package/types/hypergraph/KoenigGraph.d.ts +29 -0
- package/types/hypergraph/Simplifier.d.ts +39 -0
- package/types/hypergraph/Statistics.d.ts +55 -0
- package/types/hypergraph/forbidden/StrangledHyperedge.d.ts +12 -0
- package/types/hypergraph/forbidden/StrangledVertex.d.ts +16 -0
- package/types/hypergraph/forbidden/ThreeAdjacentCluster2.d.ts +10 -0
- package/types/hypergraph/forbidden/TwoAdjacentCluster3.d.ts +14 -0
- package/types/hypergraph/forbidden/index.d.ts +22 -0
- package/types/hypergraph/index.d.ts +21 -0
- package/types/hypergraph/layout/Adam.d.ts +12 -0
- package/types/hypergraph/layout/Energy.d.ts +55 -0
- package/types/hypergraph/layout/LBFGS.d.ts +32 -0
- package/types/hypergraph/layout/Optimizer.d.ts +60 -0
- package/types/hypergraph/layout/Reverser.d.ts +42 -0
- package/types/hypergraph/operations/AtomicOperation.d.ts +54 -0
- package/types/hypergraph/operations/HyperedgeMerger.d.ts +30 -0
- package/types/hypergraph/operations/HyperedgeRemoval.d.ts +27 -0
- package/types/hypergraph/operations/VertexMerger.d.ts +32 -0
- package/types/hypergraph/operations/VertexRemoval.d.ts +30 -0
- package/types/hypergraph/operations/index.d.ts +19 -0
- package/types/hypergraph/osfkb/adapter.d.ts +315 -0
- package/types/hypergraph/render/Interaction.d.ts +40 -0
- package/types/hypergraph/render/PolygonRenderer.d.ts +50 -0
- package/types/hypergraph/render/SVGPolygonRenderer.d.ts +7 -0
- package/types/hypergraph/types.d.ts +170 -0
- package/types/index.d.ts +21 -0
- package/types/internals/Algorithms.d.ts +68 -0
- package/types/internals/AlgorithmsPrimitives.d.ts +18 -0
- package/types/internals/Animations.d.ts +39 -0
- package/types/internals/AttributePathPrimitives.d.ts +2 -0
- package/types/internals/Brand.d.ts +22 -0
- package/types/internals/Camera.d.ts +115 -0
- package/types/internals/CameraInteractions.d.ts +15 -0
- package/types/internals/CameraInteractionsPrimitives.d.ts +18 -0
- package/types/internals/Captor.d.ts +56 -0
- package/types/internals/CaptorPrimitives.d.ts +9 -0
- package/types/internals/ClassModule.d.ts +42 -0
- package/types/internals/ConnectNodes.d.ts +23 -0
- package/types/internals/CurvatureManager.d.ts +14 -0
- package/types/internals/DataModule.d.ts +29 -0
- package/types/internals/Disabled.d.ts +27 -0
- package/types/internals/DomModule.d.ts +87 -0
- package/types/internals/DragModule.d.ts +14 -0
- package/types/internals/ElementSet.d.ts +17 -0
- package/types/internals/EventsModule.d.ts +41 -0
- package/types/internals/FlexArray.d.ts +54 -0
- package/types/internals/Geo.d.ts +127 -0
- package/types/internals/Graph.d.ts +109 -0
- package/types/internals/Graphics.d.ts +112 -0
- package/types/internals/GraphicsEngine.d.ts +96 -0
- package/types/internals/Hover.d.ts +32 -0
- package/types/internals/Hypergraph.d.ts +112 -0
- package/types/internals/IndexList.d.ts +28 -0
- package/types/internals/IndividualAttributes.d.ts +27 -0
- package/types/internals/Interactions.d.ts +45 -0
- package/types/internals/Keyboard.d.ts +25 -0
- package/types/internals/LabelManager.d.ts +56 -0
- package/types/internals/Lasso.d.ts +22 -0
- package/types/internals/Layers.d.ts +79 -0
- package/types/internals/LayersPrimitives.d.ts +5 -0
- package/types/internals/Layouts.d.ts +35 -0
- package/types/internals/LayoutsInternal.d.ts +37 -0
- package/types/internals/LayoutsPrimitives.d.ts +23 -0
- package/types/internals/Legend.d.ts +33 -0
- package/types/internals/LegendPrimitives.d.ts +3 -0
- package/types/internals/Locate.d.ts +43 -0
- package/types/internals/LocatePrimitives.d.ts +20 -0
- package/types/internals/MappingManager.d.ts +27 -0
- package/types/internals/MappingPrimitives.d.ts +29 -0
- package/types/internals/Module.d.ts +23 -0
- package/types/internals/Mouse.d.ts +42 -0
- package/types/internals/NodusModules.d.ts +99 -0
- package/types/internals/PositionModule.d.ts +10 -0
- package/types/internals/PulseModule.d.ts +29 -0
- package/types/internals/Quadtree.d.ts +100 -0
- package/types/internals/RectangleSelect.d.ts +18 -0
- package/types/internals/Resizing.d.ts +48 -0
- package/types/internals/Rewiring.d.ts +64 -0
- package/types/internals/SchemaWatchPrimitives.d.ts +75 -0
- package/types/internals/Selection.d.ts +52 -0
- package/types/internals/SelectionModule.d.ts +27 -0
- package/types/internals/Settings.d.ts +20 -0
- package/types/internals/Snapping.d.ts +54 -0
- package/types/internals/Spatial.d.ts +50 -0
- package/types/internals/SpatialPrimitives.d.ts +75 -0
- package/types/internals/Storage.d.ts +46 -0
- package/types/internals/StyleRulesModule.d.ts +21 -0
- package/types/internals/Synchronizer.d.ts +17 -0
- package/types/internals/Tooltip.d.ts +25 -0
- package/types/internals/TooltipPrimitives.d.ts +21 -0
- package/types/internals/Topology.d.ts +50 -0
- package/types/internals/Touch.d.ts +16 -0
- package/types/internals/Transformations.d.ts +36 -0
- package/types/internals/VirtualMouse.d.ts +52 -0
- package/types/internals/WasmHGrid.d.ts +25 -0
- package/types/internals/WatcherModule.d.ts +25 -0
- package/types/internals/Workers.d.ts +79 -0
- package/types/internals/algorithmExports.d.ts +333 -0
- package/types/internals/algorithmHelpers.d.ts +36 -0
- package/types/internals/attributes/AttributesManager.d.ts +216 -0
- package/types/internals/attributes/ElementAttributesManager.d.ts +119 -0
- package/types/internals/attributes/attributeHelpers.d.ts +70 -0
- package/types/internals/attributes/flexArrayFactories.d.ts +277 -0
- package/types/internals/easing.d.ts +15 -0
- package/types/internals/helpers.d.ts +79 -0
- package/types/internals/hypergraphWorker.d.ts +37 -0
- package/types/internals/hypergraphWorkerHost.d.ts +40 -0
- package/types/internals/labels/SpatialGrid.d.ts +29 -0
- package/types/internals/labels/fillEdgeTexts.d.ts +25 -0
- package/types/internals/labels/fillNodeTexts.d.ts +24 -0
- package/types/internals/labels/helpers.d.ts +180 -0
- package/types/internals/layoutWorker.d.ts +21 -0
- package/types/internals/rendering/BoundariesManager.d.ts +53 -0
- package/types/internals/rendering/Buffer2.d.ts +91 -0
- package/types/internals/rendering/BufferList.d.ts +86 -0
- package/types/internals/rendering/CpuRenderer.d.ts +128 -0
- package/types/internals/rendering/EasingManager.d.ts +40 -0
- package/types/internals/rendering/EdgeDrawer.d.ts +54 -0
- package/types/internals/rendering/ElementGroup.d.ts +66 -0
- package/types/internals/rendering/MemoryManager.d.ts +71 -0
- package/types/internals/rendering/NodeDrawer.d.ts +49 -0
- package/types/internals/rendering/PatternManager.d.ts +29 -0
- package/types/internals/rendering/RENDER_MAPPING.d.ts +5 -0
- package/types/internals/rendering/RendererBase.d.ts +127 -0
- package/types/internals/rendering/ShapeManager.d.ts +46 -0
- package/types/internals/rendering/TextManager.d.ts +112 -0
- package/types/internals/rendering/canvasHelpers.d.ts +5 -0
- package/types/internals/rendering/constants.d.ts +125 -0
- package/types/internals/rendering/curveHelpers.d.ts +96 -0
- package/types/internals/rendering/drawerHelpers.d.ts +32 -0
- package/types/internals/rendering/float16.d.ts +25 -0
- package/types/internals/rendering/hitDetection.d.ts +89 -0
- package/types/internals/rendering/loadGraph.d.ts +103 -0
- package/types/internals/rendering/objectInfo.d.ts +46 -0
- package/types/internals/rendering/packing.d.ts +46 -0
- package/types/internals/rendering/shapeHelpers.d.ts +26 -0
- package/types/internals/rendering/types.d.ts +143 -0
- package/types/internals/renderingBinaryPrimitives.d.ts +110 -0
- package/types/internals/utilsExports.d.ts +408 -0
- package/types/internals/wasmBackend.d.ts +38 -0
- package/types/internals/wasmColumns.d.ts +61 -0
- package/types/internals/wasmInit.d.ts +1 -0
- package/types/modules/APIModule.d.ts +8 -0
- package/types/modules/AlgorithmsAPI.d.ts +15 -0
- package/types/modules/BrandAPI.d.ts +6 -0
- package/types/modules/CaptorAPI.d.ts +9 -0
- package/types/modules/ClassesAPI.d.ts +9 -0
- package/types/modules/DebugAPI.d.ts +18 -0
- package/types/modules/DisabledAPI.d.ts +11 -0
- package/types/modules/DomAPI.d.ts +9 -0
- package/types/modules/EventsAPI.d.ts +16 -0
- package/types/modules/ExportAPI.d.ts +23 -0
- package/types/modules/GeneratorsAPI.d.ts +12 -0
- package/types/modules/GeoAPI.d.ts +20 -0
- package/types/modules/GraphAPI.d.ts +26 -0
- package/types/modules/GraphicsAPI.d.ts +8 -0
- package/types/modules/HypergraphAPI.d.ts +71 -0
- package/types/modules/KeyboardAPI.d.ts +6 -0
- package/types/modules/LayersAPI.d.ts +7 -0
- package/types/modules/LayoutsAPI.d.ts +25 -0
- package/types/modules/LegendAPI.d.ts +9 -0
- package/types/modules/MouseAPI.d.ts +16 -0
- package/types/modules/ParseAPI.d.ts +83 -0
- package/types/modules/RulesAPI.d.ts +7 -0
- package/types/modules/SchemaAPI.d.ts +9 -0
- package/types/modules/SelectionAPI.d.ts +12 -0
- package/types/modules/SettingsAPI.d.ts +9 -0
- package/types/modules/StylesAPI.d.ts +64 -0
- package/types/modules/ToolsAPI.d.ts +68 -0
- package/types/modules/TransformationsAPI.d.ts +30 -0
- package/types/modules/ViewAPI.d.ts +52 -0
- package/types/publicTypes.d.ts +56 -0
- package/types/renderers/CanvasRenderer.d.ts +86 -0
- package/types/renderers/Renderer.d.ts +13 -0
- package/types/renderers/SVGRenderer.d.ts +57 -0
- package/types/renderers/WasmGraphRenderer.d.ts +118 -0
- package/types/renderers/WasmRendererAdapter.d.ts +38 -0
- package/types/tools/ConnectNodesAPI.d.ts +42 -0
- package/types/tools/LassoAPI.d.ts +78 -0
- package/types/tools/RectangleSelectAPI.d.ts +51 -0
- package/types/tools/ResizingAPI.d.ts +62 -0
- package/types/tools/RewiringAPI.d.ts +78 -0
- package/types/tools/SnappingAPI.d.ts +71 -0
- package/types/tools/ToolsAPI.d.ts +46 -0
- package/types/tools/TooltipAPI.d.ts +141 -0
- package/types/transformations/TransformationsEngine.d.ts +602 -0
- package/types/utils/index.d.ts +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kortexya/nodus",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Nodus \u2014 a high-performance graph visualization engine (WebGL/WebGPU/Canvas/SVG).",
|
|
5
|
+
"homepage": "https://kortexya.com",
|
|
6
|
+
"author": "Kortexya <david.loiret@kortexya.com>",
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"private": false,
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"module": "nodus.src.bundle.js",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build:wasm": "wasm-pack build crates/nodus-wasm --target bundler --out-dir ../../pkg",
|
|
16
|
+
"build:render-wasm": "wasm-pack build crates/nodus-render-wasm --target bundler --out-dir pkg-render --release",
|
|
17
|
+
"build": "npm run build:wasm && npm run build:render-wasm && npm run clean:dist && vite build --config vite.build.config.ts && npm run build:types",
|
|
18
|
+
"diff:ast-lsp": "node scripts/ast-lsp-diff.mjs",
|
|
19
|
+
"clean:dist": "rm -f nodus.src.bundle.js nodus_wasm-*.js nodus_render_wasm-*.js __vite-plugin-wasm-helper-*.js chunk-*.js && rm -rf assets types",
|
|
20
|
+
"build:types": "tsc -p tsconfig.json --declaration --emitDeclarationOnly --noEmit false --outDir types",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"release": "bash scripts/release.sh"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./types/index.d.ts",
|
|
27
|
+
"import": "./nodus.src.bundle.js",
|
|
28
|
+
"default": "./nodus.src.bundle.js"
|
|
29
|
+
},
|
|
30
|
+
"./esm": "./nodus.src.bundle.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"nodus.src.bundle.js",
|
|
34
|
+
"types",
|
|
35
|
+
"nodus_wasm-*.js",
|
|
36
|
+
"nodus_render_wasm-*.js",
|
|
37
|
+
"/__vite-plugin-wasm-helper-*.js",
|
|
38
|
+
"chunk-*.js",
|
|
39
|
+
"assets",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"@mapbox/mapbox-gl-rtl-text": "^0.2.0",
|
|
44
|
+
"@types/leaflet": ">=1.x",
|
|
45
|
+
"leaflet": ">=1.x",
|
|
46
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.6.0",
|
|
50
|
+
"playwright": "^1.59.1",
|
|
51
|
+
"typescript": "^6.0.3",
|
|
52
|
+
"vite": "^8.0.9",
|
|
53
|
+
"vite-plugin-wasm": "^3.6.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"delaunator": "^5.1.0",
|
|
57
|
+
"fflate": "^0.8.2"
|
|
58
|
+
},
|
|
59
|
+
"sideEffects": true,
|
|
60
|
+
"types": "./types/index.d.ts"
|
|
61
|
+
}
|
package/types/Nodus.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nodus main class — the public entry point for the library.
|
|
3
|
+
*
|
|
4
|
+
* Lifecycle and structure:
|
|
5
|
+
* - The constructor stores the user params and delegates to `_init`.
|
|
6
|
+
* - `_init` builds the internal `NodusModules` container and instantiates
|
|
7
|
+
* every public API module (styles, algorithms, layouts, view, ...).
|
|
8
|
+
* - `safelyBindToInstance()` binds all prototype methods to the instance so
|
|
9
|
+
* they can be passed around as standalone callbacks.
|
|
10
|
+
* - The mixin API modules (ClassesAPI, CaptorAPI, DomAPI, GraphAPI,
|
|
11
|
+
* GraphicsAPI, SelectionAPI, DisabledAPI, SettingsAPI) are merged onto the
|
|
12
|
+
* prototype via `applyMixins` at module load time.
|
|
13
|
+
*/
|
|
14
|
+
import { Node } from './core/Node';
|
|
15
|
+
import { Edge } from './core/Edge';
|
|
16
|
+
import { NodeList } from './core/NodeList';
|
|
17
|
+
import { EdgeList } from './core/EdgeList';
|
|
18
|
+
import { NodusModules } from './internals/NodusModules';
|
|
19
|
+
import { StylesAPI } from './modules/StylesAPI';
|
|
20
|
+
import { AlgorithmsAPI } from './modules/AlgorithmsAPI';
|
|
21
|
+
import { ExportAPI as ExportsAPI } from './modules/ExportAPI';
|
|
22
|
+
import { KeyboardAPI } from './modules/KeyboardAPI';
|
|
23
|
+
import { GeneratorsAPI } from './modules/GeneratorsAPI';
|
|
24
|
+
import { LayoutsAPI } from './modules/LayoutsAPI';
|
|
25
|
+
import { TransformationsAPI } from './modules/TransformationsAPI';
|
|
26
|
+
import { ToolsAPI } from './modules/ToolsAPI';
|
|
27
|
+
import { ViewAPI } from './modules/ViewAPI';
|
|
28
|
+
import { MouseAPI } from './modules/MouseAPI';
|
|
29
|
+
import { EventsAPI } from './modules/EventsAPI';
|
|
30
|
+
import { SchemaAPI } from './modules/SchemaAPI';
|
|
31
|
+
import { RulesAPI } from './modules/RulesAPI';
|
|
32
|
+
import { GeoAPI } from './modules/GeoAPI';
|
|
33
|
+
import { LayersAPI } from './modules/LayersAPI';
|
|
34
|
+
import { HypergraphAPI } from './modules/HypergraphAPI';
|
|
35
|
+
import { DebugAPI } from './modules/DebugAPI';
|
|
36
|
+
import { ClassesAPI } from './modules/ClassesAPI';
|
|
37
|
+
import { CaptorAPI } from './modules/CaptorAPI';
|
|
38
|
+
import { DomAPI } from './modules/DomAPI';
|
|
39
|
+
import { GraphAPI } from './modules/GraphAPI';
|
|
40
|
+
import { GraphicsAPI } from './modules/GraphicsAPI';
|
|
41
|
+
import { SelectionAPI } from './modules/SelectionAPI';
|
|
42
|
+
import { DisabledAPI } from './modules/DisabledAPI';
|
|
43
|
+
import { SettingsAPI } from './modules/SettingsAPI';
|
|
44
|
+
import * as geometry from './geometry/index';
|
|
45
|
+
import * as parse from './modules/ParseAPI';
|
|
46
|
+
export interface Nodus<ND, ED> extends ClassesAPI, CaptorAPI, DomAPI, GraphAPI, GraphicsAPI, SelectionAPI<ND, ED>, DisabledAPI<ND, ED>, SettingsAPI {
|
|
47
|
+
}
|
|
48
|
+
export declare class Nodus<ND = any, ED = any> {
|
|
49
|
+
node: (id: any) => Node<ND, ED>;
|
|
50
|
+
edge: (id: any) => Edge<ED, ND>;
|
|
51
|
+
nodeList: (indexes?: Uint32Array) => NodeList<ND, ED>;
|
|
52
|
+
edgeList: (indexes?: Uint32Array) => EdgeList<ED, ND>;
|
|
53
|
+
_onReady: Array<(nodus: this) => void>;
|
|
54
|
+
build: {
|
|
55
|
+
version: string;
|
|
56
|
+
commit: string;
|
|
57
|
+
buildTime: string;
|
|
58
|
+
};
|
|
59
|
+
modules: NodusModules;
|
|
60
|
+
_initParameters: any;
|
|
61
|
+
_debug: boolean;
|
|
62
|
+
_token: number;
|
|
63
|
+
styles: StylesAPI;
|
|
64
|
+
algorithms: AlgorithmsAPI;
|
|
65
|
+
export: ExportsAPI;
|
|
66
|
+
keyboard: KeyboardAPI;
|
|
67
|
+
generate: GeneratorsAPI;
|
|
68
|
+
layouts: LayoutsAPI;
|
|
69
|
+
transformations: TransformationsAPI;
|
|
70
|
+
tools: ToolsAPI;
|
|
71
|
+
view: ViewAPI;
|
|
72
|
+
mouse: MouseAPI;
|
|
73
|
+
events: EventsAPI;
|
|
74
|
+
schema: SchemaAPI;
|
|
75
|
+
rules: RulesAPI;
|
|
76
|
+
geo: GeoAPI;
|
|
77
|
+
layers: LayersAPI;
|
|
78
|
+
hypergraph: HypergraphAPI;
|
|
79
|
+
debug: DebugAPI;
|
|
80
|
+
static libraries: Record<string, any>;
|
|
81
|
+
static geometry: typeof geometry;
|
|
82
|
+
static parse: typeof parse;
|
|
83
|
+
static build: {
|
|
84
|
+
version: string;
|
|
85
|
+
commit: string;
|
|
86
|
+
buildTime: string;
|
|
87
|
+
};
|
|
88
|
+
static algorithms: any;
|
|
89
|
+
static utils: any;
|
|
90
|
+
constructor(params?: any);
|
|
91
|
+
_init(params: any): void;
|
|
92
|
+
safelyBindToInstance(): void;
|
|
93
|
+
onReady(cb: (nodus: this) => void): void;
|
|
94
|
+
_destroy(): void;
|
|
95
|
+
destroy(): void;
|
|
96
|
+
isDestroyed(): boolean;
|
|
97
|
+
reset(): void;
|
|
98
|
+
isDebug(): boolean;
|
|
99
|
+
}
|
|
100
|
+
export default Nodus;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concentric layout algorithm.
|
|
3
|
+
*
|
|
4
|
+
* Places nodes on concentric circles around a central node.
|
|
5
|
+
* Nodes are sorted by a configurable metric (degree, radius,
|
|
6
|
+
* data property, or random) and distributed ring-by-ring.
|
|
7
|
+
*/
|
|
8
|
+
export interface ConcentricOptions {
|
|
9
|
+
centralNode: number;
|
|
10
|
+
centerX?: number;
|
|
11
|
+
centerY?: number;
|
|
12
|
+
sortBy?: string;
|
|
13
|
+
clockwise?: boolean;
|
|
14
|
+
allowOverlap?: boolean;
|
|
15
|
+
circleHopRatio?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ConcentricInput {
|
|
18
|
+
nodeCount: number;
|
|
19
|
+
sources: number[];
|
|
20
|
+
targets: number[];
|
|
21
|
+
nodeRadii: number[];
|
|
22
|
+
nodeData?: any[];
|
|
23
|
+
nodeDegrees?: number[];
|
|
24
|
+
}
|
|
25
|
+
export interface ConcentricResult {
|
|
26
|
+
x: number[];
|
|
27
|
+
y: number[];
|
|
28
|
+
}
|
|
29
|
+
export declare function concentric(input: ConcentricInput, options: ConcentricOptions): ConcentricResult;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concentric layout factory.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the concentric layout algorithm as a layout descriptor. Nodes are
|
|
5
|
+
* placed on concentric circles based on their shortest-path distance from a
|
|
6
|
+
* central node. The COMPUTE — the (quirky) simplified Dijkstra and the ring
|
|
7
|
+
* placement trig — runs in Rust (wasm `layout_concentric_distances` /
|
|
8
|
+
* `layout_concentric_place`, byte-exact; grid-concentric-parity.mjs holds the
|
|
9
|
+
* frozen TS oracle). Ring building, the per-ring SORTS, and the PLACEMENT
|
|
10
|
+
* TRIG stay TS. The sorts carry V8 comparator semantics; the placement uses
|
|
11
|
+
* the BROWSER'S Math.cos/sin deliberately: Chrome 149 shipped different
|
|
12
|
+
* (correctly-rounded) sin/cos than node-22's V8, so any fixed wasm trig
|
|
13
|
+
* diverges from the live reference by 1 ULP on ~3% of inputs ON SOME browser
|
|
14
|
+
* version — byte parity with dev means floating with the browser's Math, and
|
|
15
|
+
* only the browser's own functions do that. (Discovered when the wasm
|
|
16
|
+
* placement drifted 1 ULP vs dev in Chrome 149 while matching node exactly.)
|
|
17
|
+
* wasm is REQUIRED for the Dijkstra (Phase-5 rule).
|
|
18
|
+
*/
|
|
19
|
+
interface Nodus {
|
|
20
|
+
modules: {
|
|
21
|
+
layouts: {
|
|
22
|
+
register(descriptor: LayoutDescriptor): void;
|
|
23
|
+
start(name: string, opts: any): Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
graph: any;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface LayoutDescriptor {
|
|
29
|
+
name: string;
|
|
30
|
+
configure(opts: any, modules: any): any;
|
|
31
|
+
context(): any;
|
|
32
|
+
update(msg: any, context: any): any;
|
|
33
|
+
isRunning(): boolean;
|
|
34
|
+
onSync(msg: any): any;
|
|
35
|
+
}
|
|
36
|
+
declare const concentricDescriptor: LayoutDescriptor;
|
|
37
|
+
/**
|
|
38
|
+
* Create and register the concentric layout on an Nodus instance.
|
|
39
|
+
*
|
|
40
|
+
* @returns A function `(opts) => Promise<any>` that starts the layout.
|
|
41
|
+
*/
|
|
42
|
+
export default function concentricFactory(nodus: Nodus): (opts: any) => Promise<any>;
|
|
43
|
+
export { concentricDescriptor };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function setSeed(seed: string | number): void;
|
|
2
|
+
export declare function seededRandom(): number;
|
|
3
|
+
export declare function randomize(): number;
|
|
4
|
+
export declare class Alea {
|
|
5
|
+
private c;
|
|
6
|
+
private s0;
|
|
7
|
+
private s1;
|
|
8
|
+
private s2;
|
|
9
|
+
constructor(seed: string | number);
|
|
10
|
+
next(): number;
|
|
11
|
+
nextDouble(): number;
|
|
12
|
+
nextInt32(): number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class Node {
|
|
2
|
+
left: Node | null;
|
|
3
|
+
right: Node | null;
|
|
4
|
+
data: any | null;
|
|
5
|
+
code: number | null;
|
|
6
|
+
cx: number;
|
|
7
|
+
cy: number;
|
|
8
|
+
r: number;
|
|
9
|
+
mass: number;
|
|
10
|
+
constructor(code: number | null, data: any | null, left: Node | null, right: Node | null);
|
|
11
|
+
}
|
|
12
|
+
export declare function buildIterative(elements: any[], ids: Uint32Array, codes: Uint32Array, start: number, end: number): Node;
|
|
13
|
+
export declare function buildIterativeBuckets(elements: any[], ids: Uint32Array, codes: Uint32Array, start: number, end: number, bucketSize: number): Node;
|
|
14
|
+
export declare function hilbert(x: number, y: number): number;
|
|
15
|
+
export declare function morton2(x: number, y: number): number;
|
|
16
|
+
export declare function radixSort(ids: Uint32Array, codes: Uint32Array): void;
|
|
17
|
+
export declare class BVH {
|
|
18
|
+
bucketSize: number;
|
|
19
|
+
private _root;
|
|
20
|
+
private _minX;
|
|
21
|
+
private _minY;
|
|
22
|
+
private _maxX;
|
|
23
|
+
private _maxY;
|
|
24
|
+
private _hw;
|
|
25
|
+
private _hh;
|
|
26
|
+
constructor(elements: any[], options: {
|
|
27
|
+
getX: (e: any) => number;
|
|
28
|
+
getY: (e: any) => number;
|
|
29
|
+
bucketSize?: number;
|
|
30
|
+
sfc?: number;
|
|
31
|
+
});
|
|
32
|
+
get root(): Node | null;
|
|
33
|
+
preOrder(callback: (node: Node) => boolean | void): this;
|
|
34
|
+
postOrder(callback: (node: Node) => void): this;
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare class LayoutData {
|
|
2
|
+
X: Float64Array;
|
|
3
|
+
Y: Float64Array;
|
|
4
|
+
R: Float64Array;
|
|
5
|
+
fx: Float32Array;
|
|
6
|
+
fy: Float32Array;
|
|
7
|
+
vx: Float32Array;
|
|
8
|
+
vy: Float32Array;
|
|
9
|
+
pinned: Uint8Array;
|
|
10
|
+
masses: Float32Array;
|
|
11
|
+
weights: Float32Array;
|
|
12
|
+
lengths: Float32Array;
|
|
13
|
+
sources: Uint32Array;
|
|
14
|
+
targets: Uint32Array;
|
|
15
|
+
degrees: Uint32Array;
|
|
16
|
+
layer: Uint32Array;
|
|
17
|
+
parent: Int32Array;
|
|
18
|
+
cluster: Int32Array;
|
|
19
|
+
component: Uint32Array;
|
|
20
|
+
components: number[][];
|
|
21
|
+
layers: number[][];
|
|
22
|
+
nodeIds: number[];
|
|
23
|
+
edgeIds: number[];
|
|
24
|
+
groups: number[][];
|
|
25
|
+
maxR: Float32Array;
|
|
26
|
+
cellSize: number;
|
|
27
|
+
cells: any[];
|
|
28
|
+
hasGroups: boolean;
|
|
29
|
+
movements: number[];
|
|
30
|
+
surfaces: number[];
|
|
31
|
+
movementsPrev: number[];
|
|
32
|
+
surfacesPrev: number[];
|
|
33
|
+
bucketSize: number;
|
|
34
|
+
constructor(graph: {
|
|
35
|
+
nodes: any[];
|
|
36
|
+
edges: any[];
|
|
37
|
+
}, doTopology: boolean | undefined, groups: any);
|
|
38
|
+
nodeToGroup?: Int32Array;
|
|
39
|
+
updateGroups(): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare function unorderedPair(u: number, v: number): number;
|
|
2
|
+
export declare function orderedPair(u: number, v: number): number;
|
|
3
|
+
export declare function alignSiblings(data: any, minAngle?: number, offset?: number): void;
|
|
4
|
+
export declare function potpack(boxes: any[]): void;
|
|
5
|
+
export declare function boxpack(boxes: any[], margin?: number): void;
|
|
6
|
+
export declare class ComponentBox {
|
|
7
|
+
ids: number[];
|
|
8
|
+
xmin: number;
|
|
9
|
+
ymin: number;
|
|
10
|
+
xmax: number;
|
|
11
|
+
ymax: number;
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
w: number;
|
|
15
|
+
h: number;
|
|
16
|
+
cx: number;
|
|
17
|
+
cy: number;
|
|
18
|
+
radius: number;
|
|
19
|
+
mx: number;
|
|
20
|
+
my: number;
|
|
21
|
+
m: number;
|
|
22
|
+
maxr: number;
|
|
23
|
+
add(id: number, x: number, y: number, r: number): void;
|
|
24
|
+
measure(margin?: number): this;
|
|
25
|
+
}
|
|
26
|
+
export declare function spiralpack(boxes: ComponentBox[], margin: number | undefined, X: number[], Y: number[], R: number[]): void;
|
|
27
|
+
export declare function groupAndMeasure(X: number[], Y: number[], R: number[], components: number[][]): {
|
|
28
|
+
boxes: ComponentBox[];
|
|
29
|
+
biggest: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function postprocessing(nodeIds: number[], data: any, options: any): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BVH } from './BVH';
|
|
2
|
+
interface PhysicsState {
|
|
3
|
+
sources: Uint32Array;
|
|
4
|
+
targets: Uint32Array;
|
|
5
|
+
X: Float64Array | Float32Array | number[];
|
|
6
|
+
Y: Float64Array | Float32Array | number[];
|
|
7
|
+
R: Float64Array | Float32Array | number[];
|
|
8
|
+
fx: Float32Array;
|
|
9
|
+
fy: Float32Array;
|
|
10
|
+
vx: Float32Array;
|
|
11
|
+
vy: Float32Array;
|
|
12
|
+
degrees: Uint32Array;
|
|
13
|
+
masses: Float32Array;
|
|
14
|
+
weights: Float32Array;
|
|
15
|
+
pinned: Uint8Array;
|
|
16
|
+
movements: number[];
|
|
17
|
+
surfaces: number[];
|
|
18
|
+
layers: number[][];
|
|
19
|
+
layer: Uint32Array;
|
|
20
|
+
nodeToGroup?: Int32Array;
|
|
21
|
+
hasGroups: boolean;
|
|
22
|
+
cells: any[];
|
|
23
|
+
cellSize: number;
|
|
24
|
+
}
|
|
25
|
+
interface PhysicsOptions {
|
|
26
|
+
charge: number;
|
|
27
|
+
edgeStrength: number;
|
|
28
|
+
edgeLength: number;
|
|
29
|
+
friction: number;
|
|
30
|
+
elasticity: number;
|
|
31
|
+
margin: number;
|
|
32
|
+
cx?: number;
|
|
33
|
+
cy?: number;
|
|
34
|
+
gravity: number;
|
|
35
|
+
theta: number;
|
|
36
|
+
inertia: number;
|
|
37
|
+
maxDisplacement: number;
|
|
38
|
+
barnesHutOptimization: boolean;
|
|
39
|
+
bucketSize?: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function repulsion(alpha: number, nodeIndexes: number[], data: PhysicsState, options: PhysicsOptions): void;
|
|
42
|
+
export declare function repulsionBH(alpha: number, nodeIndexes: number[], prevBvh: BVH | null, data: PhysicsState, options: PhysicsOptions): BVH;
|
|
43
|
+
export declare function collisionForce(alpha: number, nodeIndexes: number[], bvh: BVH, data: PhysicsState, options: PhysicsOptions): void;
|
|
44
|
+
export declare function center(alpha: number, nodeIndexes: number[], data: PhysicsState, options: PhysicsOptions): void;
|
|
45
|
+
export declare function velocityVerlet(nodeIndexes: number[], inertia: number, data: PhysicsState, options: PhysicsOptions): number;
|
|
46
|
+
export declare function attraction(alpha: number, edgeIndexes: number[], state: {
|
|
47
|
+
sources: Uint32Array;
|
|
48
|
+
targets: Uint32Array;
|
|
49
|
+
X: Float64Array | Float32Array | number[];
|
|
50
|
+
Y: Float64Array | Float32Array | number[];
|
|
51
|
+
R: Float64Array | Float32Array | number[];
|
|
52
|
+
fx: Float32Array;
|
|
53
|
+
fy: Float32Array;
|
|
54
|
+
degrees: Uint32Array;
|
|
55
|
+
masses: Float32Array;
|
|
56
|
+
weights: Float32Array;
|
|
57
|
+
}, options: {
|
|
58
|
+
edgeStrength: number;
|
|
59
|
+
edgeLength: number;
|
|
60
|
+
}): void;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Circle {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
r: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function from1(x: number, y: number, r: number): Circle;
|
|
7
|
+
export declare function from2(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): Circle;
|
|
8
|
+
export declare function from3(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number, x3: number, y3: number, r3: number): Circle;
|
|
9
|
+
export declare function contains(c: Circle, x: number, y: number, r: number): boolean;
|
|
10
|
+
export declare function containsWeak(c: Circle, x: number, y: number, r: number): boolean;
|
|
11
|
+
export declare function containsWeakAll(c: Circle, ids: number[], getX: (i: number) => number, getY: (i: number) => number, getR: (i: number) => number): boolean;
|
|
12
|
+
export declare function enclose(ids: number[], getX: (i: number) => number, getY: (i: number) => number, getR: (i: number) => number): Circle;
|
|
13
|
+
export declare function shuffle<T>(array: T[]): T[];
|
|
14
|
+
export declare function med(ids: number[], getX: (i: number) => number, getY: (i: number) => number, getR: (i: number) => number): Circle;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LayoutData } from './LayoutData';
|
|
2
|
+
export declare enum IntegratorType {
|
|
3
|
+
verlet = 0,
|
|
4
|
+
euler = 1
|
|
5
|
+
}
|
|
6
|
+
export declare class Settings {
|
|
7
|
+
onUpdate: (data: any) => void;
|
|
8
|
+
update: (nodes: any[], X: ArrayLike<number>, Y: ArrayLike<number>) => void;
|
|
9
|
+
onEnd: (iterations: number) => void;
|
|
10
|
+
charge: number;
|
|
11
|
+
maxIterations: number;
|
|
12
|
+
minMovement: number;
|
|
13
|
+
edgeLength: number;
|
|
14
|
+
edgeStrength: number;
|
|
15
|
+
friction: number;
|
|
16
|
+
elasticity: number;
|
|
17
|
+
margin: number;
|
|
18
|
+
cx: number | undefined;
|
|
19
|
+
cy: number | undefined;
|
|
20
|
+
gravity: number;
|
|
21
|
+
theta: number;
|
|
22
|
+
batch: number | undefined;
|
|
23
|
+
inertia: number;
|
|
24
|
+
integrator: IntegratorType;
|
|
25
|
+
multilevel: boolean;
|
|
26
|
+
placement: string;
|
|
27
|
+
placementOffset: number;
|
|
28
|
+
alignSiblings: boolean;
|
|
29
|
+
bucketSize: number | undefined;
|
|
30
|
+
maxDisplacement: number;
|
|
31
|
+
siblingsMinAngle: number;
|
|
32
|
+
siblingsOffset: number;
|
|
33
|
+
steps: number;
|
|
34
|
+
scaling: number;
|
|
35
|
+
defaultRadius: number;
|
|
36
|
+
autoStop: any;
|
|
37
|
+
gpuAcceleration: boolean;
|
|
38
|
+
barnesHutOptimization: boolean;
|
|
39
|
+
constructor(options?: any);
|
|
40
|
+
}
|
|
41
|
+
export declare function force(graph: {
|
|
42
|
+
nodes: any[];
|
|
43
|
+
edges: any[];
|
|
44
|
+
}, options?: any): {
|
|
45
|
+
setOptions(opts: any): /*elided*/ any;
|
|
46
|
+
setGraph(g: {
|
|
47
|
+
nodes: any[];
|
|
48
|
+
edges: any[];
|
|
49
|
+
}): /*elided*/ any;
|
|
50
|
+
start(): /*elided*/ any;
|
|
51
|
+
stop(): /*elided*/ any;
|
|
52
|
+
iterations(): any;
|
|
53
|
+
data(): LayoutData;
|
|
54
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type GpuTexture } from './webgl/helpers';
|
|
2
|
+
export declare function squareTextureSize(n: number, pow2?: boolean): {
|
|
3
|
+
w: number;
|
|
4
|
+
h: number;
|
|
5
|
+
};
|
|
6
|
+
export interface AtlasSlot {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function packRects(rects: AtlasSlot[]): {
|
|
13
|
+
w: number;
|
|
14
|
+
h: number;
|
|
15
|
+
fill: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function slotLocalToGlobal(i: number, totalW: number, slot: AtlasSlot): number;
|
|
18
|
+
export interface SimGraph {
|
|
19
|
+
nodes: any[];
|
|
20
|
+
edges: any[];
|
|
21
|
+
}
|
|
22
|
+
export interface SimItem {
|
|
23
|
+
N: number;
|
|
24
|
+
E: number;
|
|
25
|
+
particlesPositionsSlot: AtlasSlot;
|
|
26
|
+
particlesChargesSlot: AtlasSlot;
|
|
27
|
+
adjacencyOffsetsSlot: AtlasSlot;
|
|
28
|
+
adjacencyListsSlot: AtlasSlot;
|
|
29
|
+
stiffnessSlot: AtlasSlot;
|
|
30
|
+
nodesExtraPropertiesSlot: AtlasSlot;
|
|
31
|
+
}
|
|
32
|
+
export interface SimTextures {
|
|
33
|
+
particlesPositions: () => GpuTexture;
|
|
34
|
+
particlesCharges: () => GpuTexture;
|
|
35
|
+
adjacencyOffsets: () => GpuTexture;
|
|
36
|
+
adjacencyLists: () => GpuTexture;
|
|
37
|
+
stiffness: () => GpuTexture;
|
|
38
|
+
nodesExtraProperties: () => GpuTexture;
|
|
39
|
+
}
|
|
40
|
+
export interface SimLayout {
|
|
41
|
+
items: SimItem[];
|
|
42
|
+
texture: SimTextures;
|
|
43
|
+
}
|
|
44
|
+
export declare function buildSimLayout(gl: WebGL2RenderingContext, graphs: SimGraph[]): SimLayout;
|
|
45
|
+
export declare function destroySimLayout(gl: WebGL2RenderingContext, layout: SimLayout): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare const DEFAULT_AUTOSTOP_SETTINGS: {
|
|
2
|
+
duration: number;
|
|
3
|
+
alpha: number;
|
|
4
|
+
};
|
|
5
|
+
export declare class Settings {
|
|
6
|
+
onUpdate: (e: any) => void;
|
|
7
|
+
update: (_n: any, _x: any, _y: any) => void;
|
|
8
|
+
nextTick: (fn: () => void) => any;
|
|
9
|
+
cancelTick: (h: any) => void;
|
|
10
|
+
onEnd: (status: number) => void;
|
|
11
|
+
charge: number;
|
|
12
|
+
maxIterations: number;
|
|
13
|
+
minMovement: number;
|
|
14
|
+
edgeLength: number;
|
|
15
|
+
edgeStrength: number;
|
|
16
|
+
friction: number;
|
|
17
|
+
elasticity: number;
|
|
18
|
+
margin: number;
|
|
19
|
+
cx: number | undefined;
|
|
20
|
+
cy: number | undefined;
|
|
21
|
+
gravity: number;
|
|
22
|
+
theta: number;
|
|
23
|
+
batch: number | undefined;
|
|
24
|
+
inertia: number;
|
|
25
|
+
integrator: number;
|
|
26
|
+
multilevel: boolean;
|
|
27
|
+
placement: 'none' | 'grid' | 'circle';
|
|
28
|
+
placementOffset: number;
|
|
29
|
+
alignSiblings: boolean;
|
|
30
|
+
bucketSize: number | undefined;
|
|
31
|
+
maxDisplacement: number;
|
|
32
|
+
siblingsMinAngle: number;
|
|
33
|
+
siblingsOffset: number;
|
|
34
|
+
steps: number;
|
|
35
|
+
scaling: number;
|
|
36
|
+
defaultRadius: number;
|
|
37
|
+
autoStop: typeof DEFAULT_AUTOSTOP_SETTINGS | false;
|
|
38
|
+
gpuAcceleration: boolean;
|
|
39
|
+
barnesHutOptimization: boolean;
|
|
40
|
+
order?: number;
|
|
41
|
+
depth?: number;
|
|
42
|
+
sortingMethod?: 'ibr' | 'simple';
|
|
43
|
+
groups?: {
|
|
44
|
+
[groupId: string]: any[];
|
|
45
|
+
};
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
constructor(e?: any);
|
|
48
|
+
}
|
|
49
|
+
export declare const GPU_DEFAULTS: {
|
|
50
|
+
readonly charge: 10;
|
|
51
|
+
readonly edgeStrength: 0.5;
|
|
52
|
+
readonly edgeLength: 30;
|
|
53
|
+
readonly elasticity: 0.9;
|
|
54
|
+
readonly margin: 1;
|
|
55
|
+
readonly gravity: 0.01;
|
|
56
|
+
readonly inertia: 0.9;
|
|
57
|
+
readonly maxDisplacement: 1000;
|
|
58
|
+
readonly steps: 200;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SimLayout } from './ParticleSystem';
|
|
2
|
+
import { type AnimationLoop } from './kernels/utils';
|
|
3
|
+
import type { Settings } from './Settings';
|
|
4
|
+
export interface SimulationHandle extends AnimationLoop {
|
|
5
|
+
destroy: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createSimulation(gl: WebGL2RenderingContext, layout: SimLayout, settings: Settings): SimulationHandle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface GlContextHandle {
|
|
2
|
+
context: WebGL2RenderingContext;
|
|
3
|
+
cleanUp: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createWebGL2Context(opts?: {
|
|
6
|
+
canvas?: HTMLCanvasElement;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
}): WebGL2RenderingContext;
|
|
10
|
+
export declare function getGlContext(_kind: string, _attrs: any, onLost: (err: any) => void): GlContextHandle | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SimGraph } from './ParticleSystem';
|
|
2
|
+
export interface GpuLayoutHandle {
|
|
3
|
+
setOptions: (opts?: any) => GpuLayoutHandle;
|
|
4
|
+
setGraph: (g?: SimGraph) => GpuLayoutHandle;
|
|
5
|
+
start: () => GpuLayoutHandle;
|
|
6
|
+
stop: () => GpuLayoutHandle;
|
|
7
|
+
step: () => GpuLayoutHandle;
|
|
8
|
+
data: (cleanup?: boolean) => {
|
|
9
|
+
X: number[];
|
|
10
|
+
Y: number[];
|
|
11
|
+
};
|
|
12
|
+
iterations: () => number;
|
|
13
|
+
}
|
|
14
|
+
export declare function gpuLayout(graph: SimGraph, gl: WebGL2RenderingContext, opts?: any): GpuLayoutHandle;
|