chore(custom-minimap-node-example): cleanup
This commit is contained in:
@@ -8,6 +8,7 @@ import ReactFlow, {
|
||||
Controls,
|
||||
Edge,
|
||||
MiniMap,
|
||||
MiniMapNodeProps,
|
||||
Node,
|
||||
ReactFlowInstance,
|
||||
useEdgesState,
|
||||
@@ -25,6 +26,10 @@ const buttonStyle: CSSProperties = {
|
||||
zIndex: 4,
|
||||
};
|
||||
|
||||
const CustomMiniMapNode = ({ x, y, width, height, color }: MiniMapNodeProps) => (
|
||||
<circle cx={x} cy={y} r={Math.max(width, height) / 2} fill={color} />
|
||||
);
|
||||
|
||||
const CustomMiniMapNodeFlow = () => {
|
||||
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
||||
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
||||
@@ -66,8 +71,4 @@ const CustomMiniMapNodeFlow = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const CustomMiniMapNode = ({ x, y, width, height }) => (
|
||||
<circle cx={x} cy={y} r={Math.max(width, height)} />
|
||||
)
|
||||
|
||||
export default CustomMiniMapNodeFlow;
|
||||
|
||||
Reference in New Issue
Block a user