@neo4j-nvl/base 2.0.0 → 2.1.0-307fceac
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/CHANGELOG.md +25 -1
- package/README.md +12 -0
- package/dist/base.mjs +35891 -2
- package/dist/types/index.d.ts +417 -387
- package/dist/types/layouts/animatedlayout/AnimatedLayout.d.ts +23 -23
- package/dist/types/layouts/animatedlayout/animationUtils.d.ts +3 -3
- package/dist/types/layouts/circularLayout/CircularLayout.d.ts +14 -14
- package/dist/types/layouts/d3forcelayout/circularLayout.d.ts +4 -4
- package/dist/types/layouts/d3forcelayout/constants.d.ts +3 -3
- package/dist/types/layouts/d3forcelayout/d3ForceLayout.d.ts +31 -31
- package/dist/types/layouts/d3forcelayout/types.d.ts +7 -7
- package/dist/types/layouts/forcedirectedlayout/PhysLayout.d.ts +261 -261
- package/dist/types/layouts/forcedirectedlayout/clustering/ClusterByMerger.d.ts +52 -52
- package/dist/types/layouts/forcedirectedlayout/clustering/SolarMerger.d.ts +49 -49
- package/dist/types/layouts/forcedirectedlayout/clustering/clustering-utils.d.ts +35 -35
- package/dist/types/layouts/forcedirectedlayout/clustering/types.d.ts +39 -39
- package/dist/types/layouts/forcedirectedlayout/glwrapper.d.ts +3 -3
- package/dist/types/layouts/forcedirectedlayout/shaders/multilevel-fragment.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/shaders/multilevel-repulsive-fragment.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/shaders/multilevel-update-fragment.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/shaders/sim-vertex.d.ts +1 -1
- package/dist/types/layouts/freeLayout/FreeLayout.d.ts +23 -23
- package/dist/types/layouts/gridLayout/GridLayout.d.ts +26 -26
- package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +28 -28
- package/dist/types/layouts/hierarchicallayout/constants.d.ts +2 -2
- package/dist/types/modules/CallbackHelper.d.ts +23 -23
- package/dist/types/modules/ExternalCallbackHandler.d.ts +46 -33
- package/dist/types/modules/NvlController.d.ts +212 -209
- package/dist/types/modules/Shader.d.ts +17 -17
- package/dist/types/modules/ZoomTransitionHandler.d.ts +24 -24
- package/dist/types/modules/dataset.d.ts +24 -24
- package/dist/types/modules/logging.d.ts +4 -4
- package/dist/types/modules/state/constants.d.ts +2 -2
- package/dist/types/modules/state/state.d.ts +2 -2
- package/dist/types/modules/state/types.d.ts +316 -281
- package/dist/types/modules/state/utils.d.ts +36 -36
- package/dist/types/renderers/ClusterOverlay.d.ts +67 -67
- package/dist/types/renderers/domrenderer/BaseRenderer.d.ts +69 -69
- package/dist/types/renderers/domrenderer/canvasrenderer/Animation.d.ts +57 -57
- package/dist/types/renderers/domrenderer/canvasrenderer/AnimationHandler.d.ts +65 -65
- package/dist/types/renderers/domrenderer/canvasrenderer/CanvasRenderer.d.ts +84 -85
- package/dist/types/renderers/domrenderer/canvasrenderer/arrowDrawing.d.ts +31 -31
- package/dist/types/renderers/domrenderer/canvasrenderer/nodeDrawing.d.ts +32 -32
- package/dist/types/renderers/domrenderer/shared/ImageCache.d.ts +16 -16
- package/dist/types/renderers/domrenderer/shared/arrows/ArrowBundle.d.ts +89 -89
- package/dist/types/renderers/domrenderer/shared/arrows/ArrowBundler.d.ts +42 -42
- package/dist/types/renderers/domrenderer/shared/arrows/arrows.d.ts +49 -49
- package/dist/types/renderers/domrenderer/shared/arrows/constants.d.ts +4 -4
- package/dist/types/renderers/domrenderer/shared/nodes/nodes.d.ts +21 -21
- package/dist/types/renderers/domrenderer/shared/types.d.ts +29 -29
- package/dist/types/renderers/domrenderer/shared/util.d.ts +4 -4
- package/dist/types/renderers/domrenderer/shared/vectorUtils.d.ts +10 -10
- package/dist/types/renderers/domrenderer/shared/wordwrap.d.ts +10 -10
- package/dist/types/renderers/domrenderer/svgrenderer/SvgRenderer.d.ts +18 -19
- package/dist/types/renderers/domrenderer/svgrenderer/arrowDrawing.d.ts +15 -15
- package/dist/types/renderers/domrenderer/svgrenderer/nodeDrawing.d.ts +4 -4
- package/dist/types/renderers/domrenderer/svgrenderer/svgUtils.d.ts +21 -21
- package/dist/types/renderers/webglrenderer/Controller.d.ts +83 -82
- package/dist/types/renderers/webglrenderer/IconLayerRegistry.d.ts +8 -8
- package/dist/types/renderers/webglrenderer/Renderer.d.ts +89 -89
- package/dist/types/renderers/webglrenderer/node-animation-fragment.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-animation-vertex.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-fragment-point.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-vertex-point.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/rel-fragment-line.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/rel-glsl-utils.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/rel-vertex-arrow.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/rel-vertex-line.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/viewport-box-fragment.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/viewport-box-vertex.d.ts +1 -1
- package/dist/types/types/graph-element.d.ts +121 -104
- package/dist/types/types/nvl-window-functions.d.ts +28 -13
- package/dist/types/types/utils.d.ts +1 -1
- package/dist/types/utils/ariaUtils.d.ts +2 -2
- package/dist/types/utils/canvasManagement.d.ts +7 -1
- package/dist/types/utils/circularUtils.d.ts +2 -2
- package/dist/types/utils/clusterGeometry.d.ts +3 -3
- package/dist/types/utils/clusterHitRegions.d.ts +12 -12
- package/dist/types/utils/colorUtils.d.ts +2 -2
- package/dist/types/utils/constants.d.ts +6 -6
- package/dist/types/utils/errors.d.ts +6 -6
- package/dist/types/utils/geometry.d.ts +48 -48
- package/dist/types/utils/graphObjectUtils.d.ts +9 -9
- package/dist/types/utils/hitTest.d.ts +87 -0
- package/dist/types/utils/jsDriverResultTransformer.d.ts +26 -16
- package/dist/types/utils/layoutSeeding.d.ts +2 -2
- package/dist/types/utils/mouseUtils.d.ts +5 -5
- package/dist/types/utils/segmentAnalytics.d.ts +42 -42
- package/dist/types/utils/webWorkerUtils.d.ts +1 -1
- package/dist/types/utils/zoomFunctions.d.ts +17 -17
- package/package.json +15 -15
- package/skills/neo4j-nvl-skill/README.md +39 -0
- package/skills/neo4j-nvl-skill/SKILL.md +300 -0
- package/skills/neo4j-nvl-skill/references/api/base/classes/NVL.md +1020 -0
- package/skills/neo4j-nvl-skill/references/api/base/functions/getZoomTargetForNodePositions.md +37 -0
- package/skills/neo4j-nvl-skill/references/api/base/index.md +72 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/CircularOptions.md +11 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/ClusteringOptions.md +31 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/ExternalCallbacks.md +18 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/ForceDirectedOptions.md +12 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/HierarchicalOptions.md +13 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/HitTargetCluster.md +13 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/HitTargetNode.md +16 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/HitTargetRelationship.md +15 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/Node.md +32 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/NvlMouseEvent.md +16 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/NvlOptions.md +38 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/NvlWindow.md +18 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/Point.md +12 -0
- package/skills/neo4j-nvl-skill/references/api/base/interfaces/Relationship.md +32 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/CanvasRendererType.md +14 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/Cluster.md +20 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/ClusterByFn.md +20 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/ClusterId.md +10 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/HitTargets.md +22 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/HitTestTarget.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/Layout.md +15 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/LayoutOptions.md +12 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/NodeWithClientPosition.md +24 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/PartialNode.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/PartialRelationship.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/Renderer.md +11 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/StyledCaption.md +21 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/WebGLRendererType.md +14 -0
- package/skills/neo4j-nvl-skill/references/api/base/type-aliases/ZoomOptions.md +25 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/CircularLayoutType.md +11 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/ForceDirectedLayoutType.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/FreeLayoutType.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/GridLayoutType.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/HierarchicalLayoutType.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/d3ForceLayoutType.md +9 -0
- package/skills/neo4j-nvl-skill/references/api/base/variables/nvlResultTransformer.md +49 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/BoxSelectInteraction.md +163 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/ClickInteraction.md +163 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/DragNodeInteraction.md +164 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/HoverInteraction.md +166 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/KeyboardInteraction.md +185 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/LassoInteraction.md +163 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/PanInteraction.md +197 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/classes/ZoomInteraction.md +169 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/index.md +37 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/BoxSelectInteractionCallbacks.md +19 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/BoxSelectInteractionOptions.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/ClickInteractionCallbacks.md +39 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/ClickInteractionOptions.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/DragNodeInteractionCallbacks.md +21 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/DrawInteractionOptions.md +22 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/HoverInteractionCallbacks.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/HoverInteractionOptions.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/KeyboardInteractionCallbacks.md +35 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/KeyboardInteractionOptions.md +55 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/LassoInteractionCallbacks.md +19 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/LassoInteractionOptions.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/PanInteractionCallbacks.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/PanInteractionOptions.md +19 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/ZoomInteractionCallbacks.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/interaction-handlers/type-aliases/ZoomInteractionOptions.md +17 -0
- package/skills/neo4j-nvl-skill/references/api/react/functions/StaticPictureWrapper.md +42 -0
- package/skills/neo4j-nvl-skill/references/api/react/index.md +34 -0
- package/skills/neo4j-nvl-skill/references/api/react/interfaces/BasicReactWrapperProps.md +24 -0
- package/skills/neo4j-nvl-skill/references/api/react/interfaces/InteractiveNvlWrapperProps.md +27 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/InteractionOptions.md +10 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/KeyboardEvent.md +10 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/KeyboardEventCallbacks.md +10 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/MouseEvent.md +10 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/MouseEventCallbacks.md +19 -0
- package/skills/neo4j-nvl-skill/references/api/react/type-aliases/StaticPictureWrapperProps.md +27 -0
- package/skills/neo4j-nvl-skill/references/api/react/variables/BasicNvlWrapper.md +65 -0
- package/skills/neo4j-nvl-skill/references/api/react/variables/InteractiveNvlWrapper.md +18 -0
- package/skills/neo4j-nvl-skill/references/clustering.md +87 -0
- package/skills/neo4j-nvl-skill/references/data-from-neo4j.md +67 -0
- package/skills/neo4j-nvl-skill/references/labels-and-overlays.md +78 -0
- package/skills/neo4j-nvl-skill/references/layouts-and-positions.md +65 -0
- package/skills/neo4j-nvl-skill/references/lifecycle-and-updates.md +65 -0
- package/skills/neo4j-nvl-skill/references/migrating-1x-to-2.md +50 -0
- package/skills/neo4j-nvl-skill/references/react-wrappers.md +92 -0
- package/skills/neo4j-nvl-skill/references/verifying-nvl-apps.md +52 -0
- package/skills/neo4j-nvl-skill/references/vite-and-bundlers.md +62 -0
- package/dist/base.mjs.LICENSE.txt +0 -21
- package/dist/types/layouts/animatedlayout/AnimatedLayout.test.d.ts +0 -1
- package/dist/types/layouts/animatedlayout/animationUtils.test.d.ts +0 -1
- package/dist/types/layouts/d3forcelayout/__mocks__/d3ForceLayout.d.ts +0 -10
- package/dist/types/layouts/d3forcelayout/circularLayout.test.d.ts +0 -1
- package/dist/types/layouts/d3forcelayout/d3ForceLayout.test.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/PhysLayout.test.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/clustering/ClusterByMerger.test.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/clustering/SolarMerger.bench.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/clustering/SolarMerger.test.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/clustering/clustering-utils.test.d.ts +0 -1
- package/dist/types/modules/NvlController.test.d.ts +0 -1
- package/dist/types/modules/ZoomTransitionHandler.test.d.ts +0 -1
- package/dist/types/modules/dataset.test.d.ts +0 -1
- package/dist/types/modules/state/state.test.d.ts +0 -1
- package/dist/types/modules/state/utils.test.d.ts +0 -1
- package/dist/types/renderers/ClusterOverlay.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/BaseRenderer.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/canvasrenderer/Animation.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/canvasrenderer/CanvasRenderer.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/canvasrenderer/arrowDrawing.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/canvasrenderer/nodeDrawing.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/ImageCache.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/arrows/ArrowBundle.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/arrows/ArrowBundler.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/arrows/arrows.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/nodes/nodes.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/util.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/shared/wordwrap.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/svgrenderer/SvgRenderer.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/svgrenderer/arrowDrawing.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/svgrenderer/nodeDrawing.test.d.ts +0 -1
- package/dist/types/renderers/domrenderer/svgrenderer/svgUtils.test.d.ts +0 -1
- package/dist/types/renderers/webglrenderer/Controller.test.d.ts +0 -1
- package/dist/types/renderers/webglrenderer/IconLayerRegistry.test.d.ts +0 -1
- package/dist/types/renderers/webglrenderer/Renderer.test.d.ts +0 -1
- package/dist/types/utils/ariaUtils.test.d.ts +0 -1
- package/dist/types/utils/canvasManagement.test.d.ts +0 -1
- package/dist/types/utils/circularUtils.test.d.ts +0 -1
- package/dist/types/utils/clusterGeometry.test.d.ts +0 -1
- package/dist/types/utils/clusterHitRegions.test.d.ts +0 -1
- package/dist/types/utils/colorUtils.test.d.ts +0 -1
- package/dist/types/utils/errors.test.d.ts +0 -1
- package/dist/types/utils/geometry.test.d.ts +0 -1
- package/dist/types/utils/graphObjectUtils.test.d.ts +0 -1
- package/dist/types/utils/hittest.d.ts +0 -84
- package/dist/types/utils/hittest.test.d.ts +0 -1
- package/dist/types/utils/jsDriverResultTransformer.test.d.ts +0 -1
- package/dist/types/utils/layoutSeeding.test.d.ts +0 -1
- package/dist/types/utils/mouseUtils.test.d.ts +0 -1
- package/dist/types/utils/webWorkerUtils.test.d.ts +0 -1
- package/dist/types/utils/zoomFunctions.test.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Point } from "../utils/geometry.js";
|
|
2
|
+
import { StyledCaption } from "../renderers/domrenderer/shared/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* The base type for graph elements.
|
|
5
5
|
* @private
|
|
@@ -7,137 +7,154 @@ import type { Point } from '../utils/geometry';
|
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
9
9
|
interface GraphElement {
|
|
10
|
+
/**
|
|
11
|
+
* The id of the current node or relationship.
|
|
12
|
+
* Ids need to be unique across all nodes and relationships.
|
|
13
|
+
* Ids need to be strings and cannot be empty.
|
|
14
|
+
*/
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** The color of the graph element.*/
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Whether or not the current node or relationship is selected.*/
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The text to display on the node or relationship.
|
|
22
|
+
* @remarks
|
|
23
|
+
* If both `caption` and {@link captions} are provided, `captions` takes precedence.
|
|
24
|
+
* To provide multiple captions with custom styles, use the {@link captions} property.
|
|
25
|
+
* Captions are only visible when using the 'canvas' renderer.
|
|
26
|
+
* @see {@link Node.html} and {@link Node.icon} for labelling nodes with the WebGL renderer.
|
|
27
|
+
*/
|
|
28
|
+
caption?: string;
|
|
29
|
+
/** Whether or not the current node or relationship is disabled.*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Whether or not the current node or relationship is hovered.*/
|
|
32
|
+
hovered?: boolean;
|
|
33
|
+
/** The caption text size.*/
|
|
34
|
+
captionSize?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The caption align.
|
|
37
|
+
* Has no affect on self-referring relationships.
|
|
38
|
+
*/
|
|
39
|
+
captionAlign?: 'top' | 'bottom' | 'center';
|
|
40
|
+
/**
|
|
41
|
+
* Multiple captions with individual text styles.
|
|
42
|
+
* @remarks
|
|
43
|
+
* Only drawn by the `'canvas'` renderer. For a single unstyled caption use {@link caption}.
|
|
44
|
+
*/
|
|
45
|
+
captions?: StyledCaption[];
|
|
46
|
+
/**
|
|
47
|
+
* An icon to be displayed anywhere on top of the graph element.
|
|
48
|
+
* Icons are expected to be square. Works with both renderers.
|
|
49
|
+
*/
|
|
50
|
+
overlayIcon?: {
|
|
51
|
+
/** The url to the icon.*/
|
|
52
|
+
url: string;
|
|
10
53
|
/**
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
13
|
-
*
|
|
54
|
+
* The position of the icon relative to the node or relationship.
|
|
55
|
+
* The position is a percentage of the node or relationship size.
|
|
56
|
+
* `[1, 1]` is the bottom right corner of the node or relationship.
|
|
57
|
+
* `[-1, -1]` is the top left corner of the node or relationship.
|
|
58
|
+
* @defaultValue `[0, 0]`, the center of the node or relationship.
|
|
14
59
|
*/
|
|
15
|
-
|
|
16
|
-
/** The color of the graph element.*/
|
|
17
|
-
color?: string;
|
|
18
|
-
/** Whether or not the current node or relationship is selected.*/
|
|
19
|
-
selected?: boolean;
|
|
60
|
+
position?: number[];
|
|
20
61
|
/**
|
|
21
|
-
* The
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
24
|
-
* @note: Captions are only visible when using the 'canvas' renderer.
|
|
62
|
+
* The size of the icon relative to the node size or relationship caption size.
|
|
63
|
+
* The size is a percentage of the node size or relationship caption size.
|
|
64
|
+
* @defaultValue `1`, the same size as the node size or relationship caption size.
|
|
25
65
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
/** Whether or not the current node or relationship is hovered.*/
|
|
30
|
-
hovered?: boolean;
|
|
31
|
-
/** The caption text size.*/
|
|
32
|
-
captionSize?: number;
|
|
33
|
-
/**
|
|
34
|
-
* The caption align.
|
|
35
|
-
* Has no affect on self-referring relationships.
|
|
36
|
-
*/
|
|
37
|
-
captionAlign?: 'top' | 'bottom' | 'center';
|
|
38
|
-
/**
|
|
39
|
-
* The caption text and font styles.
|
|
40
|
-
* @note: To provide a single caption without custom styles, you can also use the {@link caption} property.
|
|
41
|
-
* @note: Captions are only visible when using the 'canvas' renderer.
|
|
42
|
-
*/
|
|
43
|
-
captions?: StyledCaption[];
|
|
44
|
-
/**
|
|
45
|
-
* An icon to be displayed anywhere on top of the graph element.
|
|
46
|
-
* Icons are expected to be square.
|
|
47
|
-
*/
|
|
48
|
-
overlayIcon?: {
|
|
49
|
-
/** The url to the icon.*/
|
|
50
|
-
url: string;
|
|
51
|
-
/**
|
|
52
|
-
* The position of the icon relative to the node or relationship.
|
|
53
|
-
* The position is a percentage of the node or relationship size.
|
|
54
|
-
* `[1, 1]` is the bottom right corner of the node or relationship.
|
|
55
|
-
* `[-1, -1]` is the top left corner of the node or relationship.
|
|
56
|
-
* @defaultValue `[0, 0]`, the center of the node or relationship.
|
|
57
|
-
*/
|
|
58
|
-
position?: number[];
|
|
59
|
-
/**
|
|
60
|
-
* The size of the icon relative to the node size or relationship caption size.
|
|
61
|
-
* The size is a percentage of the node size or relationship caption size.
|
|
62
|
-
* @defaultValue `1`, the same size as the node size or relationship caption size.
|
|
63
|
-
*/
|
|
64
|
-
size?: number;
|
|
65
|
-
};
|
|
66
|
+
size?: number;
|
|
67
|
+
};
|
|
66
68
|
}
|
|
67
69
|
export declare const isValidNode: (node: unknown) => node is Node;
|
|
68
70
|
/**
|
|
69
71
|
* A node inside the graph visualization.
|
|
70
72
|
*/
|
|
71
73
|
interface Node extends GraphElement {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
74
|
+
/** The size of the node.*/
|
|
75
|
+
size?: number;
|
|
76
|
+
/** Whether or not the current node is pinned.*/
|
|
77
|
+
pinned?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @ignore
|
|
80
|
+
* Do not set this. Node positions are owned by the layout; move nodes with
|
|
81
|
+
* {@link NVL.setNodePositions} (or the `positions` prop of the React wrappers).
|
|
82
|
+
* Kept for internal use and slated for removal.
|
|
83
|
+
*/
|
|
84
|
+
x?: number;
|
|
85
|
+
/**
|
|
86
|
+
* @ignore
|
|
87
|
+
* Do not set this. Node positions are owned by the layout; move nodes with
|
|
88
|
+
* {@link NVL.setNodePositions} (or the `positions` prop of the React wrappers).
|
|
89
|
+
* Kept for internal use and slated for removal.
|
|
90
|
+
*/
|
|
91
|
+
y?: number;
|
|
92
|
+
/** Whether or not the current node is activated.*/
|
|
93
|
+
activated?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The url to an icon to display inside the node.
|
|
96
|
+
* Icons are expected to be black and square. If the node's background color is dark,
|
|
97
|
+
* the icon will be inverted to white. Works with both renderers.
|
|
98
|
+
* @remarks
|
|
99
|
+
* The WebGL renderer keeps at most 256 distinct icon images (per url and inverted/not inverted);
|
|
100
|
+
* icons beyond that are not drawn and no warning is logged. The canvas renderer has no such cap.
|
|
101
|
+
* Keep the set of distinct icon urls small.
|
|
102
|
+
*/
|
|
103
|
+
icon?: string;
|
|
104
|
+
/**
|
|
105
|
+
* The DOM element to display on top of a node. Positioned by NVL on every frame.
|
|
106
|
+
* @experimental
|
|
107
|
+
* @remarks
|
|
108
|
+
* Any HTML overlay disables the WebGL renderer's GPU fast path because node positions must be
|
|
109
|
+
* available on the CPU every frame. Prefer {@link icon} or {@link overlayIcon} for many nodes.
|
|
110
|
+
*/
|
|
111
|
+
html?: HTMLElement;
|
|
100
112
|
}
|
|
101
113
|
/**
|
|
102
114
|
* A node returned by {@link NVL.getNodes} with layout coordinates and screen position.
|
|
103
|
-
* `x` and `y` are
|
|
115
|
+
* `x` and `y` are layout space; `clientPosition` is in CSS pixels relative to the top-left
|
|
116
|
+
* corner of the container.
|
|
117
|
+
* @remarks
|
|
118
|
+
* `clientPosition = ((x, y) - pan) * zoom / devicePixelRatio + containerSize / 2`,
|
|
119
|
+
* with `pan` from {@link NVL.getPan} and `zoom` from {@link NVL.getScale}.
|
|
104
120
|
*/
|
|
105
121
|
type NodeWithClientPosition = Node & Point & {
|
|
106
|
-
|
|
122
|
+
/** Screen position in CSS pixels, relative to the top-left corner of the container. */
|
|
123
|
+
clientPosition: Point;
|
|
107
124
|
};
|
|
108
125
|
/**
|
|
109
126
|
* A node with only a subset of its properties.
|
|
110
127
|
*/
|
|
111
128
|
type PartialNode = Partial<Node> & {
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
/** The id of the node. */
|
|
130
|
+
id: string;
|
|
114
131
|
};
|
|
115
132
|
export declare const isValidRelationship: (relationship: unknown) => relationship is Relationship;
|
|
116
133
|
/**
|
|
117
134
|
* A relationship inside the graph visualization.
|
|
118
135
|
*/
|
|
119
136
|
interface Relationship extends GraphElement {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
/** Node id where the relationship starts from.*/
|
|
138
|
+
from: string;
|
|
139
|
+
/** Node id where the relationship points to.*/
|
|
140
|
+
to: string;
|
|
141
|
+
/** The relationship type.*/
|
|
142
|
+
type?: string;
|
|
143
|
+
/** The width of the relationship.*/
|
|
144
|
+
width?: number;
|
|
145
|
+
/**
|
|
146
|
+
* The DOM element to display on top of a relationship caption.
|
|
147
|
+
* @experimental
|
|
148
|
+
* The {@link captionSize} and {@link captionAlign} properties
|
|
149
|
+
* will affect the position and height of the html container element.
|
|
150
|
+
*/
|
|
151
|
+
captionHtml?: HTMLElement;
|
|
135
152
|
}
|
|
136
153
|
/**
|
|
137
154
|
* A relationship with only a subset of its properties.
|
|
138
155
|
*/
|
|
139
156
|
type PartialRelationship = Partial<Relationship> & {
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
/** The id of the relationship. */
|
|
158
|
+
id: string;
|
|
142
159
|
};
|
|
143
|
-
export type { Node, NodeWithClientPosition,
|
|
160
|
+
export type { Node, NodeWithClientPosition, PartialNode, PartialRelationship, Relationship };
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Node, NodeWithClientPosition, Relationship } from "./graph-element.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only debugging hooks that every NVL instance registers on `window`, for tests and tooling
|
|
4
|
+
* that cannot reach the NVL object. Hooks exist from the first instance's construction and stay on
|
|
5
|
+
* `window` after it is destroyed. `instanceId` is the {@link NvlOptions.instanceId} given to NVL
|
|
6
|
+
* (default `'default'`); an unknown id falls back to the most recently created instance.
|
|
7
|
+
*/
|
|
2
8
|
export interface NvlWindow {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/** Same as {@link NVL.getNodes}: all nodes with layout coordinates and `clientPosition`. */
|
|
10
|
+
__Nvl_dumpNodes: (instanceId?: string) => NodeWithClientPosition[];
|
|
11
|
+
/** Same as {@link NVL.getRelationships}. */
|
|
12
|
+
__Nvl_dumpRelationships: (instanceId?: string) => Relationship[];
|
|
13
|
+
/** Same as {@link NVL.getNodesOnScreen}: nodes inside the viewport; `rels` is always empty. */
|
|
14
|
+
__Nvl_getNodesOnScreen: (instanceId?: string) => {
|
|
15
|
+
/** Nodes whose position is inside the viewport. */
|
|
16
|
+
nodes: Node[];
|
|
17
|
+
/** Always empty; kept for shape compatibility. */
|
|
18
|
+
rels: Relationship[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Adds a listener for {@link ExternalCallbacks.onLayoutDone}. Called on every layout completion,
|
|
22
|
+
* not just the first; listeners cannot be removed.
|
|
23
|
+
*/
|
|
24
|
+
__Nvl_registerDoneCallback: (cb: () => void, instanceId: string) => void;
|
|
25
|
+
/** Same as {@link NVL.getScale}. */
|
|
26
|
+
__Nvl_getZoomLevel: (instanceId?: string) => number;
|
|
11
27
|
}
|
|
12
28
|
declare global {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
29
|
+
interface Window extends NvlWindow {}
|
|
30
|
+
const SEGMENT_WRITE_KEY: string;
|
|
31
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const typedObjectEntries: <T>(obj: T) => [keyof T, T[keyof T]][];
|
|
1
|
+
export declare const typedObjectEntries: <T>(obj: T) => [keyof T, T[keyof T]][];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NvlState } from "../modules/state/types.js";
|
|
2
2
|
export declare const enrichWithAria: (canvasParent: HTMLElement, instanceId: string) => HTMLDivElement;
|
|
3
|
-
export declare const updateAriaDescription: (state: NvlState, descriptionElement: HTMLDivElement) => void;
|
|
3
|
+
export declare const updateAriaDescription: (state: NvlState, descriptionElement: HTMLDivElement) => void;
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
* it will use the width and height from the style properties.
|
|
9
9
|
*/
|
|
10
10
|
export declare const fitCanvasSizeToParent: (canvas: HTMLCanvasElement) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Calls `callback` whenever the size of `element` changes, using `ResizeObserver`.
|
|
13
|
+
*
|
|
14
|
+
* @returns The observer so the caller can `disconnect()` it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const observeResize: (element: HTMLElement, callback: () => void) => ResizeObserver;
|
|
11
17
|
export declare const addWebGLContextLostListener: (canvas: HTMLCanvasElement, contextLostCallback?: (e: WebGLContextEvent) => void) => void;
|
|
12
18
|
export declare const createCanvasForScreenshot: (fullWidth: number, fullHeight: number) => HTMLCanvasElement;
|
|
13
19
|
export declare const createCanvasForRenderer: (parent?: HTMLElement, onContextLostCallback?: (e: WebGLContextEvent) => void) => HTMLCanvasElement;
|
|
@@ -30,4 +36,4 @@ export declare const measureTextCached: (ctx: CanvasRenderingContext2D, text: st
|
|
|
30
36
|
/**
|
|
31
37
|
* Clears the text measurement cache.
|
|
32
38
|
*/
|
|
33
|
-
export declare const clearTextMeasurementCache: () => void;
|
|
39
|
+
export declare const clearTextMeasurementCache: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Node } from "../types/graph-element.js";
|
|
2
2
|
export declare const MIN_RADIUS = 250;
|
|
3
|
-
export declare const getPositionsOnCircle: (nodes: Node[]) => Record<string, Node>;
|
|
3
|
+
export declare const getPositionsOnCircle: (nodes: Node[]) => Record<string, Node>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Point } from "./geometry.js";
|
|
2
2
|
/** Extra world-space padding around each member disk before taking the cluster hull. */
|
|
3
3
|
export declare const ClusterHullPadding = 14;
|
|
4
4
|
/** Circumference samples per member disk before taking the convex hull. */
|
|
5
5
|
export declare const DiskSampleCount = 8;
|
|
6
6
|
export type ClusterMemberDisk = Point & {
|
|
7
|
-
|
|
7
|
+
radius: number;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Fits a convex hull around the given disks by sampling each member circumference.
|
|
11
11
|
* @param members - The cluster member disks to fit the hull around.
|
|
12
12
|
* @returns The fitted hull, or null if fewer than two members have a usable position/radius.
|
|
13
13
|
*/
|
|
14
|
-
export declare const fitClusterHull: (members: ClusterMemberDisk[]) => Point[] | null;
|
|
14
|
+
export declare const fitClusterHull: (members: ClusterMemberDisk[]) => Point[] | null;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Point } from "./geometry.js";
|
|
2
|
+
import { Node } from "../types/graph-element.js";
|
|
3
|
+
import { Cluster, ClusterId } from "../modules/state/types.js";
|
|
4
|
+
import { CoarsenedGraph, Sun } from "../layouts/forcedirectedlayout/clustering/types.js";
|
|
5
|
+
import { ClusterMemberDisk } from "./clusterGeometry.js";
|
|
6
6
|
/**
|
|
7
7
|
* A fitted cluster hull region used for decoration and hit-testing.
|
|
8
8
|
*/
|
|
9
9
|
export type ClusterHitRegion = Cluster & {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/** Convex hull used for picking / decoration. */
|
|
11
|
+
hull: Point[];
|
|
12
|
+
/** Layout sun original id (e.g. `synth-sun:${id}`). */
|
|
13
|
+
sunOriginalId: string;
|
|
14
14
|
};
|
|
15
15
|
export type MultiMemberCluster = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
sun: Sun;
|
|
17
|
+
nodeIds: string[];
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Returns each multi-member first-level sun system in a coarsening hierarchy.
|
|
@@ -39,4 +39,4 @@ export declare const collectMemberDisks: (nodeIds: string[], idToPosition: Reado
|
|
|
39
39
|
* @param clusterIdsBySun - Cluster id per synthetic cluster sun, keyed by sun `originalId`.
|
|
40
40
|
* @returns Fitted cluster hit regions.
|
|
41
41
|
*/
|
|
42
|
-
export declare const buildClusterByHitRegions: (subGraphs: CoarsenedGraph[], idToPosition: Readonly<Record<string, Point>>, idToItem: Record<string, Node>, clusterIdsBySun: ReadonlyMap<string, ClusterId>) => ClusterHitRegion[];
|
|
42
|
+
export declare const buildClusterByHitRegions: (subGraphs: CoarsenedGraph[], idToPosition: Readonly<Record<string, Point>>, idToItem: Record<string, Node>, clusterIdsBySun: ReadonlyMap<string, ClusterId>) => ClusterHitRegion[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import colorString from
|
|
1
|
+
import colorString from "color-string";
|
|
2
2
|
/**
|
|
3
3
|
* Determines whether a black or white font color is more readable for a given background color.
|
|
4
4
|
* @param color - The background color.
|
|
@@ -11,4 +11,4 @@ export declare const rgbaToVec4: (rgba: number[]) => number[];
|
|
|
11
11
|
export declare const rgbToVec3: (rgb: number[]) => number[];
|
|
12
12
|
export declare const colorToUIntArray: (color: string) => number;
|
|
13
13
|
export declare const colorToVec3: (color: string) => number[];
|
|
14
|
-
export declare const colorToVec4: (color: string) => number[];
|
|
14
|
+
export declare const colorToVec4: (color: string) => number[];
|
|
@@ -28,11 +28,11 @@ export declare const TextColorInverse = "#FFFFFF";
|
|
|
28
28
|
export declare const MaxArrowCountWithShadows = 500;
|
|
29
29
|
export declare const DefaultFontFace = "\"Open Sans\", sans-serif";
|
|
30
30
|
export declare const absFillStyle: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
position: string;
|
|
32
|
+
top: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
left: number;
|
|
35
|
+
right: number;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Factor to make nodes same size in WebGL renderer and Canvas.
|
|
@@ -47,4 +47,4 @@ export declare const getDevicePixelRatio: () => number;
|
|
|
47
47
|
export declare const HtmlCaptionMinWidthThreshold = 5;
|
|
48
48
|
/** Min on-screen icon size (px) before we skip drawing; avoids unreadable bitmaps when zoomed out. */
|
|
49
49
|
export declare const MinNodeIconScreenPx = 10;
|
|
50
|
-
export declare const allowedWrappers: string[];
|
|
50
|
+
export declare const allowedWrappers: string[];
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export declare class CompatibilityError extends Error {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* Returns the error message of the compatibility error.
|
|
9
|
+
* @returns The error message.
|
|
10
|
+
*/
|
|
11
|
+
toString(): string;
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Node } from "../types/graph-element.js";
|
|
2
2
|
/**
|
|
3
3
|
* An object representing a point in 2D space.
|
|
4
4
|
*/
|
|
5
5
|
export interface Point {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/** The x coordinate of the point. */
|
|
7
|
+
x: number;
|
|
8
|
+
/** The y coordinate of the point. */
|
|
9
|
+
y: number;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Returns true when value is a finite number (not NaN or Infinity).
|
|
@@ -35,48 +35,48 @@ export declare const pointEqual: (p1: Node | Point, p2: Node | Point) => boolean
|
|
|
35
35
|
* @param p2 - The second point of the segment.
|
|
36
36
|
*/
|
|
37
37
|
export declare class Segment {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
38
|
+
/** The first point of the segment. */
|
|
39
|
+
readonly p1: Point;
|
|
40
|
+
/** The second point of the segment. */
|
|
41
|
+
readonly p2: Point;
|
|
42
|
+
/** The unit vector of the segment. */
|
|
43
|
+
readonly unit: Point;
|
|
44
|
+
/** The unit normal vector of the segment. */
|
|
45
|
+
readonly norm: Point;
|
|
46
|
+
/** The length of the segment. */
|
|
47
|
+
readonly length: number;
|
|
48
|
+
/** The vector between the two points of the segment. */
|
|
49
|
+
readonly vector: Point;
|
|
50
|
+
constructor(p1: Point, p2: Point);
|
|
51
|
+
/**
|
|
52
|
+
* Get the vector between the two points of the segment.
|
|
53
|
+
* @returns The vector between the two points of the segment.
|
|
54
|
+
* @private
|
|
55
|
+
* @see {@link https://en.wikipedia.org/wiki/Vector_(spatial)}
|
|
56
|
+
*/
|
|
57
|
+
private getVector;
|
|
58
|
+
/**
|
|
59
|
+
* Get the length of the vector between the two points of the segment.
|
|
60
|
+
* @returns The length of the segment.
|
|
61
|
+
* @private
|
|
62
|
+
* @see {@link https://en.wikipedia.org/wiki/Vector_(spatial)#Length}
|
|
63
|
+
*/
|
|
64
|
+
private getLength;
|
|
65
|
+
/**
|
|
66
|
+
* Get the unit vector of the two points of the segment.
|
|
67
|
+
* @returns The unit vector of the segment.
|
|
68
|
+
* @private
|
|
69
|
+
* @see {@link https://en.wikipedia.org/wiki/Euclidean_vector#Unit_vector}
|
|
70
|
+
* @see {@link https://en.wikipedia.org/wiki/Unit_vector}
|
|
71
|
+
*/
|
|
72
|
+
private getUnitVector;
|
|
73
|
+
/**
|
|
74
|
+
* Get the unit normal vector of the two points of the segment.
|
|
75
|
+
* @returns The unit normal vector of the segment.
|
|
76
|
+
* @private
|
|
77
|
+
* @see {@link https://en.wikipedia.org/wiki/Normal_(geometry)}
|
|
78
|
+
*/
|
|
79
|
+
private getUnitNormalVector;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Calculates the projection ratio between two vectors.
|
|
@@ -168,4 +168,4 @@ export declare const isPointInConvexPolygon: (point: Point, polygon: Point[]) =>
|
|
|
168
168
|
* @param polygon - Polygon vertices in order around the boundary.
|
|
169
169
|
* @returns The absolute area of the polygon.
|
|
170
170
|
*/
|
|
171
|
-
export declare const getPolygonArea: (polygon: Point[]) => number;
|
|
171
|
+
export declare const getPolygonArea: (polygon: Point[]) => number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Node, Relationship } from "../types/graph-element.js";
|
|
2
|
+
import { DataSet } from "../modules/dataset.js";
|
|
3
3
|
export type FlatRel = Omit<Relationship & {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
bundledRels: Omit<Relationship, 'from' | 'to'>[];
|
|
5
|
+
key: string;
|
|
6
6
|
}, 'id'>;
|
|
7
7
|
export declare const getRelItemKey: (from: Node["id"], to: Node["id"]) => string;
|
|
8
8
|
export declare const relItemsToFlatKeySet: (relItems: Relationship[]) => Set<string>;
|
|
@@ -16,11 +16,11 @@ export declare const relItemsToFlatKeySet: (relItems: Relationship[]) => Set<str
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const relItemsToFlatList: (relItems: Relationship[], disabledItemColor?: string) => FlatRel[];
|
|
18
18
|
export declare const getAdjNodesMapAndRelMap: (rels: Relationship[]) => {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
adjNodesMap: Record<string, Set<string>>;
|
|
20
|
+
relMap: Record<string, Relationship[]>;
|
|
21
21
|
};
|
|
22
22
|
export declare const getConnectedNodesAndRels: (addedNodes: Set<Node["id"]>, addedRels: Set<Relationship["id"]>, nodes: DataSet<Node>, rels: DataSet<Relationship>) => {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
connectedNodes: Record<string, Node>;
|
|
24
|
+
connectedRels: Record<string, Relationship>;
|
|
25
25
|
};
|
|
26
|
-
export declare const hasSizeChanged: (graphObjectUpdates?: Node[]) => boolean;
|
|
26
|
+
export declare const hasSizeChanged: (graphObjectUpdates?: Node[]) => boolean;
|