@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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { type GpuTexture } from '../webgl/helpers';
|
|
2
|
+
import { type AtlasSlot, type SimItem, type SimLayout } from '../ParticleSystem';
|
|
3
|
+
export interface KernelHandle {
|
|
4
|
+
step: (...args: any[]) => void;
|
|
5
|
+
outputs: any;
|
|
6
|
+
destroy: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface AabbInput {
|
|
9
|
+
items: {
|
|
10
|
+
N: number;
|
|
11
|
+
pointsSlot: AtlasSlot;
|
|
12
|
+
}[];
|
|
13
|
+
texture: {
|
|
14
|
+
points: () => GpuTexture;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface AabbOutput {
|
|
18
|
+
items: {
|
|
19
|
+
spatialBoundariesSlot: AtlasSlot;
|
|
20
|
+
}[];
|
|
21
|
+
texture: {
|
|
22
|
+
spatialBoundaries: () => GpuTexture;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function makeAabbKernel(gl: WebGL2RenderingContext, input: AabbInput): KernelHandle & {
|
|
26
|
+
outputs: AabbOutput;
|
|
27
|
+
};
|
|
28
|
+
interface MortonInput {
|
|
29
|
+
items: (SimItem & {
|
|
30
|
+
depth: number;
|
|
31
|
+
N: number;
|
|
32
|
+
})[];
|
|
33
|
+
texture: {
|
|
34
|
+
points: () => GpuTexture;
|
|
35
|
+
spatialBoundaries: () => GpuTexture;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface MortonOutput {
|
|
39
|
+
items: {
|
|
40
|
+
N: number;
|
|
41
|
+
spatialKeysSlot: AtlasSlot;
|
|
42
|
+
}[];
|
|
43
|
+
texture: {
|
|
44
|
+
spatialKeys: () => GpuTexture;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare function makeMortonKernel(gl: WebGL2RenderingContext, input: MortonInput): KernelHandle & {
|
|
48
|
+
outputs: MortonOutput;
|
|
49
|
+
};
|
|
50
|
+
interface SortKeysInput {
|
|
51
|
+
items: {
|
|
52
|
+
N: number;
|
|
53
|
+
spatialKeysSlot: AtlasSlot;
|
|
54
|
+
}[];
|
|
55
|
+
texture: {
|
|
56
|
+
spatialKeys: () => GpuTexture;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface SortOutput {
|
|
60
|
+
items: {
|
|
61
|
+
N: number;
|
|
62
|
+
spatialKeysSlot: AtlasSlot;
|
|
63
|
+
}[];
|
|
64
|
+
texture: {
|
|
65
|
+
spatialKeys: () => GpuTexture;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare function makeSortKeysKernel(gl: WebGL2RenderingContext, input: SortKeysInput): KernelHandle & {
|
|
69
|
+
outputs: SortOutput;
|
|
70
|
+
};
|
|
71
|
+
export declare function makeSortIntervalsKernel(gl: WebGL2RenderingContext, input: SortKeysInput): KernelHandle & {
|
|
72
|
+
outputs: SortOutput;
|
|
73
|
+
};
|
|
74
|
+
interface CellLookupInput {
|
|
75
|
+
items: (SimItem & {
|
|
76
|
+
depth: number;
|
|
77
|
+
order: number;
|
|
78
|
+
N: number;
|
|
79
|
+
spatialKeysSlot: AtlasSlot;
|
|
80
|
+
spatialBoundariesSlot: AtlasSlot;
|
|
81
|
+
})[];
|
|
82
|
+
texture: {
|
|
83
|
+
spatialKeys: () => GpuTexture;
|
|
84
|
+
spatialBoundaries: () => GpuTexture;
|
|
85
|
+
points?: () => GpuTexture;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
interface CellLookupOutput {
|
|
89
|
+
items: (SimItem & {
|
|
90
|
+
depth: number;
|
|
91
|
+
order: number;
|
|
92
|
+
N: number;
|
|
93
|
+
spatialKeysSlot: AtlasSlot;
|
|
94
|
+
spatialBoundariesSlot: AtlasSlot;
|
|
95
|
+
gridCellsSlot: AtlasSlot;
|
|
96
|
+
})[];
|
|
97
|
+
texture: {
|
|
98
|
+
spatialKeys: () => GpuTexture;
|
|
99
|
+
spatialBoundaries: () => GpuTexture;
|
|
100
|
+
gridCells: () => GpuTexture;
|
|
101
|
+
points?: () => GpuTexture;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export declare function makeCellLookupKernel(gl: WebGL2RenderingContext, input: CellLookupInput): KernelHandle & {
|
|
105
|
+
outputs: CellLookupOutput;
|
|
106
|
+
};
|
|
107
|
+
interface BhTranslateInput extends CellLookupOutput {
|
|
108
|
+
}
|
|
109
|
+
interface BhTranslateItem {
|
|
110
|
+
order: number;
|
|
111
|
+
depth: number;
|
|
112
|
+
multipolesSlot: {
|
|
113
|
+
[level: number]: AtlasSlot;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
interface BhTranslateOutput {
|
|
117
|
+
items: BhTranslateItem[];
|
|
118
|
+
texture: {
|
|
119
|
+
multipoles: (level: number, ch: number) => GpuTexture | undefined;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export declare function makeBhTranslateKernel(gl: WebGL2RenderingContext, input: BhTranslateInput & {
|
|
123
|
+
items: (BhTranslateInput['items'][number] & {
|
|
124
|
+
order: number;
|
|
125
|
+
})[];
|
|
126
|
+
}): KernelHandle & {
|
|
127
|
+
outputs: BhTranslateOutput;
|
|
128
|
+
};
|
|
129
|
+
interface BhExpandInput extends BhTranslateOutput {
|
|
130
|
+
items: (BhTranslateItem & SimItem)[];
|
|
131
|
+
}
|
|
132
|
+
interface BhExpandOutput {
|
|
133
|
+
items: (BhTranslateItem & SimItem & {
|
|
134
|
+
localExpansionsSlot: {
|
|
135
|
+
[l: number]: AtlasSlot;
|
|
136
|
+
};
|
|
137
|
+
})[];
|
|
138
|
+
texture: {
|
|
139
|
+
localExpansions: (level: number, ch: number) => GpuTexture | undefined;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export declare function makeBhExpandKernel(gl: WebGL2RenderingContext, input: BhExpandInput): KernelHandle & {
|
|
143
|
+
outputs: BhExpandOutput;
|
|
144
|
+
};
|
|
145
|
+
export interface IntegrateOptions {
|
|
146
|
+
charge: number;
|
|
147
|
+
gravity: number;
|
|
148
|
+
inertia: number;
|
|
149
|
+
edgeStrength: number;
|
|
150
|
+
edgeLength: number;
|
|
151
|
+
elasticity: number;
|
|
152
|
+
margin: number;
|
|
153
|
+
maxDisplacement: number;
|
|
154
|
+
}
|
|
155
|
+
interface IntegrateInput {
|
|
156
|
+
items: any[];
|
|
157
|
+
texture: SimLayout['texture'] & {
|
|
158
|
+
spatialBoundaries: () => GpuTexture;
|
|
159
|
+
spatialKeys: () => GpuTexture;
|
|
160
|
+
gridCells: () => GpuTexture;
|
|
161
|
+
localExpansions: (level: number, ch: number) => GpuTexture | undefined;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
interface IntegrateOutput {
|
|
165
|
+
items: {
|
|
166
|
+
N: number;
|
|
167
|
+
pointsSlot: AtlasSlot;
|
|
168
|
+
}[];
|
|
169
|
+
texture: {
|
|
170
|
+
points: () => GpuTexture;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export declare function makeIntegrateKernel(gl: WebGL2RenderingContext, input: IntegrateInput, opts: IntegrateOptions): KernelHandle & {
|
|
174
|
+
outputs: IntegrateOutput;
|
|
175
|
+
};
|
|
176
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createFramebuffer, type GpuTexture } from '../webgl/helpers';
|
|
2
|
+
export declare const aabbDepth: (n: number) => number;
|
|
3
|
+
export declare const nextPow2: (n: number) => number;
|
|
4
|
+
export declare const logCeil: (n: number) => number;
|
|
5
|
+
export declare function splitPow2(n: number): [number, number];
|
|
6
|
+
export declare const triCount: (n: number) => number;
|
|
7
|
+
export declare const emptySlot: () => {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
w: number;
|
|
11
|
+
h: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function once<T>(start: () => Promise<T>): () => Promise<T>;
|
|
14
|
+
export declare const bhDepth: (n: number) => number;
|
|
15
|
+
export declare const batchSize: (n: number, lo?: number, hi?: number) => number;
|
|
16
|
+
export declare const coolingAlpha: (e: number, t: number) => number;
|
|
17
|
+
export declare function initSortPairs(arr: Uint32Array): Uint32Array;
|
|
18
|
+
export declare function createKeyTexture(gl: WebGL2RenderingContext, [w, h]: [number, number]): GpuTexture;
|
|
19
|
+
export declare function createIntervalTexture(gl: WebGL2RenderingContext, [w, h]: [number, number]): GpuTexture;
|
|
20
|
+
export declare function createFramebuffer2(gl: WebGL2RenderingContext, ca0: GpuTexture, ca1: GpuTexture): {
|
|
21
|
+
handle: WebGLFramebuffer;
|
|
22
|
+
ca0: GpuTexture;
|
|
23
|
+
ca1: GpuTexture;
|
|
24
|
+
};
|
|
25
|
+
export interface AnimationLoop {
|
|
26
|
+
start: () => Promise<void>;
|
|
27
|
+
step: () => boolean | undefined;
|
|
28
|
+
stop: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createAnimationLoop(batch: number, step: (i: number) => boolean): AnimationLoop;
|
|
31
|
+
export { createFramebuffer };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { ShaderPair } from './types';
|
|
2
|
+
export { integrateShader } from './integrate';
|
|
3
|
+
export { bhExpandShader } from './bhExpand';
|
|
4
|
+
export { bhTranslateShader } from './bhTranslate';
|
|
5
|
+
export { cellLookupShader } from './cellLookup';
|
|
6
|
+
export { sortKeysShader } from './sortKeys';
|
|
7
|
+
export { sortIntervalsShader } from './sortIntervals';
|
|
8
|
+
export { mortonShader } from './morton';
|
|
9
|
+
export { aabbShader } from './aabb';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ShaderPair {
|
|
2
|
+
/** vertex shader source — `#version 300 es`, one instance per slot. */
|
|
3
|
+
vert: string;
|
|
4
|
+
/** fragment shader source — performs the per-pixel computation. */
|
|
5
|
+
frag: string;
|
|
6
|
+
/** descriptive name for debugging / pipeline registry. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** number of color attachments the fragment shader writes. */
|
|
9
|
+
outputs: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const QUAD_VERTICES: Float32Array<ArrayBuffer>;
|
|
2
|
+
export declare function uniformSetterName(): {
|
|
3
|
+
readonly [type: number]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function compileShader(gl: WebGL2RenderingContext, type: GLenum, source: string): WebGLShader;
|
|
6
|
+
export declare function createProgram(gl: WebGL2RenderingContext, vsSource: string, fsSource: string): WebGLProgram;
|
|
7
|
+
export interface GpuTexture {
|
|
8
|
+
size: [number, number];
|
|
9
|
+
data: ArrayBufferView | null;
|
|
10
|
+
type: GLenum;
|
|
11
|
+
format: GLenum;
|
|
12
|
+
handle: WebGLTexture;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateTextureOpts {
|
|
15
|
+
size: [number, number];
|
|
16
|
+
data: ArrayBufferView | null;
|
|
17
|
+
type: GLenum;
|
|
18
|
+
internalFormat?: GLenum;
|
|
19
|
+
format?: GLenum;
|
|
20
|
+
}
|
|
21
|
+
export declare function createFloatTexture(gl: WebGL2RenderingContext, opts: CreateTextureOpts): GpuTexture;
|
|
22
|
+
export declare function createFramebuffer(gl: WebGL2RenderingContext, texture: WebGLTexture): WebGLFramebuffer;
|
|
23
|
+
export declare function createBuffer(gl: WebGL2RenderingContext, data?: BufferSource): WebGLBuffer;
|
|
24
|
+
export declare function makePingPong<A, B>(a: A, b: B): () => [A | B, A | B];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { QUAD_VERTICES, uniformSetterName, compileShader, createProgram, createFloatTexture, createFramebuffer, createBuffer, makePingPong, } from './helpers';
|
|
2
|
+
export type { GpuTexture, CreateTextureOpts } from './helpers';
|
|
3
|
+
export { introspectProgram, bindUniforms, } from './program';
|
|
4
|
+
export type { UniformInfo, UniformTable } from './program';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface UniformInfo {
|
|
2
|
+
size: number;
|
|
3
|
+
data: any;
|
|
4
|
+
type: GLenum;
|
|
5
|
+
location: WebGLUniformLocation;
|
|
6
|
+
}
|
|
7
|
+
export type UniformTable = {
|
|
8
|
+
[name: string]: UniformInfo;
|
|
9
|
+
};
|
|
10
|
+
export declare function introspectProgram(gl: WebGL2RenderingContext, program: WebGLProgram, defaults: {
|
|
11
|
+
[name: string]: any;
|
|
12
|
+
}): UniformTable;
|
|
13
|
+
export declare function bindUniforms(gl: WebGL2RenderingContext, table: UniformTable, overrides?: {
|
|
14
|
+
[name: string]: any;
|
|
15
|
+
}): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Force layout factory.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the force simulation (Barnes-Hut / GPU-accelerated) as a layout
|
|
5
|
+
* descriptor that can be registered with `modules.layouts`.
|
|
6
|
+
*
|
|
7
|
+
* The factory returns `(opts?) => Promise<any>` — calling it starts the
|
|
8
|
+
* layout and resolves when it converges or is stopped.
|
|
9
|
+
*/
|
|
10
|
+
/** Nodus instance (subset of the public API used here). */
|
|
11
|
+
interface Nodus {
|
|
12
|
+
modules: {
|
|
13
|
+
layouts: {
|
|
14
|
+
register(descriptor: LayoutDescriptor): void;
|
|
15
|
+
start(name: string, opts: any): Promise<any>;
|
|
16
|
+
};
|
|
17
|
+
graph: any;
|
|
18
|
+
locate: any;
|
|
19
|
+
camera: any;
|
|
20
|
+
};
|
|
21
|
+
layouts: {
|
|
22
|
+
force: (opts?: any) => Promise<any>;
|
|
23
|
+
};
|
|
24
|
+
getNodes(ids?: any): any;
|
|
25
|
+
}
|
|
26
|
+
/** Layout descriptor registered with the layout system. */
|
|
27
|
+
interface LayoutDescriptor {
|
|
28
|
+
name: string;
|
|
29
|
+
imports?: Record<string, any>;
|
|
30
|
+
configure(opts: any, modules: any): any;
|
|
31
|
+
context?(): any;
|
|
32
|
+
update(msg: any, context: any): any;
|
|
33
|
+
stop(context: any): void;
|
|
34
|
+
isRunning(context: any): boolean;
|
|
35
|
+
onSync(msg: any, modules?: any, running?: boolean): any;
|
|
36
|
+
}
|
|
37
|
+
/** Strip non-transferable (function) properties from an options object. */
|
|
38
|
+
declare function ensureTransferable<T extends Record<string, any>>(opts: T): T;
|
|
39
|
+
/**
|
|
40
|
+
* The layout descriptor that the layout system runs in a worker (or
|
|
41
|
+
* on the main thread when `useWebWorker` is false / GPU mode).
|
|
42
|
+
*/
|
|
43
|
+
declare const forceDescriptor: LayoutDescriptor;
|
|
44
|
+
/**
|
|
45
|
+
* Handle the `incremental` option: run the layout on a subgraph and place
|
|
46
|
+
* it relative to the existing nodes.
|
|
47
|
+
*/
|
|
48
|
+
declare function incrementalLayout(opts: any, nodus: any, layoutFn: (o: any) => Promise<any>): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Create and register the force layout on an Nodus instance.
|
|
51
|
+
*
|
|
52
|
+
* @returns A function `(opts?) => Promise<any>` that starts the layout.
|
|
53
|
+
*/
|
|
54
|
+
export default function forceFactory(nodus: Nodus): (opts?: any) => Promise<any>;
|
|
55
|
+
export { forceDescriptor, incrementalLayout, ensureTransferable };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ForceLink layout factory.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the ForceAtlas2-style force-directed layout as a layout descriptor.
|
|
5
|
+
* This layout uses a Barnes-Hut approximation for repulsion, adaptive
|
|
6
|
+
* speed control, and optional sibling alignment.
|
|
7
|
+
*
|
|
8
|
+
* Unlike the basic force layout, forceLink operates on a flat byte-array
|
|
9
|
+
* representation of the graph (`NodeMatrix` / `EdgeMatrix`) and runs its
|
|
10
|
+
* own convergence loop.
|
|
11
|
+
*/
|
|
12
|
+
interface Nodus {
|
|
13
|
+
modules: {
|
|
14
|
+
layouts: {
|
|
15
|
+
register(descriptor: LayoutDescriptor): void;
|
|
16
|
+
start(name: string, opts: any): Promise<any>;
|
|
17
|
+
};
|
|
18
|
+
graph: any;
|
|
19
|
+
};
|
|
20
|
+
layouts: {
|
|
21
|
+
forceLink: (opts?: any) => Promise<any>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface LayoutDescriptor {
|
|
25
|
+
name: string;
|
|
26
|
+
configure(opts: any, modules: any): any;
|
|
27
|
+
context(): any;
|
|
28
|
+
update(msg: any, context: any): any;
|
|
29
|
+
stop(context: any): void;
|
|
30
|
+
isRunning(context: any): boolean;
|
|
31
|
+
onSync(msg: any, modules: any): any;
|
|
32
|
+
}
|
|
33
|
+
declare const forceLinkDescriptor: LayoutDescriptor;
|
|
34
|
+
/**
|
|
35
|
+
* Create and register the forceLink layout on an Nodus instance.
|
|
36
|
+
*
|
|
37
|
+
* @returns A function `(opts?) => Promise<any>` that starts the layout.
|
|
38
|
+
*/
|
|
39
|
+
export default function forceLinkFactory(nodus: Nodus): (opts?: any) => Promise<any>;
|
|
40
|
+
export { forceLinkDescriptor };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grid layout algorithm.
|
|
3
|
+
*
|
|
4
|
+
* Arranges nodes in a regular grid pattern with configurable rows,
|
|
5
|
+
* columns, distances, and optional sorting.
|
|
6
|
+
*/
|
|
7
|
+
export interface GridOptions {
|
|
8
|
+
rows?: number;
|
|
9
|
+
cols?: number;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortFallbackValue?: any;
|
|
12
|
+
reverse?: boolean;
|
|
13
|
+
colDistance?: number;
|
|
14
|
+
rowDistance?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface GridInput {
|
|
17
|
+
nodeCount: number;
|
|
18
|
+
nodeRadii: number[];
|
|
19
|
+
nodeData?: any[];
|
|
20
|
+
nodeDegrees?: number[];
|
|
21
|
+
}
|
|
22
|
+
export interface GridResult {
|
|
23
|
+
x: number[];
|
|
24
|
+
y: number[];
|
|
25
|
+
}
|
|
26
|
+
export declare function grid(input: GridInput, options?: GridOptions): GridResult;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grid layout factory.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the grid algorithm as a layout descriptor. The placement compute runs
|
|
5
|
+
* in Rust (wasm `layout_grid_factory`, byte-exact — grid-concentric-parity.mjs
|
|
6
|
+
* holds the frozen TS oracle); only configure() extraction and the user-data
|
|
7
|
+
* sort (V8 comparator semantics) stay TS. wasm is REQUIRED (Phase-5 rule).
|
|
8
|
+
*/
|
|
9
|
+
interface Nodus {
|
|
10
|
+
modules: {
|
|
11
|
+
layouts: {
|
|
12
|
+
register(descriptor: LayoutDescriptor): void;
|
|
13
|
+
start(name: string, opts: any): Promise<any>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface LayoutDescriptor {
|
|
18
|
+
name: string;
|
|
19
|
+
configure(opts: any, modules: any): any;
|
|
20
|
+
update(msg: any): any;
|
|
21
|
+
onSync(msg: any): any;
|
|
22
|
+
}
|
|
23
|
+
declare const gridDescriptor: LayoutDescriptor;
|
|
24
|
+
/**
|
|
25
|
+
* Create and register the grid layout on an Nodus instance.
|
|
26
|
+
*
|
|
27
|
+
* @returns A function `(opts?) => Promise<any>` that starts the layout.
|
|
28
|
+
*/
|
|
29
|
+
export default function gridFactory(nodus: Nodus): (opts?: any) => Promise<any>;
|
|
30
|
+
export { gridDescriptor };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical (Sugiyama-style) layout algorithm.
|
|
3
|
+
*
|
|
4
|
+
* Phases:
|
|
5
|
+
* 1. Layer assignment (longest-path or user-specified)
|
|
6
|
+
* 2. Crossing reduction (median sweeps, dev's Et3)
|
|
7
|
+
* 3. X-coordinate assignment (Brandes-Köpf, dev's ut3 → see ./sugiyama.ts)
|
|
8
|
+
* 4. Component packing
|
|
9
|
+
*/
|
|
10
|
+
export interface HierarchicalOptions {
|
|
11
|
+
direction?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
12
|
+
nodeDistance?: number;
|
|
13
|
+
levelDistance?: number;
|
|
14
|
+
componentDistance?: number;
|
|
15
|
+
gapWidth?: number;
|
|
16
|
+
roots?: number[];
|
|
17
|
+
sinks?: number[];
|
|
18
|
+
compactSiblings?: boolean;
|
|
19
|
+
siblingsDistance?: number;
|
|
20
|
+
decross?: boolean;
|
|
21
|
+
arrangeComponents?: 'fit' | 'grid' | 'singleLine';
|
|
22
|
+
gridDistance?: number;
|
|
23
|
+
layer?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HierarchicalInput {
|
|
26
|
+
nodeCount: number;
|
|
27
|
+
sources: number[];
|
|
28
|
+
targets: number[];
|
|
29
|
+
nodeRadii: number[];
|
|
30
|
+
nodeData?: any[];
|
|
31
|
+
layerField?: string;
|
|
32
|
+
/** Original node positions (pre-layout). The reference translates the laid-out graph so
|
|
33
|
+
* its centroid lands on the ORIGINAL positions' centroid (Z4/Q3); omitted values count
|
|
34
|
+
* as 0, so with no positions the layout is centroid-anchored at the origin. */
|
|
35
|
+
initialX?: ArrayLike<number>;
|
|
36
|
+
initialY?: ArrayLike<number>;
|
|
37
|
+
/** Per-node user layer constraints (the reference's data.layer — user `roots` are encoded
|
|
38
|
+
* as layer 0 by the factory). undefined/NaN = unconstrained. Presence of ANY numeric
|
|
39
|
+
* value switches the component's dag to the reference's synthetic user-layer BFS tree. */
|
|
40
|
+
nodeLayers?: Array<number | undefined>;
|
|
41
|
+
}
|
|
42
|
+
export interface HierarchicalResult {
|
|
43
|
+
x: number[];
|
|
44
|
+
y: number[];
|
|
45
|
+
}
|
|
46
|
+
export declare function referenceComponents(n: number, src: number[], tgt: number[]): number[][];
|
|
47
|
+
export declare function referenceUserLayerTree(comp: number[], eSrc: number[], eTgt: number[], layerOf: (id: number) => number | undefined): {
|
|
48
|
+
src: number[];
|
|
49
|
+
tgt: number[];
|
|
50
|
+
} | null;
|
|
51
|
+
export declare function referenceDag(comp: number[], eSrc: number[], eTgt: number[]): {
|
|
52
|
+
order: number[];
|
|
53
|
+
childrenOf: Map<number, number[]>;
|
|
54
|
+
};
|
|
55
|
+
export declare function removeCycles(n: number, sources: number[], targets: number[], seedOrder?: number[]): {
|
|
56
|
+
sources: number[];
|
|
57
|
+
targets: number[];
|
|
58
|
+
};
|
|
59
|
+
export declare function longestPathLayering(n: number, out: number[][], inc: number[][], _roots: number[], // reference folds user roots into data layers (layer=0) in configure
|
|
60
|
+
sinks: number[], userLayersIn?: ArrayLike<number | undefined>): number[];
|
|
61
|
+
export declare function barycenterSweep(layers: number[][], out: number[][], inc: number[][], layer: number[], iterations: number): void;
|
|
62
|
+
export declare function assignCoordinates(layers: number[][], nodeRadii: number[], nodeDistance: number, levelDistance: number, direction: 'TB' | 'BT' | 'LR' | 'RL', compactSiblings: boolean, siblingsDistance: number, out: number[][], inc: number[][], layer: number[]): {
|
|
63
|
+
x: number[];
|
|
64
|
+
y: number[];
|
|
65
|
+
};
|
|
66
|
+
interface PackUnit {
|
|
67
|
+
nodes: number[];
|
|
68
|
+
/** grid fake unit: pre-sized box (no bbox/centering pass) */
|
|
69
|
+
fake?: {
|
|
70
|
+
w: number;
|
|
71
|
+
h: number;
|
|
72
|
+
};
|
|
73
|
+
w: number;
|
|
74
|
+
h: number;
|
|
75
|
+
x: number | undefined;
|
|
76
|
+
y: number | undefined;
|
|
77
|
+
}
|
|
78
|
+
export declare function packComponents(units: PackUnit[], x: number[], y: number[], radii: number[], componentDistance: number, arrangeComponents: 'fit' | 'grid' | 'singleLine'): void;
|
|
79
|
+
export declare function hierarchical(input: HierarchicalInput, options?: HierarchicalOptions): HierarchicalResult;
|
|
80
|
+
export {};
|