@reactflow/minimap
Advanced tools
Comparing version 11.4.1 to 11.5.0
@@ -40,3 +40,3 @@ import { jsx, jsxs } from 'react/jsx-runtime'; | ||
// a component properly. | ||
nodeComponent: NodeComponent = MiniMapNode$1, maskColor = 'rgb(240, 240, 240, 0.6)', maskStrokeColor = 'none', maskStrokeWidth = 1, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel = 'React Flow mini map', }) { | ||
nodeComponent: NodeComponent = MiniMapNode$1, maskColor = 'rgb(240, 240, 240, 0.6)', maskStrokeColor = 'none', maskStrokeWidth = 1, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel = 'React Flow mini map', inversePan = false, zoomStep = 10 }) { | ||
const store = useStoreApi(); | ||
@@ -74,3 +74,3 @@ const svg = useRef(null); | ||
(event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) * | ||
10; | ||
zoomStep; | ||
const zoom = transform[2] * Math.pow(2, pinchDelta); | ||
@@ -85,5 +85,6 @@ d3Zoom.scaleTo(d3Selection, zoom); | ||
// @TODO: how to calculate the correct next position? Math.max(1, transform[2]) is a workaround. | ||
const moveScale = viewScaleRef.current * Math.max(1, transform[2]) * (inversePan ? -1 : 1); | ||
const position = { | ||
x: transform[0] - event.sourceEvent.movementX * viewScaleRef.current * Math.max(1, transform[2]), | ||
y: transform[1] - event.sourceEvent.movementY * viewScaleRef.current * Math.max(1, transform[2]), | ||
x: transform[0] - event.sourceEvent.movementX * moveScale, | ||
y: transform[1] - event.sourceEvent.movementY * moveScale, | ||
}; | ||
@@ -108,3 +109,3 @@ const extent = [ | ||
} | ||
}, [pannable, zoomable]); | ||
}, [pannable, zoomable, inversePan, zoomStep]); | ||
const onSvgClick = onClick | ||
@@ -111,0 +112,0 @@ ? (event) => { |
/// <reference types="react" /> | ||
import type { MiniMapProps } from './types'; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, }: MiniMapProps): JSX.Element; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep }: MiniMapProps): JSX.Element; | ||
declare namespace MiniMap { | ||
@@ -5,0 +5,0 @@ var displayName: string; |
@@ -20,2 +20,4 @@ import type { ComponentType, CSSProperties, HTMLAttributes, MouseEvent } from 'react'; | ||
ariaLabel?: string | null; | ||
inversePan?: boolean; | ||
zoomStep?: number; | ||
}; | ||
@@ -22,0 +24,0 @@ export interface MiniMapNodeProps { |
/// <reference types="react" /> | ||
import type { MiniMapProps } from './types'; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, }: MiniMapProps): JSX.Element; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep }: MiniMapProps): JSX.Element; | ||
declare namespace MiniMap { | ||
@@ -5,0 +5,0 @@ var displayName: string; |
@@ -20,2 +20,4 @@ import type { ComponentType, CSSProperties, HTMLAttributes, MouseEvent } from 'react'; | ||
ariaLabel?: string | null; | ||
inversePan?: boolean; | ||
zoomStep?: number; | ||
}; | ||
@@ -22,0 +24,0 @@ export interface MiniMapNodeProps { |
{ | ||
"name": "@reactflow/minimap", | ||
"version": "11.4.1", | ||
"version": "11.5.0", | ||
"description": "Minimap component for React Flow.", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@reactflow/core": "11.6.1", | ||
"@reactflow/core": "11.7.0", | ||
"@types/d3-selection": "^3.0.3", | ||
@@ -36,0 +36,0 @@ "@types/d3-zoom": "^3.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
153984
762
+ Added@reactflow/core@11.7.0(transitive)
- Removed@reactflow/core@11.6.1(transitive)
Updated@reactflow/core@11.7.0