Merge pull request #2562 from wbkd/feat/minimap-props

feat(minimap): add maskStrokeWidth and maskStrokeColor
This commit is contained in:
Moritz Klack
2022-11-15 16:49:14 +01:00
committed by GitHub
3 changed files with 11 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@reactflow/minimap': minor
---
Add maskStrokeColor and maskStrokeWidth props
+4
View File
@@ -48,6 +48,8 @@ function MiniMap({
nodeBorderRadius = 5,
nodeStrokeWidth = 2,
maskColor = 'rgb(240, 240, 240, 0.6)',
maskStrokeColor = 'none',
maskStrokeWidth = 1,
position = 'bottom-right',
onClick,
onNodeClick,
@@ -181,6 +183,8 @@ function MiniMap({
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`}
fill={maskColor}
fillRule="evenodd"
stroke={maskStrokeColor}
strokeWidth={maskStrokeWidth}
/>
</svg>
</Panel>
+2
View File
@@ -11,6 +11,8 @@ export type MiniMapProps<NodeData = any> = Omit<HTMLAttributes<SVGSVGElement>, '
nodeBorderRadius?: number;
nodeStrokeWidth?: number;
maskColor?: string;
maskStrokeColor?: string;
maskStrokeWidth?: number;
position?: PanelPosition;
onClick?: (event: MouseEvent, position: XYPosition) => void;
onNodeClick?: (event: MouseEvent, node: Node<NodeData>) => void;