@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,25 @@
|
|
|
1
|
+
import { Module } from './Module';
|
|
2
|
+
export declare class Tooltip extends Module {
|
|
3
|
+
private _x;
|
|
4
|
+
private _y;
|
|
5
|
+
private _handlers;
|
|
6
|
+
private _currentHandlerName;
|
|
7
|
+
private _tooltip;
|
|
8
|
+
private _isHover;
|
|
9
|
+
private _elt;
|
|
10
|
+
private _timeout;
|
|
11
|
+
onMounted(): void;
|
|
12
|
+
hide(): void;
|
|
13
|
+
isShown(): boolean;
|
|
14
|
+
refresh(): void;
|
|
15
|
+
show(e: any, { position: t, autoAdjust: s, className: o, x: c, y: p }?: any): void;
|
|
16
|
+
setHandler(e: string, t: any, s?: any): void;
|
|
17
|
+
_hideTooltip(e: boolean): void;
|
|
18
|
+
_createInteraction(e: string, t?: boolean): any;
|
|
19
|
+
_refreshTooltip(): void;
|
|
20
|
+
_schedule(e: () => void, t: number): void;
|
|
21
|
+
_showTooltip(e: any, t: any, s?: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const VALID_POSITIONS: string[];
|
|
2
|
+
export declare const NODE_POSITION_MAPPING: Record<string, {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const Z_INDEX = 10000;
|
|
7
|
+
export declare const DEFAULT_OPTIONS11: {
|
|
8
|
+
position: string;
|
|
9
|
+
autoAdjust: boolean;
|
|
10
|
+
delay: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const CONDITIONS: Record<string, (info: any) => boolean>;
|
|
13
|
+
export declare function makeHandlerName(type: string, info: any): string;
|
|
14
|
+
export declare function isHTMLElement(el: any): el is HTMLElement;
|
|
15
|
+
export declare function createElement2(tag: string): HTMLElement;
|
|
16
|
+
export declare function setElementInnerHtml(el: HTMLElement, html: string): void;
|
|
17
|
+
declare function sanitizeHtml(html: string): string;
|
|
18
|
+
export declare const htmlSanitizer: {
|
|
19
|
+
sanitize: typeof sanitizeHtml;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const DIRECTION_IN = "in";
|
|
2
|
+
export declare const DIRECTION_OUT = "out";
|
|
3
|
+
export declare const DIRECTION_BOTH = "both";
|
|
4
|
+
export declare class Topology {
|
|
5
|
+
private _fakeDeduper;
|
|
6
|
+
private _fakeInvertedDeduper;
|
|
7
|
+
private _graph;
|
|
8
|
+
nodeDeduper: any;
|
|
9
|
+
edgeDeduper: any;
|
|
10
|
+
private _sourceList;
|
|
11
|
+
private _targetList;
|
|
12
|
+
/** Rust-owned adjacency (`GraphTopology`). Nodus is wasm-backed: the adjacency lives entirely
|
|
13
|
+
* in Rust — the legacy TS Table-backed fallback has been deleted (Phase-5 cutover). */
|
|
14
|
+
private _topo;
|
|
15
|
+
constructor(graph: any);
|
|
16
|
+
getAdjacentDirections(nodeIndex: number): number[] | null;
|
|
17
|
+
getEdgeIndexesInDirection(dirIndex: number): number[] | null;
|
|
18
|
+
allocateNodes(indexes: number[]): void;
|
|
19
|
+
allocateEdges(edgeIndexes: number[], sources: number[], targets: number[]): void;
|
|
20
|
+
getExtremity(isSource: boolean, element: any): any;
|
|
21
|
+
setExtremities(edgeIndexes: Uint32Array | number[], sources: Uint32Array | number[] | null, targets: Uint32Array | number[] | null): void;
|
|
22
|
+
addToAdjacencyList(edgeIndex: number): void;
|
|
23
|
+
hasParallelEdges(edgeIndex: number): boolean;
|
|
24
|
+
removeFromAdjacencyList(edgeIndex: number): void;
|
|
25
|
+
getParallelEdges(element: any, opts?: any): any;
|
|
26
|
+
fastGetNodesAdjacentElements(nodeIndexes: Uint32Array | number[]): {
|
|
27
|
+
nodes: any;
|
|
28
|
+
edges: any;
|
|
29
|
+
};
|
|
30
|
+
fastGetEdgesAdjacentElements(edgeIndexes: Uint32Array | number[]): {
|
|
31
|
+
nodes: any;
|
|
32
|
+
edges: any;
|
|
33
|
+
};
|
|
34
|
+
getDeduper(isNode: boolean): any;
|
|
35
|
+
collectAdjacentEdges(nodeIndexes: Uint32Array | number[], direction: string, filter: string, dedupe?: boolean, bothExtremities?: boolean): Uint32Array;
|
|
36
|
+
collectAdjacentNodes(nodeIndexes: Uint32Array | number[], direction: string, filter: string, dedupe?: boolean, include?: Uint32Array | number[], exclude?: Uint32Array | number[]): Uint32Array;
|
|
37
|
+
getAdjacentElements(isNode: boolean, nodeIndexes: Uint32Array | number[], opts?: any): Uint32Array;
|
|
38
|
+
getDegree(nodeIndexes: Uint32Array | number[], opts?: any): number[];
|
|
39
|
+
degrees(nodeIndexes: Uint32Array | number[], direction?: string): number[];
|
|
40
|
+
private _degree;
|
|
41
|
+
private _getDegreeOptions;
|
|
42
|
+
getEdgesBetweenTwoNodes(sourceIdx: number, targetIdx: number): Uint32Array;
|
|
43
|
+
getConnectedComponents(nodeIndexes: Uint32Array | number[], opts?: any): any[];
|
|
44
|
+
getAdjacencyList(opts: {
|
|
45
|
+
directed: boolean;
|
|
46
|
+
ids: boolean;
|
|
47
|
+
weight: any;
|
|
48
|
+
nodes: Uint32Array | number[];
|
|
49
|
+
}): any;
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Module } from './Module';
|
|
2
|
+
export declare class Touch extends Module {
|
|
3
|
+
private _pressed;
|
|
4
|
+
private _domElt;
|
|
5
|
+
private _onMove;
|
|
6
|
+
private _onEnd;
|
|
7
|
+
private _addEvent;
|
|
8
|
+
private _addWinEvent;
|
|
9
|
+
private _removeWinEvent;
|
|
10
|
+
onMounted(): void;
|
|
11
|
+
get x(): number;
|
|
12
|
+
get y(): number;
|
|
13
|
+
get pressed(): boolean;
|
|
14
|
+
_listen(e: any, t: string, s: any): any;
|
|
15
|
+
_initialize(_e: any): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transformations — coordinator for the transformation pipeline (groupings, filters, etc.).
|
|
3
|
+
*
|
|
4
|
+
* Registers the built-in faded/transparent classes and transformation events, then
|
|
5
|
+
* delegates element-level queries and grouping operations to the transformation API.
|
|
6
|
+
*/
|
|
7
|
+
import { Module } from './Module';
|
|
8
|
+
export declare class Transformations extends Module {
|
|
9
|
+
api: any;
|
|
10
|
+
getSubElements: (el: any) => any;
|
|
11
|
+
getSubNodes: (el: any) => any;
|
|
12
|
+
getSubEdges: (el: any) => any;
|
|
13
|
+
getXYR: (el: any) => any;
|
|
14
|
+
onGroupsUpdated: (cb: any) => any;
|
|
15
|
+
constructor(nodus: any);
|
|
16
|
+
onMounted(): void;
|
|
17
|
+
onReady(_params: any): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
isElementVirtual(el: any): boolean;
|
|
20
|
+
getElementTransformation(el: any): any;
|
|
21
|
+
getMetaElements(elements: any): any[];
|
|
22
|
+
getMetaElement(el: any): any;
|
|
23
|
+
getMetaEdge(el: any): any;
|
|
24
|
+
getMetaNode(el: any): any;
|
|
25
|
+
getMetaNodes(els: any): any[];
|
|
26
|
+
getMetaEdges(els: any): any[];
|
|
27
|
+
getNodeFilters(): any[];
|
|
28
|
+
getEdgeFilters(): any[];
|
|
29
|
+
group(nodes: any, opts: any): any;
|
|
30
|
+
ungroup(node: any): any;
|
|
31
|
+
addSubGraph(node: any, data: any, opts: any): any;
|
|
32
|
+
whenApplied(): Promise<any>;
|
|
33
|
+
afterNextUpdate(): Promise<any>;
|
|
34
|
+
isRefreshing(): boolean;
|
|
35
|
+
triggerGroupUpdated(nodes: any): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Module } from './Module';
|
|
2
|
+
export declare class VirtualMouse extends Module {
|
|
3
|
+
onMounted(): void;
|
|
4
|
+
get x(): number;
|
|
5
|
+
get y(): number;
|
|
6
|
+
private _later;
|
|
7
|
+
move({ x: e, y: t }: {
|
|
8
|
+
x?: number;
|
|
9
|
+
y?: number;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
down({ x: e, y: t, button: s }?: {
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
button?: string;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
up({ x: e, y: t, button: s }?: {
|
|
17
|
+
x?: number;
|
|
18
|
+
y?: number;
|
|
19
|
+
button?: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
click({ x: e, y: t, button: s }?: {
|
|
22
|
+
x?: number;
|
|
23
|
+
y?: number;
|
|
24
|
+
button?: string;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
rightClick({ x: e, y: t, button: s }?: {
|
|
27
|
+
x?: number;
|
|
28
|
+
y?: number;
|
|
29
|
+
button?: string;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
doubleclick({ x: e, y: t, button: s }?: {
|
|
32
|
+
x?: number;
|
|
33
|
+
y?: number;
|
|
34
|
+
button?: string;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
drag(e: {
|
|
37
|
+
x?: number;
|
|
38
|
+
y?: number;
|
|
39
|
+
}, t: {
|
|
40
|
+
x?: number;
|
|
41
|
+
y?: number;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
wheel({ x: e, y: t, dx: s, dy: o, delta: c, metaKey: p, ctrlKey: At }: {
|
|
44
|
+
x?: number;
|
|
45
|
+
y?: number;
|
|
46
|
+
dx?: number;
|
|
47
|
+
dy?: number;
|
|
48
|
+
delta?: number;
|
|
49
|
+
metaKey?: boolean;
|
|
50
|
+
ctrlKey?: boolean;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CameraState {
|
|
2
|
+
cos: number;
|
|
3
|
+
sin: number;
|
|
4
|
+
bentEnable: boolean;
|
|
5
|
+
bentVertical: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class WasmHGrid {
|
|
8
|
+
private _graph;
|
|
9
|
+
private _stateFn;
|
|
10
|
+
private _minCell;
|
|
11
|
+
private _halfWorld;
|
|
12
|
+
private _rust;
|
|
13
|
+
private _items;
|
|
14
|
+
private _dirty;
|
|
15
|
+
constructor(_graph: any, _stateFn: () => CameraState, _minCell: number, _halfWorld: number);
|
|
16
|
+
clear(): void;
|
|
17
|
+
insert(item: number): void;
|
|
18
|
+
remove(item: number): void;
|
|
19
|
+
has(item: number): boolean;
|
|
20
|
+
get size(): number;
|
|
21
|
+
/** Force a rebuild on the next query (e.g. after a camera rotation changes bent-edge bounds). */
|
|
22
|
+
markDirty(): void;
|
|
23
|
+
private _rebuild;
|
|
24
|
+
query(x1: number, y1: number, x2: number, y2: number): number[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WatcherModule — schema watcher for node/edge property changes.
|
|
3
|
+
* Faithfully translated from /tmp/nodus_extracted/WatcherModule.js
|
|
4
|
+
*/
|
|
5
|
+
import { Module } from './Module';
|
|
6
|
+
export declare class WatcherModule extends Module {
|
|
7
|
+
private _propertyWatchers;
|
|
8
|
+
private _objectPropertyWatchers;
|
|
9
|
+
private _onExcludedStateChange;
|
|
10
|
+
private _onDataChange;
|
|
11
|
+
private _onElementsAdded;
|
|
12
|
+
private _onElementsRemoved;
|
|
13
|
+
private _onGraphClear;
|
|
14
|
+
onMounted(): void;
|
|
15
|
+
watchNodeObjectProperty(opts: any): any;
|
|
16
|
+
watchEdgeObjectProperty(opts: any): any;
|
|
17
|
+
watchNodeNonObjectProperty(opts: any): any;
|
|
18
|
+
watchEdgeNonObjectProperty(opts: any): any;
|
|
19
|
+
watchPropertyInformation(isNode: boolean, property: any, onChange: any, filter: any, unwindArrays: any): any;
|
|
20
|
+
unwatchPropertyInformation(isNode: boolean, property: any, onChange: any, filter: any, unwindArrays: any): void;
|
|
21
|
+
private _watchObjectProperty;
|
|
22
|
+
private _watchNonObjectProperty;
|
|
23
|
+
private _findWatcher;
|
|
24
|
+
private _createWatcher;
|
|
25
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workers — web worker pool for layout algorithms.
|
|
3
|
+
*
|
|
4
|
+
* Two implementations live here:
|
|
5
|
+
* - SyncWorker: runs the layout's update loop on the main thread, yielding
|
|
6
|
+
* between iterations via setTimeout(0). Compatible with environments
|
|
7
|
+
* where Web Workers aren't available (SSR, tests).
|
|
8
|
+
* - AsyncWorker: runs the same descriptor in a real Web Worker so heavy
|
|
9
|
+
* iterations (radial/hierarchical/forceLink at 10K+) don't freeze the
|
|
10
|
+
* main thread. The worker entry is `./layoutWorker.ts`, bundled by
|
|
11
|
+
* Vite via the `?worker` import suffix.
|
|
12
|
+
*
|
|
13
|
+
* The Nodus layout descriptor API is preserved exactly: configure() always
|
|
14
|
+
* runs on the main thread (it needs graph access), and its serialisable
|
|
15
|
+
* result is shipped to the worker as the initial msg. update() is pure on
|
|
16
|
+
* its inputs (NodeMatrix/EdgeMatrix typed arrays + settings) so it ports
|
|
17
|
+
* cleanly into the worker.
|
|
18
|
+
*/
|
|
19
|
+
import { Module } from './Module';
|
|
20
|
+
/** Abstract base for sync/async worker implementations */
|
|
21
|
+
declare class BaseWorker extends EventTarget {
|
|
22
|
+
_complete: boolean;
|
|
23
|
+
_busy: boolean;
|
|
24
|
+
_destroyed: boolean;
|
|
25
|
+
_data: any;
|
|
26
|
+
_modules: any;
|
|
27
|
+
_configure: (opts: any, modules: any) => any;
|
|
28
|
+
_update: (msg: any, ctx: any) => any;
|
|
29
|
+
_createContext: () => any;
|
|
30
|
+
_isRunning: (ctx: any, msg: any) => boolean;
|
|
31
|
+
_stop: (ctx: any) => void;
|
|
32
|
+
_onStart: () => void;
|
|
33
|
+
_onStop: () => void;
|
|
34
|
+
_onPause: () => void;
|
|
35
|
+
_setIdle: (v: any) => void;
|
|
36
|
+
timer: {
|
|
37
|
+
start: number;
|
|
38
|
+
steps: number;
|
|
39
|
+
};
|
|
40
|
+
id: number;
|
|
41
|
+
promise: Promise<any>;
|
|
42
|
+
resolve: (v: any) => void;
|
|
43
|
+
reject: (e: any) => void;
|
|
44
|
+
constructor(cfg: any, modules: any);
|
|
45
|
+
_name: string;
|
|
46
|
+
configure(cfg: {
|
|
47
|
+
name?: string;
|
|
48
|
+
configure?: Function;
|
|
49
|
+
update?: Function;
|
|
50
|
+
context?: Function;
|
|
51
|
+
stop?: Function;
|
|
52
|
+
isRunning?: Function;
|
|
53
|
+
onStart?: Function;
|
|
54
|
+
onStop?: Function;
|
|
55
|
+
onPause?: Function;
|
|
56
|
+
setIdle?: Function;
|
|
57
|
+
}): void;
|
|
58
|
+
setData(d: any): void;
|
|
59
|
+
getData(): any;
|
|
60
|
+
start(opts: any): this;
|
|
61
|
+
stop(sendStop?: boolean): Promise<any>;
|
|
62
|
+
pause(): void;
|
|
63
|
+
setIdle(v: any): void;
|
|
64
|
+
isBusy(): boolean;
|
|
65
|
+
setBusy(v: boolean): void;
|
|
66
|
+
getPromise(): Promise<any>;
|
|
67
|
+
send(_msg: any): this;
|
|
68
|
+
on(event: string, callback: (e: any) => void): this;
|
|
69
|
+
fire(event: string, data?: any): this;
|
|
70
|
+
destroy(): void;
|
|
71
|
+
}
|
|
72
|
+
export declare class Workers extends Module {
|
|
73
|
+
private _pool;
|
|
74
|
+
create(cfg: any, useAsync?: boolean): BaseWorker;
|
|
75
|
+
start(worker: BaseWorker, opts: any): BaseWorker;
|
|
76
|
+
run(cfg: any, opts: any, useAsync?: boolean): BaseWorker;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Algorithm exports barrel file.
|
|
3
|
+
* Re-exports the algorithm primitives defined across the internals modules and
|
|
4
|
+
* provides the standalone graph and layout algorithm implementations used by Nodus.
|
|
5
|
+
*/
|
|
6
|
+
/** Directed cycle detection (Rust detect_cycle, byte-exact with the deleted TS). */
|
|
7
|
+
export declare function detectCyclesDirected(nodeIndexes: ArrayLike<number>, sourceIndexes: ArrayLike<number>, targetIndexes: ArrayLike<number>): Uint32Array | null;
|
|
8
|
+
/** All simple cycles (Rust, byte-exact discovery order with the deleted CyclesFinder). */
|
|
9
|
+
export declare class CyclesFinder {
|
|
10
|
+
private readonly _n;
|
|
11
|
+
private readonly _s;
|
|
12
|
+
private readonly _t;
|
|
13
|
+
constructor(n: ArrayLike<number>, s: ArrayLike<number>, t: ArrayLike<number>);
|
|
14
|
+
getCycles(): Uint32Array[];
|
|
15
|
+
}
|
|
16
|
+
/** Kruskal MST (Rust union-find core; the reference comparator sort stays JS). */
|
|
17
|
+
export declare function kruskal_default(nodes: number[], edges: number[], getSource: (edge: any) => number, getTarget: (edge: any) => number, weight?: (edge: any) => number): number[];
|
|
18
|
+
export { kruskal_default as kruskal };
|
|
19
|
+
/** Brandes betweenness (Rust core, byte-exact with the deleted TS betweennes). */
|
|
20
|
+
export declare function betweennes(opts: {
|
|
21
|
+
adjacency: Array<{
|
|
22
|
+
id: number;
|
|
23
|
+
adj: number[];
|
|
24
|
+
}>;
|
|
25
|
+
directed: boolean;
|
|
26
|
+
normalized: boolean;
|
|
27
|
+
}): number[];
|
|
28
|
+
export { betweennes as betweenness };
|
|
29
|
+
/** Fisheye distortion (Rust kernel; per-node position extraction stays JS). */
|
|
30
|
+
export declare function fisheye(nodes: any, _edges: any, k: number, opts: any): any;
|
|
31
|
+
export { Quadtree, default as quadtree_default } from './Quadtree';
|
|
32
|
+
export { minDisk } from '../geometry';
|
|
33
|
+
export { distance, circleCircleIntersection, circleSortCompare, indexArrayToArray, cubicIn, magnitude, minmax, } from './algorithmHelpers';
|
|
34
|
+
export interface MinHeapInstance<T> {
|
|
35
|
+
readonly keys: Record<string, number>;
|
|
36
|
+
readonly size: number;
|
|
37
|
+
heapify(index: number): number;
|
|
38
|
+
pop(): T | undefined;
|
|
39
|
+
decreaseKey(index: number, value?: T): number;
|
|
40
|
+
min(): T;
|
|
41
|
+
remove(index: number): T | undefined;
|
|
42
|
+
push(value: T): number;
|
|
43
|
+
empty(): boolean;
|
|
44
|
+
toArray(): T[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Creates a binary min-heap with decrease-key support.
|
|
48
|
+
*
|
|
49
|
+
* @param compare - Comparison function (returns negative if a < b)
|
|
50
|
+
* @param items - Initial array of items (will be used as backing store)
|
|
51
|
+
* @param keyMap - Map from item keys to heap indexes
|
|
52
|
+
* @param getKey - Extracts a string key from an item
|
|
53
|
+
* @returns A min-heap instance
|
|
54
|
+
*/
|
|
55
|
+
export declare function minHeap<T = number>(compare?: (a: T, b: T) => number, items?: T[], keyMap?: Record<string, number>, getKey?: (item: T) => string | number): MinHeapInstance<T>;
|
|
56
|
+
export interface BellmanFordOptions {
|
|
57
|
+
sources: ArrayLike<number>;
|
|
58
|
+
targets: ArrayLike<number>;
|
|
59
|
+
weights?: number[];
|
|
60
|
+
source: number;
|
|
61
|
+
target?: number;
|
|
62
|
+
undirected?: boolean;
|
|
63
|
+
indexes?: Uint32Array;
|
|
64
|
+
N?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface ShortestPathResult {
|
|
67
|
+
distances: Float32Array;
|
|
68
|
+
path: number[] | null;
|
|
69
|
+
pathLength: number | null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Bellman-Ford single-source shortest path algorithm.
|
|
73
|
+
* Handles negative edge weights and detects negative cycles.
|
|
74
|
+
*
|
|
75
|
+
* @returns Shortest path result, or null if a negative cycle is detected.
|
|
76
|
+
*/
|
|
77
|
+
export declare function bellmanFord({ sources, targets, weights, source, target, undirected, indexes, N, }: BellmanFordOptions): ShortestPathResult | null;
|
|
78
|
+
export interface AdjacencyEntry {
|
|
79
|
+
nodes: number[];
|
|
80
|
+
weights?: number[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Dijkstra's single-source shortest path algorithm using a min-heap.
|
|
84
|
+
*
|
|
85
|
+
* @param adjacency - Adjacency list for each node index
|
|
86
|
+
* @param sourceId - Source node ID
|
|
87
|
+
* @param targetId - Optional target node ID for path reconstruction
|
|
88
|
+
* @param nodeIds - Array of node IDs (default: 1-indexed)
|
|
89
|
+
* @param indexMap - Map from node ID to internal index
|
|
90
|
+
* @param ignoreWeights - If true, all edges have weight 1
|
|
91
|
+
* @param weightFn - Optional custom weight function (sourceId, targetId) => weight
|
|
92
|
+
* @returns Distances, path to target, and path length
|
|
93
|
+
*/
|
|
94
|
+
export declare function dijkstra(adjacency: AdjacencyEntry[], sourceId: number, targetId?: number, nodeIds?: ArrayLike<number>, indexMap?: Record<number, number>, ignoreWeights?: boolean, weightFn?: (source: number, target: number) => number): ShortestPathResult;
|
|
95
|
+
export interface JohnsonOptions {
|
|
96
|
+
sources: ArrayLike<number>;
|
|
97
|
+
targets: ArrayLike<number>;
|
|
98
|
+
weights: number[];
|
|
99
|
+
indexes?: Uint32Array;
|
|
100
|
+
adjacency: AdjacencyEntry[];
|
|
101
|
+
undirected?: boolean;
|
|
102
|
+
ignoreWeights?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Johnson's all-pairs shortest path algorithm.
|
|
106
|
+
* Uses Bellman-Ford for re-weighting, then Dijkstra from each node.
|
|
107
|
+
*
|
|
108
|
+
* @returns An NxN matrix of shortest distances.
|
|
109
|
+
* @throws If the graph contains negative weight cycles.
|
|
110
|
+
*/
|
|
111
|
+
export declare function johnson({ sources, targets, weights, indexes, adjacency, undirected, ignoreWeights, }: JohnsonOptions): Float32Array[];
|
|
112
|
+
/**
|
|
113
|
+
* Computes weighted stress of a graph layout.
|
|
114
|
+
* Stress = sum of w_ij * (d_ij - ||p_i - p_j||)^2
|
|
115
|
+
*
|
|
116
|
+
* @param graphDist - All-pairs shortest path distance matrix
|
|
117
|
+
* @param x - X coordinates of nodes
|
|
118
|
+
* @param y - Y coordinates of nodes
|
|
119
|
+
* @param count - Number of nodes in the layout subset
|
|
120
|
+
* @param scale - Distance scaling factor
|
|
121
|
+
* @param indexes - Node index mapping array
|
|
122
|
+
*/
|
|
123
|
+
export declare function weightedStress(graphDist: Float32Array[], x: Float32Array, y: Float32Array, count: number, scale: number, indexes: Uint32Array): number;
|
|
124
|
+
/**
|
|
125
|
+
* Computes distance-based stress contribution from a single focus node.
|
|
126
|
+
*
|
|
127
|
+
* @param graphDist - All-pairs shortest path distance matrix
|
|
128
|
+
* @param x - X coordinates
|
|
129
|
+
* @param y - Y coordinates
|
|
130
|
+
* @param count - Number of nodes
|
|
131
|
+
* @param focusNode - The focus node index (-1 means no focus → returns 0)
|
|
132
|
+
* @param scale - Distance scaling factor
|
|
133
|
+
* @param indexes - Node index mapping
|
|
134
|
+
*/
|
|
135
|
+
export declare function distanceStress(graphDist: Float32Array[], x: Float32Array, y: Float32Array, count: number, focusNode: number, scale: number, indexes: Uint32Array): number;
|
|
136
|
+
/**
|
|
137
|
+
* Computes constrained stress: a blend of global stress and focus-node stress.
|
|
138
|
+
*
|
|
139
|
+
* @param graphDist - All-pairs shortest path distance matrix
|
|
140
|
+
* @param x - X coordinates
|
|
141
|
+
* @param y - Y coordinates
|
|
142
|
+
* @param count - Number of nodes
|
|
143
|
+
* @param focusNode - The focus node index
|
|
144
|
+
* @param scale - Distance scaling factor
|
|
145
|
+
* @param alpha - Blend factor (0 = pure global, 1 = pure focus)
|
|
146
|
+
* @param indexes - Node index mapping
|
|
147
|
+
*/
|
|
148
|
+
export declare function constrainedStress(graphDist: Float32Array[], x: Float32Array, y: Float32Array, count: number, focusNode: number, scale: number, alpha: number, indexes: Uint32Array): number;
|
|
149
|
+
/**
|
|
150
|
+
* Performs one iteration of stress minimization with optional focus-node constraint.
|
|
151
|
+
*
|
|
152
|
+
* @param graphDist - All-pairs shortest path distance matrix
|
|
153
|
+
* @param x - X coordinates (modified in-place)
|
|
154
|
+
* @param y - Y coordinates (modified in-place)
|
|
155
|
+
* @param count - Number of nodes
|
|
156
|
+
* @param focusNode - Focus node index (-1 for none)
|
|
157
|
+
* @param scale - Distance scaling factor
|
|
158
|
+
* @param alpha - Constraint blending factor
|
|
159
|
+
* @param indexes - Node index mapping
|
|
160
|
+
* @param distTransform - Function to transform graph distances
|
|
161
|
+
* @returns Updated x and y coordinate arrays
|
|
162
|
+
*/
|
|
163
|
+
export declare function stressMinimizationStep(graphDist: Float32Array[], x: Float32Array, y: Float32Array, count: number, focusNode: number | undefined, scale: number, alpha: number, indexes: Uint32Array, distTransform: (d: number) => number): {
|
|
164
|
+
x: Float32Array;
|
|
165
|
+
y: Float32Array;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* General stress minimization step (simplified version without distTransform).
|
|
169
|
+
*
|
|
170
|
+
* @param graphDist - All-pairs shortest path distance matrix
|
|
171
|
+
* @param x - X coordinates (modified in-place)
|
|
172
|
+
* @param y - Y coordinates (modified in-place)
|
|
173
|
+
* @param count - Number of nodes
|
|
174
|
+
* @param focusNode - Focus node index (-1 for none)
|
|
175
|
+
* @param scale - Distance scaling factor
|
|
176
|
+
* @param alpha - Constraint blending factor
|
|
177
|
+
* @param indexes - Node index mapping
|
|
178
|
+
* @returns Updated x and y coordinate arrays
|
|
179
|
+
*/
|
|
180
|
+
export declare function stressMinimizationStepGeneral(graphDist: Float32Array[], x: Float32Array, y: Float32Array, count: number, focusNode: number | undefined, scale: number, alpha: number, indexes: Uint32Array): {
|
|
181
|
+
x: Float32Array;
|
|
182
|
+
y: Float32Array;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Computes the convex hull of a set of 2D points.
|
|
186
|
+
* Uses Andrew's monotone chain algorithm.
|
|
187
|
+
*
|
|
188
|
+
* @param points - Array of [x, y] coordinate pairs
|
|
189
|
+
* @returns Array of points forming the convex hull, or null if fewer than 3 points
|
|
190
|
+
*/
|
|
191
|
+
export declare function convexHull<T extends [number, number]>(points: T[]): T[] | null;
|
|
192
|
+
export interface CircleSpreadOptions {
|
|
193
|
+
X: Float32Array;
|
|
194
|
+
Y: Float32Array;
|
|
195
|
+
R: Float32Array;
|
|
196
|
+
center?: [number, number];
|
|
197
|
+
maxSteps?: number;
|
|
198
|
+
padding?: number;
|
|
199
|
+
epsilon?: number;
|
|
200
|
+
damping?: number;
|
|
201
|
+
pinned?: number;
|
|
202
|
+
indexes?: Uint32Array;
|
|
203
|
+
onUpdate?: (x: Float32Array, y: Float32Array) => void;
|
|
204
|
+
pushSmallerOut?: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Spreads nodes on a circle to reduce overlaps by iteratively pushing apart overlapping nodes.
|
|
208
|
+
*
|
|
209
|
+
* @returns Updated X and Y coordinate arrays
|
|
210
|
+
*/
|
|
211
|
+
export declare function circleSpread({ X, Y, R, center, maxSteps, padding, epsilon, damping, pinned, indexes, onUpdate, pushSmallerOut, }: CircleSpreadOptions): {
|
|
212
|
+
X: Float32Array;
|
|
213
|
+
Y: Float32Array;
|
|
214
|
+
};
|
|
215
|
+
interface CirclePackNode {
|
|
216
|
+
x: number;
|
|
217
|
+
y: number;
|
|
218
|
+
radius: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Circle packing algorithm.
|
|
222
|
+
* Places circles without overlap in a compact arrangement.
|
|
223
|
+
*
|
|
224
|
+
* @param circles - Array of objects with `radius`, modified in-place with `x` and `y`
|
|
225
|
+
* @param cx - Center X coordinate
|
|
226
|
+
* @param cy - Center Y coordinate
|
|
227
|
+
* @returns The same circles array with positions assigned
|
|
228
|
+
*/
|
|
229
|
+
export declare function circlePack(circles: CirclePackNode[], cx?: number, cy?: number): CirclePackNode[];
|
|
230
|
+
export interface RemoveRadialOverlapOptions {
|
|
231
|
+
X: Float32Array;
|
|
232
|
+
Y: Float32Array;
|
|
233
|
+
sizes: Float32Array;
|
|
234
|
+
indexes: Uint32Array;
|
|
235
|
+
R: number;
|
|
236
|
+
center: [number, number];
|
|
237
|
+
gap?: number;
|
|
238
|
+
epsilon?: number;
|
|
239
|
+
maxLoops?: number;
|
|
240
|
+
inPlace?: boolean;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Resolves radial overlaps among nodes arranged around a center point on a circle.
|
|
244
|
+
* Pushes overlapping nodes apart while keeping them on the circle of radius R.
|
|
245
|
+
*
|
|
246
|
+
* @returns Updated X and Y coordinate arrays
|
|
247
|
+
*/
|
|
248
|
+
export declare function removeRadialOverlap({ X, Y, sizes, indexes, R, center, gap, epsilon, maxLoops, inPlace, }: RemoveRadialOverlapOptions): {
|
|
249
|
+
X: Float32Array;
|
|
250
|
+
Y: Float32Array;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Finds the largest empty circles within the convex hull of a set of points,
|
|
254
|
+
* using Delaunay triangulation.
|
|
255
|
+
*
|
|
256
|
+
* @param points - Array of { x, y } point objects
|
|
257
|
+
* @param maxCount - Maximum number of circles to return
|
|
258
|
+
* @param minRadius - Minimum radius threshold (squared internally)
|
|
259
|
+
* @param triangleVertices - Pre-computed triangle vertices (optional)
|
|
260
|
+
* @param hullVertices - Pre-computed convex hull vertices (optional)
|
|
261
|
+
* @returns Array of [centerX, centerY, radius] tuples
|
|
262
|
+
*/
|
|
263
|
+
export declare function getLargestEmptyCircle(points: {
|
|
264
|
+
x: number;
|
|
265
|
+
y: number;
|
|
266
|
+
}[], maxCount?: number, minRadius?: number, triangleVertices?: number[][], hullVertices?: number[][]): [number, number, number][];
|
|
267
|
+
/**
|
|
268
|
+
* Detects whether an undirected graph contains a cycle using Union-Find.
|
|
269
|
+
*
|
|
270
|
+
* @param nodeIds - Array of node IDs
|
|
271
|
+
* @param sourceIds - Array of edge source IDs
|
|
272
|
+
* @param targetIds - Array of edge target IDs
|
|
273
|
+
* @param allowSelfLoops - If true, self-loops are considered cycles
|
|
274
|
+
* @returns True if a cycle is detected
|
|
275
|
+
*/
|
|
276
|
+
export declare function detectCyclesUndirected(nodeIds: ArrayLike<number>, sourceIds: ArrayLike<number>, targetIds: ArrayLike<number>, allowSelfLoops?: boolean): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Detects whether an undirected graph contains a cycle using depth-first search.
|
|
279
|
+
*
|
|
280
|
+
* @param nodeIds - Array of node IDs
|
|
281
|
+
* @param sourceIds - Array of edge source IDs
|
|
282
|
+
* @param targetIds - Array of edge target IDs
|
|
283
|
+
* @returns True if a cycle is detected
|
|
284
|
+
*/
|
|
285
|
+
export declare function detectCyclesUndirectedDFS(nodeIds: ArrayLike<number>, sourceIds: ArrayLike<number>, targetIds: ArrayLike<number>): boolean;
|
|
286
|
+
import { Quadtree as QuadtreeClass } from './Quadtree';
|
|
287
|
+
import { minDisk } from '../geometry';
|
|
288
|
+
/**
|
|
289
|
+
* The unified algorithms object that aggregates every exported algorithm
|
|
290
|
+
* under a single namespace for convenient consumption.
|
|
291
|
+
*/
|
|
292
|
+
export declare const algorithms: {
|
|
293
|
+
CyclesFinder: typeof CyclesFinder;
|
|
294
|
+
Quadtree: typeof QuadtreeClass;
|
|
295
|
+
bellmanFord: typeof bellmanFord;
|
|
296
|
+
betweenness: typeof betweennes;
|
|
297
|
+
circlePack: typeof circlePack;
|
|
298
|
+
circleSpread: typeof circleSpread;
|
|
299
|
+
constrainedStress: typeof constrainedStress;
|
|
300
|
+
convexhull: typeof convexHull;
|
|
301
|
+
detectCyclesDirected: typeof detectCyclesDirected;
|
|
302
|
+
detectCyclesUndirected: typeof detectCyclesUndirected;
|
|
303
|
+
detectCyclesUndirectedDFS: typeof detectCyclesUndirectedDFS;
|
|
304
|
+
dijkstra: typeof dijkstra;
|
|
305
|
+
distanceStress: typeof distanceStress;
|
|
306
|
+
fisheye: typeof fisheye;
|
|
307
|
+
johnson: typeof johnson;
|
|
308
|
+
kruskal: typeof kruskal_default;
|
|
309
|
+
largestEmptyCircle: typeof getLargestEmptyCircle;
|
|
310
|
+
minDisk: typeof minDisk;
|
|
311
|
+
minHeap: typeof minHeap;
|
|
312
|
+
removeRadialOverlap: typeof removeRadialOverlap;
|
|
313
|
+
stressMinimizationStep: typeof stressMinimizationStep;
|
|
314
|
+
stressMinimizationStepGeneral: typeof stressMinimizationStepGeneral;
|
|
315
|
+
weightedStress: typeof weightedStress;
|
|
316
|
+
calculateRadii: typeof calculateRadii;
|
|
317
|
+
linear: typeof linear;
|
|
318
|
+
};
|
|
319
|
+
export { convexHull as convexhull };
|
|
320
|
+
export { getLargestEmptyCircle as largestEmptyCircle };
|
|
321
|
+
export declare function linear(t: number): number;
|
|
322
|
+
/**
|
|
323
|
+
* Compute the radius for each ring distance in the radial layout.
|
|
324
|
+
*
|
|
325
|
+
* @param centerIndex Index of the center node in the sizes array
|
|
326
|
+
* @param rings Map from ring distance → array of node indices
|
|
327
|
+
* @param sizes Per-node sizes (diameters)
|
|
328
|
+
* @param nodeGap Gap between nodes on the same ring
|
|
329
|
+
* @param radiusRatio Multiplier for cumulative ring spacing
|
|
330
|
+
* @param radiusDelta Additive increment for cumulative ring spacing (0 = use ratio)
|
|
331
|
+
*/
|
|
332
|
+
export declare function calculateRadii(centerIndex: number, rings: Record<number | string, number[]>, sizes: ArrayLike<number>, nodeGap: number, radiusRatio: number, radiusDelta: number): Record<number | string, number>;
|
|
333
|
+
export default algorithms;
|