feat(minimap): add maskStrokeWidth and maskStrokeColor

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