@neo4j-nvl/base
Advanced tools
Comparing version 0.3.6-ade05d13 to 0.3.6-d168b648
@@ -11,2 +11,3 @@ import type { ExternalCallbacks } from './modules/ExternalCallbackHandler'; | ||
import { nvlResultTransformer } from './utils/jsDriverResultTransformer'; | ||
import { getZoomTargetForNodePositions } from './utils/zoomFunctions'; | ||
/** | ||
@@ -368,2 +369,2 @@ * Extends the MouseEvent interface with the {@link HitTargets} property. | ||
export type { NvlOptions, Renderer, Node, Relationship, PartialNode, PartialRelationship, Layout, LayoutOptions, ForceDirectedOptions, HierarchicalOptions, ExternalCallbacks, HitTargets, HitTargetNode, HitTargetRelationship, Point, NvlMouseEvent, ZoomOptions, StyledCaption, WebGLRendererType, CanvasRendererType }; | ||
export { NVL, colorMapperFunctions, CompatibilityError, ForceDirectedLayoutType, HierarchicalLayoutType, GridLayoutType, FreeLayoutType, d3ForceLayoutType, drawCircleBand, nvlResultTransformer }; | ||
export { NVL, colorMapperFunctions, CompatibilityError, ForceDirectedLayoutType, HierarchicalLayoutType, GridLayoutType, FreeLayoutType, d3ForceLayoutType, drawCircleBand, nvlResultTransformer, getZoomTargetForNodePositions }; |
@@ -133,3 +133,8 @@ import type { LogLevelDesc } from 'loglevel'; | ||
frame?: HTMLElement; | ||
/** The DOM container in which to render the minimap */ | ||
/** | ||
* The DOM container in which to render the minimap. | ||
* | ||
* @note When using a React ref, make sure the attached element is rendered before the NVL instance is created. | ||
* Otherwise, the minimap will not be displayed. | ||
*/ | ||
minimapContainer?: HTMLElement; | ||
@@ -136,0 +141,0 @@ /** Configuration for the current layout */ |
@@ -5,2 +5,8 @@ import type { Node } from '../index'; | ||
declare const getMaxDistance: (extremeLimits?: Point[]) => number; | ||
/** | ||
* Gets the center choordinates and the width and height for the given node positions | ||
* @param {Point[] | Node[]} nodePositions - The node positions | ||
* @param {number} maxNodeRadius - The maximum node radius | ||
* @returns An object with the center x and y coordinates and the width and height | ||
*/ | ||
declare const getPositionBoundaries: (nodePositions?: Point[] | Node[], maxNodeRadius?: number) => { | ||
@@ -12,2 +18,10 @@ centerX: number; | ||
}; | ||
/** | ||
* Gets the required zoom level for the given view and scene dimensions to fit the scene into the view | ||
* @param {number} viewWidth - The width of the required view | ||
* @param {number} viewHeight - The height of the required view | ||
* @param {number} sceneWidth - The width of the canvas scene | ||
* @param {number} sceneHeight - The height of the canvas scene | ||
* @returns An object with the zoom level for the x and y axis | ||
*/ | ||
declare const getZoomLevel: (viewWidth: number, viewHeight: number, sceneWidth: number, sceneHeight: number) => { | ||
@@ -17,3 +31,20 @@ zoomX: number; | ||
}; | ||
/** | ||
* Creates a zoom target based on the given zoom levels and the min and max zoom level | ||
* @param {number} zoomX - The zoom level for the x axis | ||
* @param {number} zoomY - The zoom level for the y axis | ||
* @param {number} minZoom - The minimum zoom level | ||
* @param {number} maxZoom - The maximum zoom level | ||
* @returns The zoom target | ||
*/ | ||
declare const createZoomTarget: (zoomX: number, zoomY: number, minZoom?: number, maxZoom?: number) => number; | ||
/** | ||
* Gets the zoom target to fit the given node positions into the scene | ||
* @param {Point[]} nodePositions - The node positions | ||
* @param {number} containerWidth - The width of the container NVL is displayed in | ||
* @param {number} containerHeight - The height of the container NVL is displayed in | ||
* @param {number} maxNodeRadius - The maximum node radius, which is added as margin to the scene (defaults to `50`) | ||
* @returns | ||
*/ | ||
declare const getZoomTargetForNodePositions: (nodePositions: Point[], containerWidth: number, containerHeight: number, maxNodeRadius?: number) => number; | ||
declare const getFlexibleZoomLimit: (nodePositions: Point[], rect: HTMLCanvasElement, maxNodeRadius: number) => number; | ||
@@ -23,2 +54,2 @@ declare const getNewZoomWithinLimits: (newZoom: number, oldZoom: number, minZoom: number, maxZoom: number) => number; | ||
declare const getDynamicZoom: (nodePositions: Point[] & Node[], minZoom: number, maxZoom: number, rect: HTMLCanvasElement, newZoom: number, currentZoom: number) => number; | ||
export { getFlexibleZoomLimit, isZoomOutAtLimit, getNewZoomWithinLimits, getExtremeLimits, getMaxDistance, getPositionBoundaries, getZoomLevel, createZoomTarget, getDynamicZoom }; | ||
export { getFlexibleZoomLimit, getZoomTargetForNodePositions, isZoomOutAtLimit, getNewZoomWithinLimits, getExtremeLimits, getMaxDistance, getPositionBoundaries, getZoomLevel, createZoomTarget, getDynamicZoom }; |
{ | ||
"name": "@neo4j-nvl/base", | ||
"version": "0.3.6-ade05d13", | ||
"version": "0.3.6-d168b648", | ||
"license": "SEE LICENSE IN 'LICENSE.txt'", | ||
@@ -31,3 +31,3 @@ "homepage": "https://neo4j.com/docs/nvl/current/", | ||
"dependencies": { | ||
"@neo4j-nvl/layout-workers": "0.3.6-ade05d13", | ||
"@neo4j-nvl/layout-workers": "0.3.6-d168b648", | ||
"@segment/analytics-next": "^1.70.0", | ||
@@ -34,0 +34,0 @@ "color-string": "^1.9.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1211219
2930
+ Added@neo4j-nvl/layout-workers@0.3.6-d168b648(transitive)
- Removed@neo4j-nvl/layout-workers@0.3.6-ade05d13(transitive)